LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-11-2003, 07:47 PM   #1
savix
LQ Newbie
 
Registered: Jul 2003
Distribution: Red Hat 8
Posts: 9

Rep: Reputation: 0
recompiled kernel, configuring grub


I seem to have succesfully recomplied my kernel, everything that should be in /boot is there... the only thing I don't know how to do now is boot with the new kernel. Can someone help me out with that please? I'm using Red Hat 8.0. In case anyone's curious, I was following the instructions of leo laporte at the techtv site. Since this is my first post, I can't post a URL, so just go to the screensavers website and do a search for "linux kernel" and it's the second one on the list.
 
Old 07-11-2003, 08:25 PM   #2
asc3ndant
LQ Newbie
 
Registered: Mar 2003
Posts: 28

Rep: Reputation: 15
if you compiled the kernel with "make bzImage", you need to copy the kernel image to /boot, and change the boot parameter in grub.conf.

bzImage is located in /usr/src/linux/arch/i386/boot
assuming /usr/src/linux is the kernel source directory, and your architecture is i386.

here is my grub.conf for your reference:

# /boot/grub/grub.conf

title linux
root (hd0)
kernel (hd0,0)/bzImage root=/dev/hda3 nousb
 
Old 07-11-2003, 09:01 PM   #3
savix
LQ Newbie
 
Registered: Jul 2003
Distribution: Red Hat 8
Posts: 9

Original Poster
Rep: Reputation: 0
Don't really understand...

Nah, I don't understand what you mean. I ran the command "make bzImage"... I've already copied the kernel image to boot, but I don't know how to edit the grub.conf file so it boots the new kernel instead of the old.
 
Old 07-11-2003, 10:32 PM   #4
savix
LQ Newbie
 
Registered: Jul 2003
Distribution: Red Hat 8
Posts: 9

Original Poster
Rep: Reputation: 0
One part is obvious...

Well actually, two parts are obvious. First I should change my title to my new kernel version (duh). Second, I should change the line "kernel /vmlinuz-<kernelversion>" to the new image I want to boot to.

This concerns me though, I would think I'd also have to change the line that start with "initrd /initrd-<kernelversion>"... however, there's no other file to match my kernel version. There is initrd-2.4.18-14, but I need one that is initrd-2.4.21. Did I forget to do something?
 
Old 07-11-2003, 10:55 PM   #5
asc3ndant
LQ Newbie
 
Registered: Mar 2003
Posts: 28

Rep: Reputation: 15
initrd is only for loading scsi modules... the original kernel is compiled with scsi modules thus an initrd image is compiled and included in boot...

it is very easy to boot the new kernel. ignore everything in /boot, including vmlinux-x.x.x, vmlinuz, initrd.x.x.x etc... all you care about is bzImage, that is the new kernel you compiled. now you can certainly re-name it vmlinuz-2.4.21 or whatever the kernel version is, but that's not necessary. ok, so bzImage is in /boot, and you need to tell grub to load this kernel...
so assuming that grub is installed on the master boot record of hd0, make this your grub.conf file, and the new kernel will boot:

# grub.conf
# i am assuming that (hd0,0) which is hda1 is your /boot partition
# and that your / partition is /dev/hda3, and the master boot
# record is installed on hda, which is (hd0)

title linux, kernel version 2.4.21
root (hd0)
kernel (hd0,0)/bzImage root=/dev/hda3


note: if you are using a scsi module, you need to configure initrd, if you don't have scsi at all and are still using a scsi module consider re-compiling your kernel to exclude it...

i'll be watching this thread if you need more help...
 
Old 07-11-2003, 11:58 PM   #6
martinman
Member
 
Registered: Apr 2003
Distribution: Gentoo 1.4
Posts: 290

Rep: Reputation: 30
im having a very similiar problem, check out this link, plz: Clicky!
 
Old 07-12-2003, 12:46 PM   #7
savix
LQ Newbie
 
Registered: Jul 2003
Distribution: Red Hat 8
Posts: 9

Original Poster
Rep: Reputation: 0
My error message

Here's my error message that I got when I tried to boot my kernel after changing editing grub.conf

ds: no socket drivers loaded!
VFS: Cannot open root device "LABEL=/" or 00:00
Please append a correct "root=" boot option
Kernel panic: VFS: Unable to mount root fs on 00:00
 
Old 07-12-2003, 04:40 PM   #8
asc3ndant
LQ Newbie
 
Registered: Mar 2003
Posts: 28

Rep: Reputation: 15
can you post your grub.conf file here?
and also /etc/fstab
and what does your partition table look like?
 
Old 07-12-2003, 05:46 PM   #9
savix
LQ Newbie
 
Registered: Jul 2003
Distribution: Red Hat 8
Posts: 9

Original Poster
Rep: Reputation: 0
/etc/fstab

LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/hda5 swap swap defaults 0 0
/dev/cdrom /mnt/cdrom iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0
/dev/hda1 /mnt/stuff msdos defaults 0 0
/dev/hdb1 /mnt/giant ntfs ro,umask=0222
/dev/cdrom1 /mnt/cdrom1 iso9660 noauto,owner,kudzu,ro 0 0


