LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Booting Generic Kernel (https://www.linuxquestions.org/questions/slackware-14/booting-generic-kernel-888874/)

vttay03 06-28-2011 08:37 PM

Booting Generic Kernel
 
So I'm aware this is a pretty popular topic so please don't bite too hard :)

I use Grub as my boot manager and as you can see below, there are two entries for Slackware:

Code:

menuentry "Slackware Linux (Slackware 13.37.0) (on /dev/sdc1)" {
        insmod part_msdos
        insmod ext2
        set root='(hd2,msdos1)'
        search --no-floppy --fs-uuid --set 949bee22-eca8-4a80-9975-2aa43ad851e9
        linux /boot/vmlinuz-generic-2.6.37.6 root=/dev/sdc1
}
menuentry "Slackware Linux (Slackware 13.37.0) (on /dev/sdc1)" {
        insmod part_msdos
        insmod ext2
        set root='(hd2,msdos1)'
        search --no-floppy --fs-uuid --set 949bee22-eca8-4a80-9975-2aa43ad851e9
        linux /boot/vmlinuz-huge-2.6.37.6 root=/dev/sdc1
}

I have no issues booting the huge kernel. However, I'd like to boot the generic kernel. I started searching online and came across some things I thought would take care of it. I then read the "README.initrd" file on the SlackDVD and thought it'd be a simple process. So I did the following...

From within "usr/share/mkinitrd" I ran "mkinitrd_command_generator.sh". The output is listed below:

Code:

mkinitrd -c -k 2.6.37.6 -f ext4 -r /dev/sdc1 -m usb-storage:ehci-hcd:usbhid:xhci-hcd:jbd2:mbcache:ext4 -u -o /boot/initrd.gz
Afterwards I did a "cd /boot" and ran that command. However, every time I boot I get the following message:

Quote:

Kernel panic - not syncing: VFS: unable to mount root fs on unknown block
Any ideas? Like I said, I'm able to boot the huge kernel just fine...and yes, /dev/sdc1 is my root filesystem.

vttay03 06-28-2011 08:46 PM

I forgot to add the output when I run the "mkinitrd" command, it's posted below (appears to go alright):

Code:

sudo mkinitrd -c -k 2.6.37.6 -f ext4 -r /dev/sdc1 -m usb-storage:ehci-hcd:usbhid:xhci-hcd:jbd2:mbcache:ext4 -u -o /boot/initrd.gz                                                                 
Password:                                                                     
OK: /lib/modules/2.6.37.6/kernel/drivers/usb/storage/usb-storage.ko added.     
OK: /lib/modules/2.6.37.6/kernel/drivers/usb/host/ehci-hcd.ko added.           
OK: /lib/modules/2.6.37.6/kernel/drivers/hid/hid.ko added.                     
OK: /lib/modules/2.6.37.6/kernel/drivers/hid/usbhid/usbhid.ko added.           
OK: /lib/modules/2.6.37.6/kernel/drivers/usb/host/xhci-hcd.ko added.           
OK: /lib/modules/2.6.37.6/kernel/fs/jbd2/jbd2.ko added.                       
OK: /lib/modules/2.6.37.6/kernel/fs/mbcache.ko added.                         
OK: /lib/modules/2.6.37.6/kernel/fs/jbd2/jbd2.ko added.                       
OK: /lib/modules/2.6.37.6/kernel/fs/mbcache.ko added.                         
OK: /lib/modules/2.6.37.6/kernel/fs/ext4/ext4.ko added.                       
15644 blocks                                                                   
/boot/initrd.gz created.                                                       
Be sure to run lilo again if you use it.


Diantre 06-28-2011 08:53 PM

[deleted]

mRgOBLIN 06-28-2011 08:57 PM

And do you need to tell grub where to find the initrd.gz?

andrewthomas 06-28-2011 08:58 PM

Quote:

Originally Posted by vttay03 (Post 4398587)
So I'm aware this is a pretty popular topic so please don't bite too hard :)

I use Grub as my boot manager and as you can see below, there are two entries for Slackware:

Code:

menuentry "Slackware Linux (Slackware 13.37.0) (on /dev/sdc1)" {
        insmod part_msdos
        insmod ext2
        set root='(hd2,msdos1)'
        search --no-floppy --fs-uuid --set 949bee22-eca8-4a80-9975-2aa43ad851e9
        linux /boot/vmlinuz-generic-2.6.37.6 root=/dev/sdc1
}
menuentry "Slackware Linux (Slackware 13.37.0) (on /dev/sdc1)" {
        insmod part_msdos
        insmod ext2
        set root='(hd2,msdos1)'
        search --no-floppy --fs-uuid --set 949bee22-eca8-4a80-9975-2aa43ad851e9
        linux /boot/vmlinuz-huge-2.6.37.6 root=/dev/sdc1
}


