提交 2e591bbc 编写于 作者: A Arjan van de Ven 提交者: Linus Torvalds

[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: NArjan van de Ven <arjan@linux.intel.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 f6337e2a
...@@ -182,6 +182,10 @@ static int __init do_collect(void) ...@@ -182,6 +182,10 @@ static int __init do_collect(void)
static int __init do_header(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)) { if (memcmp(collected, "070701", 6)) {
error("no cpio magic"); error("no cpio magic");
return 1; return 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册