Weblog entry #8 for ronin42

building new kernel with 2.6.23
Posted by ronin42 on Tue 6 Nov 2007 at 07:35
Tags: none.
I attempted to build a new kernel moving from 2.6.18-5-686 to 2.6.23.
Everything runs fine until I boot and then I get
Volume group "System" not found
Volume group "System" not found
Begin: Waiting for root file system

After some searching I find this is a common occurrence but there doesn't seem to be a common fix for it. I read that YAIRD is a new tool for building initr.img files. That did make some head way but still failed and threw me a kernel panic.
After gathering all the parts I used the following method to compile

make menuconfig
fakeroot make-kpkg clean
fakeroot make-kpkg --append-to-version "-suffix" --revision "valid number" --us --uc --initrd \ kernel_image kernel_headers
cd ..
dpkg -i linux-image-#.#.#suffix_revision_~.deb
dpkg -i linux-headers-#.#.#suffix_revision_~deb

Has the above method changed substituting --yaird for --initrd?

 

Comments on this Entry

Posted by Utumno (218.160.xx.xx) on Tue 6 Nov 2007 at 17:21
[ Send Message | View Utumno's Scratchpad | View Weblogs ]
Why do you need an initrd? compile the essential modules into your kernel and spare yourself this trouble.

[ Parent | Reply to this comment ]

Posted by ronin42 (116.0.xx.xx) on Tue 6 Nov 2007 at 23:35
[ Send Message | View ronin42's Scratchpad | View Weblogs ]
The initrd step to create this .img file is not needed?
I can drop that option from the fakeroot make-kpkg ~ function and just use the kernel_image and kernel_headers option?
I'll give that a try and do some looking on the non initrd useage.

ej

[ Parent | Reply to this comment ]

Posted by Anonymous (85.22.xx.xx) on Fri 9 Nov 2007 at 16:07
This is not true when the root filesystem resides on a LVM volume (which seems to be the case here). Besides some kernel modules (which can be compiled statically into the kernel, of course), LVM requires some userspace tools to operate. These must be contained in the initrd.
That's the reason why I prefer using a conventional partition for the root filesystem. It is possible to have it on LVM (the stock debian kernel packages deal with it gracefully), but it can give you headaches when you compile your own kernel and you have to explore the guts of creating an initrd.

[ Parent | Reply to this comment ]

Posted by ronin42 (116.0.xx.xx) on Tue 13 Nov 2007 at 11:29
[ Send Message | View ronin42's Scratchpad | View Weblogs ]
Hmm looks like it's back to the drawing board.
I'm sure there is a way around this without re-building from scratch.
I'll probably have to drop LVM and then create it again.
ej

[ Parent | Reply to this comment ]

Posted by Anonymous (60.248.xx.xx) on Wed 7 Nov 2007 at 07:40
Here's how I compile my kernels:
1) download and unpack the kernel tree
2) make gconfig ( or menuconfig or whatever )
3) make-kpkg --revision=number kernel_image

That results in a standard .deb package being produced, which you can then install like any other Debian package with 'dpkg -i linux-image-2.6.23.*****.deb'. Done.

Now, about the 'initrd': it is a ramdisk which contains drivers necessary to boot the kernel, i.e. drivers for your motherboard chipset, ATA or SATA drivers ( whichever you're using ) , drivers for the filesystem and codepage used in your root partition ( and only this partition! If for example you're using ext3 on / and jfs on /home, you only need to compile ext3 support into the kernel )

Thus, if in step 2) you compile those drivers into your kernel, you dont need initrd at all. ( note that you still can use loadable modules for anything which is not needed until the kernel mounts your root partition, i.e for network cards, sound cards, graphics cards and 90% of other stuff )

Now, the reason why distributions like Debian decide to ship their kernels with an initrd is because they dont want to compile every possible filesystem, codepage, motherboard chipset, ATA, SATA, MTD and whatnot drivers into their kernels. They dont know your hardware, you however do.

Read http://en.wikipedia.org/wiki/Initrd

[ Parent | Reply to this comment ]

Posted by Utumno (60.248.xx.xx) on Wed 7 Nov 2007 at 07:48
[ Send Message | View Utumno's Scratchpad | View Weblogs ]
That was me, of course :) One more thing: you dont need to execute the 'kernel_headers' target. Just 'kernel_image' and put a link to your source tree to /usr/src/linux:
ln -s wherever-is-your-kernel-tree /usr/src/linux
One more thing: in your initial post you seem to be using the '--append-to-version' parameter to make-kpkg. I've got one slight problem with mixing this parameter with out-of-tree modules like the nVidia driver. If you're using any out-of-tree modules, I'd discourage you from using it. Better stick to '--revision' only.

[ Parent | Reply to this comment ]

Posted by Anonymous (116.0.xx.xx) on Mon 12 Nov 2007 at 12:00
hi, I finally got a chance to use your method and I got it to work; however, on reboot I get:
VFS: Can not open root device "mapper/system-root" of unknown-block (0,0)
Please append a correct "root=" boot option; here are the available partitions;
Kernel panic-not syncing: VFS: unable to mount root file system on unkown block (0,0).

This has happened before. I'm running LVM2 with the boot partition on ext3 /dev/sda1 and LVM2 on /dev/sda2. Here is a shot of the /etc/fstab files.

musashi:~# more /etc/fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/mapper/System-root / ext3 defaults,errors=remount-ro 0 1
/dev/sda1 /boot ext3 defaults 0 2
/dev/mapper/System-home /home ext3 defaults 0 2
/dev/mapper/System-opt /opt ext3 defaults 0 2
/dev/mapper/System-var /tmp ext3 defaults 0 2
/dev/mapper/System-usr /usr ext3 defaults 0 2
/dev/mapper/System-tmp /var ext3 defaults 0 2
/dev/mapper/System-swap none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto 0 0

I built this from the www.goobye-microsoft.com debian install. I have done this with other systems rather than from an ISO and it work welled before.

Did a change occur with LVM


ej

[ Parent | Reply to this comment ]

Posted by Utumno (211.72.xx.xx) on Mon 12 Nov 2007 at 17:31
[ Send Message | View Utumno's Scratchpad | View Weblogs ]

Hmm, that's some LVM weirdness. I am afraid I dont have a clue about LVM.

Anonymous (85.22.xx.xx) above claims LVM needs some userspace and thus actually needs an initrd...

[ Parent | Reply to this comment ]

Posted by ronin42 (116.0.xx.xx) on Wed 7 Nov 2007 at 12:00
[ Send Message | View ronin42's Scratchpad | View Weblogs ]
Ah enlightenment, I always followed the "rules" to compile.
I'm sure I have EXT3 and LVM2 compiled as I'm using both.
LVM for all but boot and EXT3 for boot.
Thank you for the information
ej

[ Parent | Reply to this comment ]

User Login

Username:

Password:

[ Advanced Login ]

Register Account

Quick Site Search