From: David Disseldorp <ddiss@suse.de>
To: linux-fsdevel@vger.kernel.org, linux-doc@vger.kernel.org
Cc: viro@zeniv.linux.org.uk, willy@infradead.org,
David Disseldorp <ddiss@suse.de>
Subject: [PATCH v2 3/5] docs: remove mention of "crc" cpio format support
Date: Wed, 22 Sep 2021 13:52:20 +0200 [thread overview]
Message-ID: <20210922115222.8987-3-ddiss@suse.de> (raw)
In-Reply-To: <20210922115222.8987-1-ddiss@suse.de>
init/initramfs.c only supports extraction of cpio archives carrying the
"newc" header magic ("070701"). Remove statements indicating support for
the "crc" cpio format.
Signed-off-by: David Disseldorp <ddiss@suse.de>
---
.../early-userspace/buffer-format.rst | 24 +++++++------------
1 file changed, 8 insertions(+), 16 deletions(-)
Version 2:
- reword initramfs padding description, as suggested by Matthew Wilcox
diff --git a/Documentation/driver-api/early-userspace/buffer-format.rst b/Documentation/driver-api/early-userspace/buffer-format.rst
index 7f74e301fdf3..0df76bca444c 100644
--- a/Documentation/driver-api/early-userspace/buffer-format.rst
+++ b/Documentation/driver-api/early-userspace/buffer-format.rst
@@ -14,10 +14,10 @@ is different. The initramfs buffer contains an archive which is
expanded into a ramfs filesystem; this document details the format of
the initramfs buffer format.
-The initramfs buffer format is based around the "newc" or "crc" CPIO
-formats, and can be created with the cpio(1) utility. The cpio
-archive can be compressed using gzip(1). One valid version of an
-initramfs buffer is thus a single .cpio.gz file.
+The initramfs buffer format is based around the "newc" CPIO format, and
+can be created with the cpio(1) utility. The cpio archive can be
+compressed using gzip(1). One valid version of an initramfs buffer is
+thus a single .cpio.gz file.
The full format of the initramfs buffer is defined by the following
grammar, where::
@@ -40,9 +40,8 @@ grammar, where::
In human terms, the initramfs buffer contains a collection of
-compressed and/or uncompressed cpio archives (in the "newc" or "crc"
-formats); arbitrary amounts zero bytes (for padding) can be added
-between members.
+compressed and/or uncompressed cpio archives (in the "newc" format),
+with arbitrary amount of zero-byte padding between members.
The cpio "TRAILER!!!" entry (cpio end-of-archive) is optional, but is
not ignored; see "handling of hard links" below.
@@ -55,7 +54,7 @@ by the ASCII string "000012ac"):
============= ================== ==============================================
Field name Field size Meaning
============= ================== ==============================================
-c_magic 6 bytes The string "070701" or "070702"
+c_magic 6 bytes The string "070701"
c_ino 8 bytes File inode number
c_mode 8 bytes File mode and permissions
c_uid 8 bytes File uid
@@ -68,8 +67,7 @@ c_min 8 bytes Minor part of file device number
c_rmaj 8 bytes Major part of device node reference
c_rmin 8 bytes Minor part of device node reference
c_namesize 8 bytes Length of filename, including final \0
-c_chksum 8 bytes Checksum of data field if c_magic is 070702;
- otherwise zero
+c_chksum 8 bytes Ignored; reserved for unsupported "crc" format
============= ================== ==============================================
The c_mode field matches the contents of st_mode returned by stat(2)
@@ -78,12 +76,6 @@ on Linux, and encodes the file type and file permissions.
The c_filesize should be zero for any file which is not a regular file
or symlink.
-The c_chksum field contains a simple 32-bit unsigned sum of all the
-bytes in the data field. cpio(1) refers to this as "crc", which is
-clearly incorrect (a cyclic redundancy check is a different and
-significantly stronger integrity check), however, this is the
-algorithm used.
-
If the filename is "TRAILER!!!" this is actually an end-of-archive
marker; the c_filesize for an end-of-archive marker must be zero.
--
2.31.1
next prev parent reply other threads:[~2021-09-22 11:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-22 11:52 [PATCH 1/5] initramfs: move unnecessary memcmp from hot path David Disseldorp
2021-09-22 11:52 ` [PATCH 2/5] initramfs: print helpful cpio error on "crc" magic David Disseldorp
2021-09-22 11:52 ` David Disseldorp [this message]
2021-09-22 11:52 ` [PATCH 4/5] initramfs: use do_utime() wrapper consistently David Disseldorp
2021-09-22 11:52 ` [PATCH 5/5] initramfs: add INITRAMFS_PRESERVE_MTIME Kconfig option David Disseldorp
2021-09-22 23:28 ` [PATCH 1/5] initramfs: move unnecessary memcmp from hot path Chaitanya Kulkarni
2021-09-23 7:43 ` David Disseldorp
2021-09-22 23:35 ` Al Viro
2021-09-22 23:51 ` Chaitanya Kulkarni
2021-09-23 7:33 ` David Disseldorp
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=20210922115222.8987-3-ddiss@suse.de \
--to=ddiss@suse.de \
--cc=linux-doc@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).