LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 12-08-2003, 09:18 PM   #91
vincebs
Member
 
Registered: Oct 2003
Location: Mississauga, ON
Distribution: Ubuntu 9.04
Posts: 494

Rep: Reputation: 30

Well what exactly is the source of my problem then? I included in xconfig all the modules I thought my computer would need. I used the help entries to help me decide. Yet I still get the unresolved symbols errors and my new kernel ends up being unable to load many modules. If I just copy what's in my 2.4 configuration file, then take out stuff that I think I don't need, the configuration's going to look just like it did when I didn't use the 2.4 configuration as a guide.
 
Old 12-08-2003, 09:48 PM   #92
Thetargos
Senior Member
 
Registered: Mar 2003
Location: Mexico City
Distribution: Fedora, Ubuntu & Mint
Posts: 1,679

Original Poster
Rep: Reputation: 45
What compiler version are you using, I see u use two distros, is this in RH or SuSE? if in RH, you may check what gcc version you have by:
Code:
gcc --version
gcc296 --version
You should at least have gcc version 3.2 (gcc command) and the legacy compiler compatibility gcc296 (gcc 2.96 version). Also you may try to compile the kernel with either of those. To that end you may either:
  • export the CC enviroment variable (export CC="gcc296"), or
  • Change all instances of gcc to gcc296 in the top level Makefile under your 2.6 kernel sources.
Those should work, at least to attempt a 2.96 gcc compilation. That should get rid of those nasty UR (also you may be getting UR because of incomplete module load sequence... but that's another story). Try gcc296 first and then post back.

Last edited by Thetargos; 12-08-2003 at 09:49 PM.
 
Old 12-09-2003, 07:22 AM   #93
avios
LQ Newbie
 
Registered: Oct 2003
Posts: 16

Rep: Reputation: 0
Automated Kernel Recompile !

A very good article ! Must be praised ! But most ppl these days are very busy and so it becomes a pain to come back to the monitor everytime to see everystep of the kernel being compiled and then typing the appropriate commands like make to do the rest of the action. Welcome to The Automated Kernel Script ! Just configure your kernel and then have ur kernel image automatically created with this script.

Copy this script below and save it as a file and run the script.

-----------------------------------------------------------------------------------------------
# Automated Kernel Recompilation By Avinash Shankar
# Note: This was done under RH-7.3 so plz verify the paths
# Warning: Please run the Script under Xwindows

#going to kernel sources directory:
echo Entering Kernel Source Directory................
cd /usr/src/linux-2.4/

#Cleaning dep files and objs:
echo Cleaning up Junk files..................
make clean

#Configuring your New Kernel:
echo Entering Graphical kernel config.....................
make xconfig

#Making the dependencies files:
echo Making the dependecies ..................
make dep

#Backing up old module files
echo All your module files and system.map files backed up ................
mv /lib/modules/2.4.18-3/modules.dep modules.dep.old
mv /usr/src/linux-2.4/System.map System.map.old

#Make a compressed kernel:
echo Compressing the kernel image ..............................................
make bzImage

#Copy the Image to /boot directory
echo Copying the bzImage to /boot Directory......................................................
cp /usr/src/linux-2.4/arch/i386/boot/bzImage /boot

#Make the modules :
echo Compiling the Modules ...............................
make modules

#Make the Installable modules used by the new kernel
echo Making the modules executable ...................................
make modules_install

#copy the System.map file to /boot
echo Copying System.map file to /boot ....................................
cp /usr/src/linux-2.4/System.map /boot

echo Thats it you are finished ! Cool now edit the lilo.conf or your grub.conf file
echo located in the /boot directory. Copy the kernel entries and replace kernel with
echo the bzImage file and the initrd entry with System.map

-----------------------------------------------------------------------------------------------

Hope this script is used by a lot of ppl ................ Thats all a good programmer will hope for .............................. Purpose Served...

P.S If you modify or enchance this script plz post me a mail ...........

luv

Avinash Shankar
 
Old 12-09-2003, 01:23 PM   #94
Thetargos
Senior Member
 
Registered: Mar 2003
Location: Mexico City
Distribution: Fedora, Ubuntu & Mint
Posts: 1,679

Original Poster
Rep: Reputation: 45
Have you tried it yourself yet? The last time I tried that, I ended up with the script being interrupted when you exited either make xconfig or make menuconfig... so that's why I ask.
 
Old 12-09-2003, 06:43 PM   #95
avios
LQ Newbie
 
Registered: Oct 2003
Posts: 16

Rep: Reputation: 0
If you realize with out a kernel config script the rest of the script cannot work . That is you need a config file to configure your kernel modules ! I have tested the script many times and Have had successful compilation of kernel throughout ! So it does work ! After you use xconfig or make menuconfig please save the config file ! { the Save and exit button in Xconfig} . Please let me know if its worked out for you !

regards
 
Old 12-10-2003, 10:43 AM   #96
artur
Member
 
Registered: Apr 2002
Location: Illinois, US
Distribution: Red Hat, Fedora, Yellow Dog, Debian, FreeBSD, Embedix
Posts: 106

Rep: Reputation: 15
Re: Automated Kernel Recompile !

Quote:
Originally posted by avios
most ppl these days are very busy and so it becomes a pain to come back to the monitor everytime to see everystep of the kernel being compiled and then typing the appropriate commands like make to do the rest of the action.
You are right, we're all busy, but the kernel is such an important part of the system that it's recompilation should not be taken lightly. Another words: if you don't have the time to do it right and monitor the process - don't do it.

Quote:
Welcome to The Automated Kernel Script ! Just configure your kernel and then have ur kernel image automatically created with this script.
Well intended, but not a good idea, I'm afraid. If kernel is recompiled step by step there is a chance that person compiling it will catch any error messages and do something about them before something gets messed up... Your script does not check for sucessful completion of operations nor does it keep any logs of what's going on. I guess you truly are a busy person to not add these features to your script

Quote:
# Warning: Please run the Script under Xwindows
Why? What if one does not run X on the box they want to compile on? The script should check if X is available/running and launch 'make menuconfig' if not.

Quote:
#Backing up old module files
echo All your module files and system.map files backed up ................
mv /lib/modules/2.4.18-3/modules.dep modules.dep.old
Are the modules really backed up here? Or maybe just the module dependency file? And what's gonna happen to my original modules.dep file if I re-run the script? Should your script really say that the files are backed up before it even tries to back them up?

Quote:
#Make a compressed kernel:
echo Compressing the kernel image ..............................................
make bzImage
how about something like make bzImage 2>&1 | tee make.log?

Quote:
#Copy the Image to /boot directory
echo Copying the bzImage to /boot Directory......................................................
cp /usr/src/linux-2.4/arch/i386/boot/bzImage /boot
So, the second time this script is run, the previous kernel will get wiped out without even waiting to see if modules compile o.k.?

These are jus a few major things that would need improvement.

Please don't take this as a flame. It is not my intention to flame you. I just want to point out that using a script like yours is not a good idea, and even if it was, your script needs a lot of improvement before it can be used. A quick hack like this is just fine for personal use, but before you offer it for others to use, please put some effort into it. Think about responsibility you take (moral if not legal) if someone uses your script and messes up their computer because the script does not check for anything nor log anything.

Your easy reply would be "write your own script if you think you can do it better smart a??". I won't , because like I said I don't think it is a good idea and because I'm busy . But I when I compile my kernels I do take my time to go step by step and log a lot.
 
Old 12-10-2003, 01:58 PM   #97
Thetargos
Senior Member
 
Registered: Mar 2003
Location: Mexico City
Distribution: Fedora, Ubuntu & Mint
Posts: 1,679

Original Poster
Rep: Reputation: 45
It could be somewhat beneficial to new users know that they can start a kernel re-compile without much of the hassle, however (as artur says) since it is such an important part of the system (heck its the HEART of the system ) anyone compiling a kernel should know something about the endevour he/she is going to undertake. On that regard the kernel's own Documentation is a precious jewl, as are the many help tid bits embeded in the tools to configure it.

I do support the idea of a kernel compilation script. If you let me, I may add some modifications to the code that may help improve its usefulness.

Regards.

Gian Paolo Mureddu
AKA Thetargos.
 
Old 12-10-2003, 08:17 PM   #98
avios
LQ Newbie
 
Registered: Oct 2003
Posts: 16

Rep: Reputation: 0
Thanks for the very detailed reply ! I am very happy u pointed out the logical problems in the script artur ! Unfortuantely I got introduced to shell scripts a week bak only ! and this was a personal release ... Like I said before Its for newbies who desperately require a kernel for thier system but do not know about the commands. Futher I feel its important to record the steps in compiling the kernel image some place. Which is why I felt that such a script would be a good start.

U could replace xconfig with make menuconfig for text mode ! But most ppl use X as default these days ! And the xconfig is a much easier program for newbies to use !

Thetargos I would very much appreiciate ur support and modification of the script ! All I ask in return is acknowledgement for my script and a copy of your modifications here at the msg board !

Thanks very for the response guys ! I will work more and try to incorporate your ideas and comments into the next version .............

regards
 
Old 12-10-2003, 09:19 PM   #99
artur
Member
 
Registered: Apr 2002
Location: Illinois, US
Distribution: Red Hat, Fedora, Yellow Dog, Debian, FreeBSD, Embedix
Posts: 106

Rep: Reputation: 15
Good luck with your project guys.
A few more suggestions then if I may:
Your scripts will love you if you begin them with magic, e.g.
#!/bin/bash
open any script that came with your system - you'll see it there

From my own experience I learned that it is a good idea to timestamp whatever you can, especially backup files. I'd start the script with this:
my_timestamp=$(date +%y%m%d-%H%M)

and then do things like
cp /usr/src/linux-2.4/System.map /boot/System.map.$my_timestamp
ln /boot/System.map.$my_timestamp /boot/System.map

Also, right after you finish configuring the kernel it is recommended to edit toplevel Makefile and change EXTRAVERSION variable. I'd do this:
cat Makefile | sed -e 's/EXTRAVERSION = .*/EXTRAVERSION = -$my_timestamp/' > /tmp/Makefile.tmp; cat /tmp/Makefile.tmp > Makefile
all the above on one line

And please use a lot of "if" and ">> log.$my_timestamp 2>&1"

I don't want to spoil your fun any further. Enjoy figuring out the rest yourselves.

Thetargos: thank you for mentioning the documentation so frequently. Answers to many questions I see asked are in the docs!

I still think it's not a good idea
 
Old 12-12-2003, 12:18 AM   #100
vincebs
Member
 
Registered: Oct 2003
Location: Mississauga, ON
Distribution: Ubuntu 9.04
Posts: 494

Rep: Reputation: 30
Quote:
Originally posted by Thetargos
What compiler version are you using, I see u use two distros, is this in RH or SuSE? if in RH, you may check what gcc version you have by:
Code:
gcc --version
gcc296 --version
You should at least have gcc version 3.2 (gcc command) and the legacy compiler compatibility gcc296 (gcc 2.96 version). Also you may try to compile the kernel with either of those. To that end you may either:
  • export the CC enviroment variable (export CC="gcc296"), or
  • Change all instances of gcc to gcc296 in the top level Makefile under your 2.6 kernel sources.
Those should work, at least to attempt a 2.96 gcc compilation. That should get rid of those nasty UR (also you may be getting UR because of incomplete module load sequence... but that's another story). Try gcc296 first and then post back.
No luck. I replaced all the references to gcc in Makefile to gcc296. Then I compiled again. The Unresolved Symbols errors still appear. It gave me a warning though to install mod-init-tools, which I did but to no avail.
 
Old 12-12-2003, 12:32 AM   #101
Thetargos
Senior Member
 
Registered: Mar 2003
Location: Mexico City
Distribution: Fedora, Ubuntu & Mint
Posts: 1,679

Original Poster
Rep: Reputation: 45
Even after recompiling with gcc (3.2) and gcc296? I know there is a mod-utils packageespecially made for 2.6 kernels, though I haven't found it yet for Red Hat Linux systems (or Fedora for that matter). Some gentoo folks have to install it in order to get a 2.6 kernel properly working. Maybe what you are lacking has something to do with that? I don't know.
 
Old 12-12-2003, 12:36 AM   #102
vincebs
Member
 
Registered: Oct 2003
Location: Mississauga, ON
Distribution: Ubuntu 9.04
Posts: 494

Rep: Reputation: 30
I downloaded a file called module-init-tools-0.9.14.tar.gz and installed whatever was in it.

So far I've tried:
1.) Compiling normally
2.) Copying my original config-2.4.20-8 to the /usr/src/linux directory and then compiling
3.) using make mrproper instead of make clean and then compiling
4.) Using make config instead of make xconfig and then compiling
5.) Deleting the new 2.6.0 kernel files (initrd, System.map, vmlinuz, plus the /lib/modules) before recompiling again
5.) Using gcc296 instead of gcc to compile
6.) Installing module-init-tools 0.9.1.4 and then compiling

