LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   multiple 2.6 kernels using GRUB (https://www.linuxquestions.org/questions/linux-newbie-8/multiple-2-6-kernels-using-grub-285647/)

DeltaXFX 02-03-2005 01:36 AM

multiple 2.6 kernels using GRUB
 
Im looking for a specific answer to this question, Ive googled and check LQ for the past 3 days and cant find a good explanation.
I have the tutorial on how to recompile a kernel. I seem to be able to do that. I copy my bzImage and the other files that are listed in the tutorial to the /boot directory. Then I delete the System.map link to the old System.map-2.6.3 file. Then I use "ln -s System.map-2.6.10 System.map" Which makes a link from System.map to System.map-2.6.10. GRUB looks like it is autoconfigured when I do all the "make" things.
My question is I want to be able to boot either 2.6.3 OR 2.6.10 both are listed when I boot. I screwed up the 2.6.10 kernel a bunch of time trying to compile it and make it actually work... still new at this.
It seems that because I am changing where the System.map link points to it must change how my old kernel would boot. Which my 2.6.3 kernel wont boot now. I just get "GRUB" after POST. So I am just going to reload Fedora.
But can someone just tell me what files are used by an individual kernel to boot? Its needs vmlinuz, initrd, system.map...
On one of my boot attempts on the 2.6.10 kernel I got an error where X wouldnt start. It kicked out a bunch of error messages and put me at level 3. I could log in just fine, I tried startx but just received errors. Is there some other file I need to point the kernel to? like the XF86Config file??

Thanks for any information you can give me!

TigerOC 02-03-2005 02:33 AM

You don't need to soft link anything for system map. The individual files should be in /boot along with their respective vmlinuz and initrd files. You need to go and edit /boot/grub/menu.lst and then write the grub to the mbr. Here is the sample of mine;

title Debian GNU/Linux, kernel 2.4.20-k7
root (hd2,0)
kernel /boot/vmlinuz-2.4.20-k7 root=/dev/hdd1 ro hdb=ide-scsi apm=on
initrd /boot/initrd.img-2.4.20-k7
savedefault

title Debian GNU/Linux, kernel 2.4.20-k7 (recovery mode)
root (hd2,0)
kernel /boot/vmlinuz-2.4.20-k7 root=/dev/hdd1 ro single
initrd /boot/initrd.img-2.4.20-k7
savedefault

title Debian Testing GNU/Linux, kernel 2.6.3-1-k7
root (hd2,2)
kernel /boot/vmlinuz-2.6.3-1-k7 root=/dev/hdd3 ro
initrd /boot/initrd.img-2.6.3-1-k7
savedefault
boot

title Debian TestingGNU/Linux, kernel 2.6.3-1-k7 (recovery mode)
root (hd2,2)
kernel /boot/vmlinuz-2.6.3-1-k7 root=/dev/hdd3 ro single
initrd /boot/initrd.img-2.6.3-1-k7
savedefault
boot

title Zoneminder v 1.19
root (hd1,0)
kernel /boot/vmlinuz-2.6.3-4mdk root=/dev/hdc1 ro
initrd /boot/initrd-2.6.3-4mdk.img
savedefault
boot

title Zoneminder v 1.19 (recovery mode)
root (hd1,0)
kernel /boot/vmlinuz-2.6.3-4mdk root=/dev/hdc1 ro single
initrd /boot/initrd-2.6.3-4mdk.img
savedefault
boot

wrt to the failure to boot in XF86 you may have a problem with one of the peripherals (mouse, screen or whatever). To find out what is causing the problem look at the log file - do cat /var/log/XFree86.0.log | more . I don't have experience with fedora but there should be an app to reconfigure X or if there isn't one then you would have to manually edit /etc/X11/XF86Config-4.

DeltaXFX 02-03-2005 03:03 AM

Ahhhhh, something that makes sense! Thank you.
So do I ever need to update the system.map file? Or can I just leave it there and continue to update kernels as they come out?
Just for the sake of learning can you see if i got this right... its copied out of what you posted.

root (hd2,0) <-thats the ID of the physical drive?

kernel /boot/vmlinuz-2.4.20-k7 root=/dev/hdd1 ro single <-root is what is mounted to /dev/hdd1

initrd /boot/initrd.img-2.4.20-k7 <- i get this

savedefault <-whats this for?

thanks again! i need to go home and try this now :)

TigerOC 02-03-2005 03:38 AM

Quote:

Originally posted by DeltaXFX
So do I ever need to update the system.map file? Or can I just leave it there and continue to update kernels as they come out?
Just for the sake of learning can you see if i got this right... its copied out of what you posted.

root (hd2,0) <-thats the ID of the physical drive?

kernel /boot/vmlinuz-2.4.20-k7 root=/dev/hdd1 ro single <-root is what is mounted to /dev/hdd1

initrd /boot/initrd.img-2.4.20-k7 <- i get this

savedefault <-whats this for?


I have never fiddled with the maps. Debian automatically updates the /boot file whilst installing the new kernel.

root (hd2,0) - yes this is the physical ID - grub starts numbering the drives and partitions from 0 so this is drive 3 and partition 1

The only reason I can see to replacing the system map is when you only have a single entry and you are replacing one kernel with another. In most instances you don't want to do this because if the new kernel doesn't work you have no way of getting back except via a rescue disk.

savedefault - quote from the grub config file
" You can specify 'saved' instead of a number. In this case, the default entry
is the entry saved with the command 'savedefault'.
default 0"

never really questioned this so not sure of the ramifications of this.

johnnydangerous 02-03-2005 03:50 AM

I have it
 
I have a solution for you use some software depending on your distro to autoupdate your kernel, my only interaction was to delete the old one after reboot :)

abisko00 02-03-2005 04:31 AM

According to you system.map question, I found some information in my favourite kernel HowTo (Sorry, it's in german, so I post a brief translation):

Quote:

System.map contains names and adresses of kernel symbols (don't ask me what that means, but now comes the important information). It is not of vital importance for a running Linux system. However it is used when it comes to kernel-oops for debugging purposes. Also the command 'ps -l' makes use of it. If it comes to such a case, the System.map is choosen in the following order:

/boot/System.map-`uname -r`
/boot/System.map
/lib/modules/`uname -r`/System.map
/usr/src/linux/System.map
That means, it is totally sufficient to have an unlinked System.map, as long as it contains the correct version number of the running kernel as returned by 'uname -r'. If your link points to the wrong System.map, you won't recognize it, as long as the version information is present.

DeltaXFX 02-03-2005 04:55 AM

Quote:

Originally posted by abisko00
That means, it is totally sufficient to have an unlinked System.map, as long as it contains the correct version number of the running kernel as returned by 'uname -r'. If your link points to the wrong System.map, you won't recognize it, as long as the version information is present.
So I could just copy my vmlinuz/bzImage and initrid to /boot, update GRUB and then load my new kernel, and once i verify that it is working properly i could just replace the System.map link with the System.map-2.6.10 file? (just rename it to System.map)

abisko00 02-03-2005 06:10 AM

No, this is not what I meant (although it will probably work also).

What I wanted to say is: have a (correct) system.map for each kernel, named by the kernel version (e.g. System.map-2.6.10) and delete the link (since it is not dynamic and may point to the wrong system.map).

This would be the 'correct' way to do it, but you won't recognize it, if you do it the 'wrong' way.


All times are GMT -5. The time now is 07:45 AM.