/boot/grub/grub.conf (original grub file)
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,1)
# kernel /vmlinuz-version ro root=/dev/hda3
# initrd /initrd-version.img
#boot=/dev/hda
default=1
timeout=5
splashimage=(hd0,1)/grub/splash.xpm.gz
title Red Hat Linux (2.4.18-14)
root (hd0,1)
kernel /vmlinuz-2.4.18-14 ro root=LABEL=/ hdd=ide-scsi
initrd /initrd-2.4.18-14.img
title DOS
rootnoverify (hd0,0)
chainloader +1


What do you mean by partition table? are you asking what partitions are on my hdd's?
/dev/hda
hda1 - FAT32
hda2 - ext3
hda3 - ext3
hda4 - extended
hda5 - swap
/dev/hdb
hdb1 - ntfs
 
Old 07-12-2003, 07:09 PM   #10
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
I am confused and I may be wrong.
You compiled kernel 2.4.21, but your GRUB conf says 2.4.18-14

Also, you use root=LABEL=/
Instead, try root=/dev/hda3
kernel /vmlinuz-2.4.18-14 ro root=/dev/hda3 hdd=ide-scsi
 
Old 07-12-2003, 08:49 PM   #11
savix
LQ Newbie
 
Registered: Jul 2003
Distribution: Red Hat 8
Posts: 9

Original Poster
Rep: Reputation: 0
that was the original





eventually, I did get the kernel to boot... kinda...


i've got a lot of failures though. I don't really know what I did wrong when i was compiling... it should have worked fine. I don't understand.



By the way, is there any way to pause the linux bootup so I can see what fails?
 
Old 07-12-2003, 09:04 PM   #12
asc3ndant
LQ Newbie
 
Registered: Mar 2003
Posts: 28

Rep: Reputation: 15
people tend to get alot of errors the first time a freshly compiled kernel is reboot.

what did you change to get it to boot?

oh and to view errors use:
dmesg | less
or just view the file: /var/log/dmesg which is the boot log...
and you might want to check on /etc/modules.conf which tends to generate alot of errors...
if all else fails try re-compiling the kernel and pay special attention to all the drivers you include as well as the modules you include, and make sure to save your kernel compile config file, which is: /usr/src/linux-2.4.21/.config

cheers
 
Old 07-12-2003, 10:53 PM   #13
martinman
Member
 
Registered: Apr 2003
Distribution: Gentoo 1.4
Posts: 290

Rep: Reputation: 30
savix, if you looked at my thread i've had the EXACT same problem.

Turns out i had a misconfiguration. It has nothing to do with the grub.conf

copy a standard config
from /usr/src/linux-2.4/configs to /usr/src/linux-2.4/ and then rename it to ".config"

THEN do make xconfig, make dep, make clean, make bzImage, make modules, make modules_install, and make install.

About the last option. Make install automatically makes the initrd, copies the vmlinuz over, and writes the boot script to grub.conf

Last edited by martinman; 07-12-2003 at 10:55 PM.
 
Old 07-13-2003, 08:53 AM   #14
savix
LQ Newbie
 
Registered: Jul 2003
Distribution: Red Hat 8
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by asc3ndant
people tend to get alot of errors the first time a freshly compiled kernel is reboot.

what did you change to get it to boot?

I got an idea after I saw another grub.conf, I'm not sure if it was from a message board or from a tutorial i was looking at... but anyway, I added another choice in the grub.conf file. I added the lines:

title Red Hat Linux (2.4.21)
root (hd0,1)
kernel /kernel-2.4.21 ro root=/dev/hda3 hdd=ide
initrd /initrd-2.4.21.img
Yes, I also made an initrd image, just because I wasn't sure if i had made any modules that needed to be loaded for the kernel to be initialized (i just wanted to be on the safe side).

Anyway, I did get it to boot, and thanks asc3ndant for posting the dmesg | less command, that was quite interesting, but it's not quite what I wanted. I was looking for just about everything *after* the dmesg log. I wanted to see what services the kernel tried to start, which passed, and which failed.

I suppose I'll try recompiling my kernel for the 3rd time or so...

wish me luck all


P.S. If anyone would like to talk to me directly, my AIM is "Buffered Asprin"

Last edited by savix; 07-13-2003 at 08:54 AM.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
recompiled kernel 2.6.3-13 what does this mean? rbonafied Mandriva 8 06-07-2004 12:00 PM
recompiled kernel not in use taoweijia Linux - Newbie 1 01-09-2004 08:33 AM
recompiled kernel and no vmlinuz.old or kernel module for Nvidia Bruce Hill Slackware 13 12-11-2003 01:36 AM
Recompiled 2.4.22 kernel 3MB! bulldozer Linux - Newbie 6 12-08-2003 10:45 AM
Recompiled my kernel, don't know if modules are there... TheOneAndOnlySM Linux - Newbie 3 08-11-2003 12:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:19 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration