Error message for invalid initramfs cpio format?

From: Ville Herva
Date: Tue Jan 24 2006 - 02:24:31 EST


On Mon, Jan 23, 2006 at 09:02:16PM -0500, you [Phillip Susi] wrote:
> Ville Herva wrote:
> >PS: Speaking of debugging failing initrd init scripts; it would be nice if
> >the kernel gave an error message on wrong initrd format rather than
> >silently
> >failing... Yes, I forgot to make the cpio with the "-H newc" option :-/.
> >
>
> LOL, yea, that one got me too when I was first getting back into linux a
> few months ago and had to customize my initramfs to include dmraid to
> recognize my hardware fakeraid raid0. Then I discovered the mkinitramfs
> utility which makes things much nicer ;)

Sure does, that's what I first used, too. But then I had to hack with the
init script and it seemed quicker to

gzip -d < /boot/initrd-2.6.15.1.img | cpio --extract --verbose --make-directories --no-absolute-filenames
vi init
...
find . | cpio -H newc --create --verbose | gzip -9 > /boot/initrd-2.6.15.1.img

It seems do_header() in init/initramfs.c checks for the "070701" magic (that
is specific to the newc format [1]), and populate_rootfs() should then
panic() with "no cpio magic" error message, but I'm fairly sure I didn't see
an error about wrong initramfs format when booting with an initrd made with
cpio without the -H newc option.

This is what I see:

RAMDISK: Couldn't find valid RAM disk starting at 0.
VFS: Cannot open root device "LABEL=/" or unknown-block(0,0)
Please append correct "root=" boot option
Kernel panic - not syncing: VFS: Unable to mount root fs on
unknown-block(0,0)

seems the "no cpio magic" message is somehow lost. It would be useful.


-- v --

v@xxxxxx



[1] "The new (SVR4) portable format, which supports file systems having more
than 65536 i-nodes."
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/