Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Simple...how do I recompile the Linux kernel??
I just wanna get rid of all my Linux questions at once...:P
Thanx!! ;)
Note: I'm not a lazy person...I already looked thru Google like a hour and a half...and all I find is NOTHING!! :@
El-Trucha
http://www.masterleito.ath.cx
ftp://tsfc.homeftp.net
hotline://tsfc.ath.cx

Do you have all the RH9 install CDs including the documentation CD?
One of the manuals has a section on Kernel builds.
Guy

Ooohh...I'll download the documentation CD!! ;)
Much thanx!! :D:DEl-Trucha
http://www.masterleito.ath.cx
ftp://tsfc.homeftp.net
hotline://tsfc.ath.cx

You searched with Google for 90 minutes and couldn't find anything about compiling the linux kernel? I find that hard to believe
First link: LinuxPlanet - Tutorials - How to Compile the Linux Kernel

Well...I found many stuff...but none worked, all of the tutorials I found ended up giving me different errors...:(
Thanx!! ;)El-Trucha
http://www.masterleito.ath.cx
ftp://tsfc.homeftp.net
hotline://tsfc.ath.cx

What sort of errors? What version kernel are you trying to compile as there have been a few changes in the newer 2.6 kernels (eg no need to "make dep" anymore)? Compilation instructions are also included in the README file with the source. I recompiled my 2.6.6 kernel again the other day and it went something like:
Enter the source directory
# cd /usr/linux/source
Clean it up
# make mrproper
Create a Makefile by using a GUI interface
# make gconfig
Compile the code
# make
Install the modules
# make modules_install
Copy the kernel to /boot
# cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.6
Edit my bootloader to reflect changes
# emacs /etc/lilo.conf
Write it to my MBR and reboot
# lilo && rebootThere are slightly different methods for different kernels, eg on older versions I would edit the Makefile before compiling to add an "EXTRAVERSION=foobar" to distinguish between different builds but you can do that during the config stage now.

Umm...I use GRUB, not LILO (and Stitch). :P
Is it grub.conf??
Also...the last time I tried it, it automatically added itself to GRUB...so I dont think that would b a problem...:P
Thanx!! ;)El-Trucha
www.masterleito.ath.cx
ftp://tsfc.homeftp.net
hotline://tsfc.ath.cx

Well...:(
I get to "make modules_install" and I get this:if [ -r System.map ]; then /sbin/depmod -ae -F System.map 2.6.8.1; fi
depmod: *** Unresolved symbols in /lib/modules/2.6.8.1/kernel/drivers/scsi/ipr.ko
depmod: request_firmware
depmod release_firmwareIt already had compiled like 17 modules before this message...
Hmm...at the top, just after I typed in "make modules_install", it says this:Warning: you may need to install module-init-tools
What does this mean??
Thanx!! ;)El-Trucha
http://www.masterleito.ath.cx
ftp://tsfc.homeftp.net
hotline://tsfc.ath.cx

Sounds like you nmay be upgrading from a 2.4.x kernel to 2.6.x. The newer kernel handles modules slightly differently so you will need to also upgrade modutils. Here's a link explaining how to upgrade from 2.4 to 2.6 on a redhat 9 distro:
http://www.linux-sxs.org/upgrading/migration26.htmlNB "...You shouldn't start your first kernel recompile on the occasion of migrating to 2.6 (there are precompiled 2.6 kernels for Redhat to be found in [8]). So it is assumed that you have done a recompile of a 2.4 kernel before...."
You can download module-init-tools from here: http://www.kernel.org/pub/linux/kernel/people/rusty/modules/

Didnt work...:(
I did everything they told me there, and I get this at bootup:VFS: Cannot open root device "LABEL=/" or unknown-block(0,0)
Please append a correct "root=" boot option
Kernel panic: VFS: Unable to mount root fs on unknown-block(0,0)Those are the three last lines before stopping bootup...:(
Sorry for being so dumb, but I'm a Linux newbie...:P
Much much thanx!! ;)El-Trucha
http://www.masterleito.ath.cx
ftp://tsfc.homeftp.net
hotline://tsfc.ath.cx

In your grub.conf file change the line that looks like:
kernel /boot/vmlinuz-2.6.1 ro root=LABEL=/
to
kernel /boot/vmlinuz-2.6.1 ro root=/dev/hda2
Where "/dev/hda2" is your root partition, you may need to change it to something like /dev/hdb1 etc

kernel /vmlinuz-2.6.x.x ro root=/dev/hdb3
(I think "x.x" was 8.1, not sure...)
Didnt work...:'(VFS: Cannot open root device "hdb3" or unknown-block(0,0)
Please append a correct "root=" boot option
Kernel panic: VFS: Unable to mount root fs on unknown-block(0,0)That's what I have after changing the LABEL=/ thing...
Hmm...I dont think this is the problem because my old 2.4 kernel worked fine with it...
Also, it says "/vmlinuz..." and not "/boot/vmlinuz...".
What's the problem now?? :(Another question: Will installing this new kernel fix a problem that I have that "sendmail" takes like 5 minutes to load on bootup?? :(
I really like this new kernel, it has NTFS support!! :D
Much thanx!! ;)
El-Trucha
http://www.masterleito.ath.cx
ftp://tsfc.homeftp.net
hotline://tsfc.ath.cx