You didn't add the initrd to your menuentry.

Code:

menuentry "Slackware Linux (Slackware 13.37.0) (on /dev/sdc1)" {
        insmod part_msdos
        insmod ext2
        set root='(hd2,msdos1)'
        search --no-floppy --fs-uuid --set 949bee22-eca8-4a80-9975-2aa43ad851e9
        linux /boot/vmlinuz-generic-2.6.37.6 root=/dev/sdc1
        initrd /boot/initrd.gz
}


vttay03 06-28-2011 09:23 PM

But since the "huge" kernel works and that menu entry appears identical to the "generic" one, this shouldn't be an issue should it? I ran 'update-grub' afterwards to update the "grub.cfg" file. I'm using GRUB2 so it's full of that automated crap and doesn't like you to edit the "grub.cfg" file directly.

andrewthomas 06-28-2011 09:45 PM

The huge kernel does not need an initrd, the generic one does.

By the way, why did you go out of your way to install grub2, when grub is on the install disc?

vttay03 06-29-2011 06:03 AM

Quote:

Originally Posted by andrewthomas (Post 4398622)
The huge kernel does not need an initrd, the generic one does.

By the way, why did you go out of your way to install grub2, when grub is on the install disc?

Got ya...

I've got grub2 on another hard drive that I've been using to boot whatever OS I need. I didn't install any bootloader for Slackware figuring I'd just use grub2 to boot it (since Slackware is on my third hard drive). However, I'm really sort of fed up with the fact grub2 wants you to run the "update-grub" script in order to generate the *.cfg file. I'm glad you told me that grub was on the install disk. I'm going to plan on either installing it or lilo later tonight in order to test out what you've said above. I know there's a file for custom entries on grub2 but then you just end up with whatever "update-grub" discovered plus what you've entered...what can I say, I don't like clutter :)

andrewthomas 06-29-2011 08:03 AM

If you have grub2 on a different drive on the same machine, then you really don't need to install any bootloader.

What I do is to make a menu.lst file in /boot/grub with entries that are symlinks.

Then, when I update a kernel, I just update the symlinks myself and no update-grub is necessary to be able to boot.

You can even have an entry for vmlinuz-old and initrd-old.gz to be able to boot your previous kernel.

Here is what I use for my /boot/grub/menu.lst

Code:

title S64 3.0-git-latest
root (hd0,13)
kernel /boot/vmlinuz-git root=/dev/sda14 ro

title S64 3.0-git-previous
root (hd0,13)
kernel /boot/vmlinuz-git-old root=/dev/sda14 ro

title S64-huge latest
root (hd0,13)
kernel /boot/vmlinuz root=/dev/sda14 ro

Just make sure to add your initrd line to the generic entry

vttay03 06-29-2011 08:43 AM

Quote:

Originally Posted by andrewthomas (Post 4399074)
If you have grub2 on a different drive on the same machine, then you really don't need to install any bootloader.

What I do is to make a menu.lst file in /boot/grub with entries that are symlinks.

Then, when I update a kernel, I just update the symlinks myself and no update-grub is necessary to be able to boot.

You can even have an entry for vmlinuz-old and initrd-old.gz to be able to boot your previous kernel.

Here is what I use for my /boot/grub/menu.lst

Code:

title S64 3.0-git-latest
root (hd0,13)
kernel /boot/vmlinuz-git root=/dev/sda14 ro

title S64 3.0-git-previous
root (hd0,13)
kernel /boot/vmlinuz-git-old root=/dev/sda14 ro

title S64-huge latest
root (hd0,13)
kernel /boot/vmlinuz root=/dev/sda14 ro

Just make sure to add your initrd line to the generic entry

Understood, that way you don't need to update your menu.lst file, only the symlinks. I've tracked down why Grub2 won't detect the "initrd.gz" file. It wants it to be named something like "initrd.img" instead. I also realized I can turn off the "os_prober" feature of Grub2 so it'll stop telling me what my menu entries should be. That way, I can just maintain my own file, similar to what you've stated above. I'll wait to claim victory until I can give it a try later tonight...

vttay03 06-29-2011 07:52 PM

Everything works! Thanks for your help...I ended up adding a "40_custom" file to Grub2 with the additional line "initrd /boot/initrd.gz" as you indicated above.

andrewthomas 06-29-2011 08:28 PM

You're welcome.

Glad to be of help.


All times are GMT -5. The time now is 08:22 PM.