From: Arjan van de Ven Date: Thu, 7 Dec 2006 04:37:19 +0000 (-0800) Subject: [PATCH] Make initramfs printk a warning on incorrect cpio type X-Git-Tag: v2.6.20-rc1~145^2^2~168 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=2e591bbc0d563e12f5a260fbbca0df7d5810910e;p=linux-2.6-omap-h63xx.git [PATCH] Make initramfs printk a warning on incorrect cpio type It turns out that the "-c" option of cpio is highly unportable even between distros let alone unix variants, and may actually make the wrong type of cpio archive. I just wasted quite some time on this, and the kernel can detect this and warn about it (it's __init memory so it gets thrown away and thus there is no runtime overhead) Signed-off-by: Arjan van de Ven Cc: Al Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/init/initramfs.c b/init/initramfs.c index d28c1094d7e..85f04037ade 100644 --- a/init/initramfs.c +++ b/init/initramfs.c @@ -182,6 +182,10 @@ static int __init do_collect(void) static int __init do_header(void) { + if (memcmp(collected, "070707", 6)==0) { + error("incorrect cpio method used: use -H newc option"); + return 1; + } if (memcmp(collected, "070701", 6)) { error("no cpio magic"); return 1;