Post up the whole of your grub.conf file. Your 2.6 entry should look very similar to the working 2.4 one with the exception of the vmlinuz bit. Where did you copy the new kernel to and what is it called (eg /boot/bzImage). After compiling the source the new kernel will be arch/i386/boot/bzImage and should be copied to /boot with possibly a more descriptive name.
Some more useful info you could post up would be the outputs of:
$ ls /boot
and
$ cat /proc/partitions
You might also want to make a floppy boot disk just in case you end up not being able to boot your PC at all! You can do this with the mkbootdisk command.Read support has been available in the kernel for quite a while now, not too sure about how good the write support is at the mo. Last time I looked you could only write to an existing file so long as you don't change the file size by more than 1Kb....otherwise you may cause data loss. For safe NTFS writing use captive (www.jankratochvil.net/project/captive/).
I don't reckon changing kernel will help with the sendmail problem. Do you actually use sendmail? If not disable it from starting at boot time.

OK...here is my grub.conf file (I didnt post the lines starting with "#", only the last one):
NOTE: To avoid confusion, I'm gonna put the code/messages between -'s--------------------
#boot=/dev/hda
default=1
timeout=10
splashimage=(hd1,1)/grub/splash.xpm.gz
title Red Hat Linux (2.6.8.1)
root (hd1,1)
kernel /vmlinuz-2.6.8.1 ro root=/dev/hdb3 hdd=ide-scsi
initrd /initrd-2.6.8.1.img
title Red Hat Linux (2.4.20-8)
root (hd1,1)
kernel /vmlinuz-2.4.20-8 ro root=LABEL=/ hdd=ide-scsi
initrd /initrd-2.4.20-8.img
title Windows XP Home Edition
rootnoverify (hd0,0)
chainloader +1
--------------------The only thing I changed from the original was the LABEL=/ thing u told me on post 11 and I also changed the name "DOS" to "Windows XP Home Edition" :P
This is what I get when I type in "ls /boot":--------------------
boot.b message System.map-2.6.8.1
chain.b message.ja System.map-2.6.8.1.old
grub module-info vmlinux-2.4.20-8
initrd-2.4.20-8.img module-info-2.4.20-8 vmlinuz
initrd-2.6.8.1.img os2_d.b vmlinuz-2.4.20-8
kernel.h System.map vmlinuz-2.6.8.1
lost+found System.map-2.4.20-8 vmlinuz-2.6.8.1.old
--------------------
And this is what I get when I type "cat /proc/partitions"--------------------
major minor #blocks name rio rmerge rsect ruse wio wmerge wsect wuse runni
ng use aveq
22 0 648986 hdc 1 3 16 1480 0 0 0 0 -8995 6279010 36940280
3 0 39082680 hda 452 219 931 2400 1 0 1 0 -9 6294690 29335575
3 1 38911288 hda1 19 105 248 150 0 0 0 0 0 150 150
3 2 1 hda2 0 0 0 0 0 0 0 0 0 0 0
3 5 166288 hda5 431 108 667 2230 1 0 1 0 0 2230 2230
3 64 39082680 hdb 42048 33768 597750 279810 11333 28158 315920 1069770 -
9 6292260 30683945
3 65 28289488 hdb1 19 105 248 160 0 0 0 0 0 160 160
3 66 105840 hdb2 118 1164 2564 480 44 56 200 940 0 1190 1420
3 67 9699480 hdb3 41896 32452 594754 279060 11064 27608 309968 650650 0
241950 930160
3 68 1 hdb4 0 0 0 0 0 0 0 0 0 0 0
3 69 982768 hdb5 13 41 168 80 225 494 5752 418180 0 418260 418260
--------------------Do u see what the problem is??
Much thanx!! ;)Btw...I have Captive, I had it for a while but I dont know what command 2 use...:( what is it?? :P
Another btw...how do I disable sendmail??
Thanx!! ;)El-Trucha
http://www.masterleito.ath.cx
ftp://tsfc.homeftp.net
hotline://tsfc.ath.cx

What are the partitions on hdb? I'm guessing that it is a 40Gb drive.
hdb1 = 28Gb = / (root)
hdb2 = 100Mb = /boot
hdb3 = 10Gb = /home
hdb4 = extended partition
hdb5 = 1Gb = swap
The above is just a guess, you can check by looking at /etc/fstab or by using the "df -h" command. If the 28Gb partition is your root then you want to use that in grub.

No, hdb1 is my Windows partition there...:P
Root is hdb3, and that's what I'm using in GRUB...
Thanx!! ;)El-Trucha
http://www.masterleito.ath.cx
ftp://tsfc.homeftp.net
hotline://tsfc.ath.cx

Did you compile support for the file system that you are using for your root partition in the new kernel? What is it (eg ext2/3, reiser)? Did you select it as a module or not? If it is not compiled into the kernel itself but as a module instead you will need to create a boot initialised ram disk (initrd), but it is easier for you to just select it in the kernel rather than a module.
Just out of interest what's on hda1 and hda5 (ie your primary master drive)?
I'm sure that there is a graphical tool in redhat to select what services are started at boot time but I'll tell you how to do it manually so you'll learn how the boot process works. There are a bunch of scripts usually under /etc/init.d/ which control the daemons, for example /etc/init.d/sendmail. You can use these scripts manually to start, stop, restart or query the status of the service.
# /etc/init.d/sendmail start
# /etc/init.d/sendmail stop
# /etc/init.d/sendmail restart
# /etc/init.d/sendmail status
When you boot you go into what is called a runlevel. They are as follows:
runlevel 0 = halt (power off)
runlevel 1 = maitenance mode (like safe mode)
runlevel 2 = rarely used basic text mode
runlevel 3 = multi user networked text mode
runlevel 4 = not often used, can be user defined
runlevel 5 = multi user networked graphical mode
runlevel 6 = restart
Now there are also 7 directories, one for each runlevel, /etc/rc.d/rc0.d, /etc/rc.d/rc1.d, /etc/rc.d/rc2.d etc and in these directories are symbolic links pointing to those scripts I mentioned earlier. The names of these links indicate when they are run. Ones beginning with S are run when starting the runlevel and the ones beginning with K when ending or killing the session. They are run in numerical order so S30ssh would start before S40sendmail.Now after all that, to disable the service simply delete the link in the runlevel directory that you don't want it starting in, I'm guessing for you you want to delete /etc/init.d/rc3.d/S99sendmail and /etc/init.d/rc5.d/S99sendmail (the 99 bit is a guess.
Back to your kernel problem, did it all finally compile without errors? Have you tried compiling the source for the current 2.4 kernel that you are running? The source will be on the installation CDs as an rpm called something like kernel-source-2.4.16.rpm. Why do you need to recompile the kernel anyway?

I made it ext3, and I dont know if its a module or not...:(
hda1 is my Windows partition where WinXP is installed (hdb1 is another Windows partition, but it's just to put important things there...) and hda5 is a FAT32 partition to share between XP and Linux...
I already knew the runlevel thing, but not where the directories are... :)
I disabled S80sendmail in both folders...thanx!! ;)
And no, it still has errors...and I once downloaded the kernel source from the Redhat autoupdater, but after that, I formatted, and then I retried downloading it again, but the updater messed up and I cant use it anymore...:(
I'll try the RPM on the CD!! ;)
And I want 2 recompile it because ePSXe (the PSX emulator) says it cant load fbconfig or something like that, and I read somewhere that a guy had the same problem and he fixed it recompiling the kernel...:PThanx!! ;)
El-Trucha
http://www.masterleito.ath.cx
ftp://tsfc.homeftp.net
hotline://tsfc.ath.cx

I don't think recompiling your kernel will help you with that, you probably just don't have it installed. It's now called pUniConf and you can download it from here:
http://sourceforge.net/projects/fbconfig/
Also make sure that you have the correct drivers for your graphics card, if it is nvidia or ati you should be in luck, just visit their website and download their driver as opposed to the one that is shipped with the distro.

Hmm...how do I compile that program?? I downloaded the only file they had there...:P
And yeah, I have the correct drivers for my videocard...
Thanx!! ;)El-Trucha
http://www.masterleito.ath.cx
ftp://tsfc.homeftp.net
hotline://tsfc.ath.cx

I don't think you do compile it as it is a perl script. Make the file executable and then move it into one of your paths:
$ chmod +x fbocnfig.pl
# mv fbconfig.pl /usr/local/bin/fbconfigePSXe should now be able to find it.

Nope...still dont work...:'(
Much thanx anyways!! ;)El-Trucha
http://www.masterleito.ath.cx
ftp://tsfc.homeftp.net
hotline://tsfc.ath.cx

![]() |
How do I compile things i...
|
Mail speaker
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |