From: Arjan van de Ven <arjan@linux.intel.com>
To: linux-kernel@vger.kernel.org
Cc: viro@zeniv.linux.org.uk, akpm@osdl.org
Subject: [patch] Make initramfs printk a warning on incorrect cpio type
Date: Sat, 04 Nov 2006 23:25:15 +0100 [thread overview]
Message-ID: <1162679115.3160.64.camel@laptopd505.fenrus.org> (raw)
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;
reply other threads:[~2006-11-04 22:25 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1162679115.3160.64.camel@laptopd505.fenrus.org \
--to=arjan@linux.intel.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®