* [patch] Make initramfs printk a warning on incorrect cpio type
@ 2006-11-04 22:25 Arjan van de Ven
0 siblings, 0 replies; only message in thread
From: Arjan van de Ven @ 2006-11-04 22:25 UTC (permalink / raw)
To: linux-kernel; +Cc: viro, akpm
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 <arjan@linux.intel.com>
--- linux-2.6.18/init/initramfs.c.old 2006-11-04 23:18:30.000000000 +0100
+++ linux-2.6.18/init/initramfs.c 2006-11-04 23:19:19.000000000 +0100
@@ -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;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-11-04 22:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-04 22:25 [patch] Make initramfs printk a warning on incorrect cpio type Arjan van de Ven
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®