linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
To: Victor Kamensky <kamensky@cisco.com>
Cc: Rob Landley <rob@landley.net>, Arnd Bergmann <arnd@arndb.de>,
	Taras Kondratiuk <takondra@cisco.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Mimi Zohar <zohar@linux.vnet.ibm.com>,
	Jonathan Corbet <corbet@lwn.net>,
	James McMechan <james.w.mcmechan@gmail.com>,
	initramfs@vger.kernel.org, linux-doc@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	LSM List <linux-security-module@vger.kernel.org>,
	xe-linux-external@cisco.com
Subject: Re: [PATCH v2 01/15] Documentation: add newcx initramfs format description
Date: Fri, 26 Jan 2018 16:15:13 -0200	[thread overview]
Message-ID: <20180126181512.hnotac2lpxkj4ruv@khazad-dum.debian.net> (raw)
In-Reply-To: <alpine.LRH.2.00.1801260739120.8259@sjc-ads-6991.cisco.com>


On Fri, 26 Jan 2018, Victor Kamensky wrote:
> On Fri, 26 Jan 2018, Henrique de Moraes Holschuh wrote:
> > On Thu, 25 Jan 2018, Rob Landley wrote:
> > > That said, I don't think -h newcx should emit (or recognize) the
> > > "TRAILER!!!1!" entry. That's kinda silly in-band signaling for 2018:
> > > files have a length, pipes provide EOF, and each cpiox entry starts with
> > > 6 bytes of c_magic anyway.
> 
> My understanding that TRAILER is really used on tape devices,
> there is no notion of file end in this case, it is just a stream of bytes
> from char device.

TRAILER is really used anywhere you can have several cpio archives
concatenated, which is the exact case of a Linux initramfs, not just
tape.

The initramfs format takes *one or more* cpio archives, concatenated.
Each archive may be independently compressed (using whatever supported
compression method), or uncompressed[1].  EOF or size information can
only tell you where the entire concatenated archive ends, not where each
"segment" (independent cpio archive that was concatenated into the
whole) ends.

TRAILER is the only decent way to know the concatenation points.
Knowing where these points are is necessary for the kernel, due to the
way hardlink encoding is done on cpio archives: one has to reset the
state of the hardlink-tracking table between cpio archives that were
concatenated, for safety (and sysadmin sanity) reasons.

[1] for the special case when one includes an "early initramfs" section
for firmware (microcode, etc) updates, the archive(s) containing the
firmware data must be uncompressed, and these archives must come before
compressed archives in the concatenation.

-- 
  Henrique Holschuh

  reply	other threads:[~2018-01-26 18:15 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-25  3:27 [PATCH v2 00/15] extend initramfs archive format to support xattrs Taras Kondratiuk
2018-01-25  3:27 ` [PATCH v2 01/15] Documentation: add newcx initramfs format description Taras Kondratiuk
2018-01-25  9:29   ` Arnd Bergmann
2018-01-25 20:26     ` Taras Kondratiuk
2018-01-25 21:02       ` Arnd Bergmann
2018-01-25 22:13         ` Taras Kondratiuk
2018-01-26  2:39     ` Rob Landley
2018-01-26  9:04       ` Arnd Bergmann
2018-01-26 10:31       ` Henrique de Moraes Holschuh
2018-01-26 15:51         ` Victor Kamensky
2018-01-26 18:15           ` Henrique de Moraes Holschuh [this message]
2018-01-26  2:40   ` Rob Landley
2018-01-26 21:02     ` Taras Kondratiuk
2018-01-25  3:27 ` [PATCH v2 02/15] initramfs: replace states with function pointers Taras Kondratiuk
2018-01-25  3:27 ` [PATCH v2 03/15] initramfs: store file name in name_buf Taras Kondratiuk
2018-01-25  3:27 ` [PATCH v2 04/15] initramfs: remove unnecessary symlinks processing shortcut Taras Kondratiuk
2018-01-25  3:27 ` [PATCH v2 05/15] initramfs: move files creation into separate state Taras Kondratiuk
2018-01-25  3:27 ` [PATCH v2 06/15] initramfs: separate reading cpio method from header Taras Kondratiuk
2018-01-25  3:27 ` [PATCH v2 07/15] initramfs: split header layout information from parsing function Taras Kondratiuk
2018-01-25  3:27 ` [PATCH v2 08/15] initramfs: add newcx format Taras Kondratiuk
2018-01-25  3:27 ` [PATCH v2 09/15] initramfs: set extended attributes Taras Kondratiuk
2018-01-25  3:27 ` [PATCH v2 10/15] gen_init_cpio: move header formatting into function Taras Kondratiuk
2018-01-25  3:27 ` [PATCH v2 11/15] gen_init_cpio: add newcx format Taras Kondratiuk
2018-01-26  2:40   ` Rob Landley
2018-01-26 20:37     ` Taras Kondratiuk
2018-01-25  3:27 ` [PATCH v2 12/15] gen_init_cpio: set extended attributes for " Taras Kondratiuk
2018-01-25  3:27 ` [PATCH v2 13/15] gen_initramfs_list.sh: add -x option to enable " Taras Kondratiuk
2018-01-25  3:27 ` [PATCH v2 14/15] selinux: allow setxattr on rootfs so initramfs code can set them Taras Kondratiuk
2018-01-25  3:27 ` [PATCH v2 15/15] selinux: delay sid population for rootfs till init is complete Taras Kondratiuk

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=20180126181512.hnotac2lpxkj4ruv@khazad-dum.debian.net \
    --to=hmh@hmh.eng.br \
    --cc=arnd@arndb.de \
    --cc=corbet@lwn.net \
    --cc=hpa@zytor.com \
    --cc=initramfs@vger.kernel.org \
    --cc=james.w.mcmechan@gmail.com \
    --cc=kamensky@cisco.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=rob@landley.net \
    --cc=takondra@cisco.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=xe-linux-external@cisco.com \
    --cc=zohar@linux.vnet.ibm.com \
    /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).