Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.kernel > #90090 > unrolled thread

Bug#1032610: reliably composable initramfs - zero-pad output to allow concatenation

Started byBen Hutchings <ben@decadent.org.uk>
First post2025-11-17 00:30 +0100
Last post2025-11-17 14:20 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.debian.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Bug#1032610: reliably composable initramfs - zero-pad output to allow concatenation Ben Hutchings <ben@decadent.org.uk> - 2025-11-17 00:30 +0100
    Bug#1032610: reliably composable initramfs - zero-pad output to allow concatenation Birgit Edel <edelbitter@posteo.de> - 2025-11-17 14:20 +0100

#90090 — Bug#1032610: reliably composable initramfs - zero-pad output to allow concatenation

FromBen Hutchings <ben@decadent.org.uk>
Date2025-11-17 00:30 +0100
SubjectBug#1032610: reliably composable initramfs - zero-pad output to allow concatenation
Message-ID<LRUlX-dvbI-11@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

Control: tag -1 - patch

On Fri, 10 Mar 2023 01:54:47 +0000 Birgit Edel <edelbitter@posteo.de> wrote:
> Package: initramfs-tools-core
> Version: 0.140
> Severity: wishlist
> File: /usr/sbin/mkinitramfs
> Tags: patch
> 
> mkinitramfs supports compression that neither encodes size, nor is 
> guaranteed to signal the end of compressed archive. Linux refuses to 
> parse additional archives beyond the first compressed one - unless they 
> start at 4-byte boundary like uncompressed ones do.
> 
> I request
> A) to modify mkninitramfs to append such padding and
> B) to add tests to ensure concatenation keeps working (even after, say, 
> compression algo/lvl changes)
[...]

Currently unmkinitramfs is not able to unpack an initramfs image that
has multiple compressed parts.  Since you want mkinitramfs to support
this option, I would expect to see a patch that also makes unmkinitramfs
support it.

(There is an open merge request to make unmkinitramfs use 3cpio where
available:
<https://salsa.debian.org/kernel-team/initramfs-tools/-/merge_requests/172>.
I haven't tested whether 3cpio supports multiple compressed parts; if it
does then only the tests need to be updated to cover this case.)

Ben.

-- 
Ben Hutchings
Beware of programmers who carry screwdrivers. - Leonard Brandwein

[toc] | [next] | [standalone]


#90102

FromBirgit Edel <edelbitter@posteo.de>
Date2025-11-17 14:20 +0100
Message-ID<LS7jc-dDNX-25@gated-at.bofh.it>
In reply to#90090
> you want mkinitramfs to support multiple compressed parts

I would caution against that and rather only add the quick and easy bit:

1) Fixing the regression and adding autopkgtest is adds little code yet
solves the hassle for any *manual* workflow that once worked.

2) Actually parsing such archives is way more complicated - and for 
what? Unless
unmkinitramfs was aiming for perfect bug-compatibility with kernel code 
it would
always harbor potential for dangerously misleading output.

> whether 3cpio supports multiple compressed parts

No. Looks like it shuts down even if current decompression stopped short 
of EOF:
https://github.com/bdrung/3cpio/blob/2ffd9dc9ce46f5d885fb066eef73b127889918e2/src/examine.rs#L85
https://github.com/bdrung/3cpio/blob/2ffd9dc9ce46f5d885fb066eef73b127889918e2/src/extract.rs#L181
(Still good, insofar it means my suggested unconditional padding does 
not make it crash.)

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.kernel


csiph-web