I still get unresolved symbols errors no matter what is tried

Last edited by vincebs; 12-12-2003 at 12:41 AM.
 
Old 12-12-2003, 02:43 PM   #103
Thetargos
Senior Member
 
Registered: Mar 2003
Location: Mexico City
Distribution: Fedora, Ubuntu & Mint
Posts: 1,679

Original Poster
Rep: Reputation: 45
What modules do you get unresolved symbols in?
 
Old 12-12-2003, 06:08 PM   #104
vincebs
Member
 
Registered: Oct 2003
Location: Mississauga, ON
Distribution: Ubuntu 9.04
Posts: 494

Rep: Reputation: 30
I get unresolved symbols in basically every section, agp, i2c, i2o, networking, CD-ROM, IEEE394, everything.

The basic format of the error is:
"depmod: *** Unresolved symbols in ..."

There are hundreds of UR errors, here are the first few dozen::
/lib/modules/2.6.0-test10/kernel/drivers/char/agp/ali-agp.ko
/lib/modules/2.6.0-test10/kernel/drivers/char/agp/amd-k7-agp.ko
/lib/modules/2.6.0-test10/kernel/drivers/char/agp/intel-agp.ko
/lib/modules/2.6.0-test10/kernel/drivers/char/agp/sis-agp.ko
/lib/modules/2.6.0-test10/kernel/drivers/char/agp/sworks-agp.ko
/lib/modules/2.6.0-test10/kernel/drivers/char/agp/via-agp.ko
/lib/modules/2.6.0-test10/kernel/drivers/char/ipmi/ipmi_devintf.ko
/lib/modules/2.6.0-test10/kernel/drivers/char/ipmi/ipmi_kcs_drv.ko
/lib/modules/2.6.0-test10/kernel/drivers/char/ipmi/ipmi_watchdog.ko
/lib/modules/2.6.0-test10/kernel/drivers/char/lp.ko
/lib/modules/2.6.0-test10/kernel/drivers/char/ppdev.ko
/lib/modules/2.6.0-test10/kernel/drivers/char/tipar.ko
/lib/modules/2.6.0-test10/kernel/drivers/i2c/algos/i2c-algo-bit.ko
/lib/modules/2.6.0-test10/kernel/drivers/i2c/algos/i2c-algo-pcf.ko
/lib/modules/2.6.0-test10/kernel/drivers/i2c/busses/i2c-ali1535.ko
/lib/modules/2.6.0-test10/kernel/drivers/i2c/busses/i2c-ali15x3.ko
/lib/modules/2.6.0-test10/kernel/drivers/i2c/busses/i2c-amd756.ko
/lib/modules/2.6.0-test10/kernel/drivers/i2c/busses/i2c-elektor.ko
/lib/modules/2.6.0-test10/kernel/drivers/i2c/busses/i2c-elv.ko
/lib/modules/2.6.0-test10/kernel/drivers/i2c/busses/i2c-i801.ko
/lib/modules/2.6.0-test10/kernel/drivers/i2c/busses/i2c-i810.ko
/lib/modules/2.6.0-test10/kernel/drivers/i2c/busses/i2c-isa.ko
/lib/modules/2.6.0-test10/kernel/drivers/i2c/busses/i2c-philips-par.ko
/lib/modules/2.6.0-test10/kernel/drivers/i2c/busses/i2c-piix4.ko
/lib/modules/2.6.0-test10/kernel/drivers/i2c/busses/i2c-sis5595.ko
/lib/modules/2.6.0-test10/kernel/drivers/i2c/busses/i2c-velleman.ko
/lib/modules/2.6.0-test10/kernel/drivers/i2c/busses/i2c-via.ko
 
Old 12-13-2003, 05:53 PM   #105
DropHit
Member
 
Registered: Oct 2003
Posts: 95

Rep: Reputation: 15
How do i include my HPT drivers in this?

OK looks good easy to follow, although how do i include my HPT 370 drivers into this setup?

Zack

They where loaded when i used the standad RH9 installer program and used linux expert hde=noprobe from installer command line..

Z
 
  


Reply

Tags
howto, tutorial


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Red Hat/Fedora ALSA mini-HowTo. Thetargos Red Hat 182 04-01-2006 12:12 PM
red hat 9 kernel compilation b0nd Linux - Newbie 1 08-11-2005 10:05 AM
Kernel compilation (2.4.25 - Red Hat) on DELL Inspiron 2650 rohitmordani Linux - Laptop and Netbook 7 04-05-2004 05:10 PM
Red Hat does not plan to release another product in the red hat linux line... Whitehat General 5 11-03-2003 06:33 PM
Red Hat Update Agent for kernel updates and custom kernels SparceMatrix Linux - General 5 09-03-2002 04:58 PM


All times are GMT -5. The time now is 06:57 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration