diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2006-12-06 23:37:19 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-07 11:39:36 -0500 |
commit | 2e591bbc0d563e12f5a260fbbca0df7d5810910e (patch) | |
tree | c113397d49285808aaa750cf76e0961649f9f4f7 /init | |
parent | f6337e2af42f9ea9ce296cfa18966dcf4f045f7d (diff) |
[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 <arjan@linux.intel.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'init')
-rw-r--r-- | init/initramfs.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/init/initramfs.c b/init/initramfs.c index d28c1094d7e5..85f04037ade1 100644 --- a/init/initramfs.c +++ b/init/initramfs.c | |||
@@ -182,6 +182,10 @@ static int __init do_collect(void) | |||
182 | 182 | ||
183 | static int __init do_header(void) | 183 | static int __init do_header(void) |
184 | { | 184 | { |
185 | if (memcmp(collected, "070707", 6)==0) { | ||
186 | error("incorrect cpio method used: use -H newc option"); | ||
187 | return 1; | ||
188 | } | ||
185 | if (memcmp(collected, "070701", 6)) { | 189 | if (memcmp(collected, "070701", 6)) { |
186 | error("no cpio magic"); | 190 | error("no cpio magic"); |
187 | return 1; | 191 | return 1; |