Debian Bug report logs - #807457
Add command to unpack initramfs

version graph

Package: initramfs-tools; Maintainer for initramfs-tools is Debian kernel team <debian-kernel@lists.debian.org>; Source for initramfs-tools is src:initramfs-tools (PTS, buildd, popcon).

Reported by: Osamu Aoki <osamu@debian.org>

Date: Fri, 26 Jun 2015 23:57:01 UTC

Severity: wishlist

Tags: patch

Merged with 839890

Found in versions initramfs-tools/0.120, initramfs-tools/0.125

Fixed in version 0.126

Done: Ben Hutchings <ben@decadent.org.uk>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, osamu@debian.org, Debian kernel team <debian-kernel@lists.debian.org>:
Bug#790095; Package initramfs-tools. (Fri, 26 Jun 2015 23:57:05 GMT) (full text, mbox, link).


Acknowledgement sent to Osamu Aoki <osamu@debian.org>:
New Bug report received and forwarded. Copy sent to osamu@debian.org, Debian kernel team <debian-kernel@lists.debian.org>. (Fri, 26 Jun 2015 23:57:05 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Osamu Aoki <osamu@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: lsinitramfs(8): multiple-segmented initramfs supported
Date: Sat, 27 Jun 2015 08:53:59 +0900
[Message part 1 (text/plain, inline)]
Package: initramfs-tools
Version: 0.120
Severity: normal
Tags: patch

From initramfs-tools 0.118 (Oct. 2014):
  * [d5f4cd6] lsinitramfs: Parse and list files that include early microcode.
    Thanks to Brett Parker and Olivier Berger. (Closes: #717805)

So the manpage description as the following is incorrect.
| BUGS
|        lsinitramfs  cannot deal with multiple-segmented initramfs images, such
|        as those created when an early  (uncompressed)  initramfs  with  system
|        firmware is prepended to the regular compressed initrams, or when over‐
|        lay data is appended to the initramfs.

So please knock off these lines.

In addition to this, I wonder why not offer utility to extract the
regular compressed initrams by using the same code with trivial changes.
It is pain to manually extract the new initrd image content.

I attach patch here one as example against the git master.

Hmmm...
 https://wiki.debian.org/InitramfsDebug
This needs to be updated.
[0001-multi-segment-initramfs-supported.patch (text/x-diff, attachment)]
[0002-getinitramfs-command.patch (text/x-diff, attachment)]
[0003-Add-getinitramfs-8.patch (text/x-diff, attachment)]
[0004-update-packaging-for-getinitramfs.patch (text/x-diff, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian kernel team <debian-kernel@lists.debian.org>:
Bug#790095; Package initramfs-tools. (Sat, 27 Jun 2015 01:06:03 GMT) (full text, mbox, link).


Acknowledgement sent to Osamu Aoki <osamu@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian kernel team <debian-kernel@lists.debian.org>. (Sat, 27 Jun 2015 01:06:03 GMT) (full text, mbox, link).


Message #10 received at 790095@bugs.debian.org (full text, mbox, reply):

From: Osamu Aoki <osamu@debian.org>
To: 790095@bugs.debian.org
Subject: Re: Bug#790095: getinitramfs code
Date: Sat, 27 Jun 2015 10:03:52 +0900
[Message part 1 (text/plain, inline)]
Hi,

Here is the getinitramfs script itself for testing just in case patch is
inconvenient for testing.

Osamu
[getinitramfs (text/plain, attachment)]

Bug 790095 cloned as bug 807457 Request was from Ben Hutchings <ben@decadent.org.uk> to control@bugs.debian.org. (Wed, 09 Dec 2015 03:15:07 GMT) (full text, mbox, link).


Changed Bug title to 'Add command to unpack initramfs' from 'lsinitramfs(8): multiple-segmented initramfs supported' Request was from Ben Hutchings <ben@decadent.org.uk> to control@bugs.debian.org. (Wed, 09 Dec 2015 03:15:07 GMT) (full text, mbox, link).


Removed tag(s) patch. Request was from Ben Hutchings <ben@decadent.org.uk> to control@bugs.debian.org. (Wed, 09 Dec 2015 03:15:08 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Debian kernel team <debian-kernel@lists.debian.org>:
Bug#807457; Package initramfs-tools. (Wed, 09 Dec 2015 03:27:07 GMT) (full text, mbox, link).


Acknowledgement sent to Ben Hutchings <ben@decadent.org.uk>:
Extra info received and forwarded to list. Copy sent to Debian kernel team <debian-kernel@lists.debian.org>. (Wed, 09 Dec 2015 03:27:07 GMT) (full text, mbox, link).


Message #21 received at 807457@bugs.debian.org (full text, mbox, reply):

From: Ben Hutchings <ben@decadent.org.uk>
To: Osamu Aoki <osamu@debian.org>
Cc: 807457@bugs.debian.org
Subject: Re: lsinitramfs(8): multiple-segmented initramfs supported
Date: Wed, 09 Dec 2015 03:23:11 +0000
[Message part 1 (text/plain, inline)]
On Sat, 27 Jun 2015 08:53:59 +0900 Osamu Aoki <osamu@debian.org> wrote:
[...]
> In addition to this, I wonder why not offer utility to extract the
> regular compressed initrams by using the same code with trivial changes.
> It is pain to manually extract the new initrd image content.
> 
> I attach patch here one as example against the git master.
[...]

Rather than duplicating code, please combine this with lsinitramfs
(checking $0 to determine which command was invoked) or move the common
code into a shell library.

Most decompression commands are named after the compressor plus 'un' so
I prefer the name 'unmkinitramfs'.

Ben.

-- 
Ben Hutchings
I'm always amazed by the number of people who take up solipsism because
they heard someone else explain it. - E*Borg on alt.fan.pratchett
[signature.asc (application/pgp-signature, inline)]

Severity set to 'wishlist' from 'normal' Request was from Ben Hutchings <ben@decadent.org.uk> to control@bugs.debian.org. (Wed, 20 Jan 2016 19:15:10 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Debian kernel team <debian-kernel@lists.debian.org>:
Bug#807457; Package initramfs-tools. (Wed, 10 Feb 2016 04:27:04 GMT) (full text, mbox, link).


Acknowledgement sent to Kevin Locke <kevin@kevinlocke.name>:
Extra info received and forwarded to list. Copy sent to Debian kernel team <debian-kernel@lists.debian.org>. (Wed, 10 Feb 2016 04:27:04 GMT) (full text, mbox, link).


Message #28 received at 807457@bugs.debian.org (full text, mbox, reply):

From: Kevin Locke <kevin@kevinlocke.name>
To: 807457@bugs.debian.org
Subject: Re: initramfs-tools: Add command to unpack initramfs
Date: Tue, 9 Feb 2016 20:18:16 -0800
[Message part 1 (text/plain, inline)]
On Wed, 2015-12-09 at 03:23 +0000, Ben Hutchings wrote:
> Rather than duplicating code, please combine this with lsinitramfs
> (checking $0 to determine which command was invoked) or move the common
> code into a shell library.

I've taken a slightly different tact and implemented uninitramfs as a
thin wrapper for cpio.  It is designed as a drop-in replacement for
cpio wherever an initramfs may be present, and passes through all
options unmodified.  With this, I changed lsinitramfs to call
uninitramfs instead of cpio.

See what you think.

Thanks,
Kevin

P.S.  I named it "uninitramfs" instead of "unmkinitramfs" since it
does not depend on mkinitramfs specifically, and it seemed to fit with
"lsinitramfs" and the "initramfs" format.  But if you would prefer
"unmkinitramfs", I can change it.

-- 
Cheers,      |  kevin@kevinlocke.name    | XMPP: kevin@kevinlocke.name
Kevin        |  https://kevinlocke.name  | IRC:   kevinoid on freenode
[0001-Create-uninitramfs-command.patch (text/x-diff, attachment)]

Added tag(s) patch. Request was from Ben Hutchings <ben@decadent.org.uk> to control@bugs.debian.org. (Wed, 10 Feb 2016 23:15:11 GMT) (full text, mbox, link).


Marked as found in versions initramfs-tools/0.125. Request was from Ben Hutchings <ben@decadent.org.uk> to control@bugs.debian.org. (Thu, 15 Dec 2016 04:45:12 GMT) (full text, mbox, link).


Merged 807457 839890 Request was from Ben Hutchings <ben@decadent.org.uk> to control@bugs.debian.org. (Thu, 15 Dec 2016 04:45:14 GMT) (full text, mbox, link).


Reply sent to Ben Hutchings <ben@decadent.org.uk>:
You have taken responsibility. (Thu, 15 Dec 2016 23:15:05 GMT) (full text, mbox, link).


Notification sent to Osamu Aoki <osamu@debian.org>:
Bug acknowledged by developer. (Thu, 15 Dec 2016 23:15:05 GMT) (full text, mbox, link).


Message #39 received at 807457-done@bugs.debian.org (full text, mbox, reply):

From: Ben Hutchings <ben@decadent.org.uk>
To: 807457-done@bugs.debian.org
Subject: Re: initramfs-tools: Add command to unpack initramfs
Date: Thu, 15 Dec 2016 23:13:03 +0000
[Message part 1 (text/plain, inline)]
Version: 0.126

On Tue, 9 Feb 2016 20:18:16 -0800 Kevin Locke <kevin@kevinlocke.name> wrote:
> On Wed, 2015-12-09 at 03:23 +0000, Ben Hutchings wrote:
> > Rather than duplicating code, please combine this with lsinitramfs
> > (checking $0 to determine which command was invoked) or move the common
> > code into a shell library.
> 
> I've taken a slightly different tact and implemented uninitramfs as a
> thin wrapper for cpio.  It is designed as a drop-in replacement for
> cpio wherever an initramfs may be present, and passes through all
> options unmodified.  With this, I changed lsinitramfs to call
> uninitramfs instead of cpio.
>
> See what you think.

I didn't like the way it passed all options through to cpio:
- It's inconsistent with the other commands
- It makes it difficult to implement any additional options
- cpio's default of unpacking into the current directory is dangerous

So I made the initramfs file and output directory arguments, and added
sensible options to cpio.  The --verbose option can be passed through,
and if there are other important ones we can add those later.

> P.S.  I named it "uninitramfs" instead of "unmkinitramfs" since it
> does not depend on mkinitramfs specifically, and it seemed to fit with
> "lsinitramfs" and the "initramfs" format.  But if you would prefer
> "unmkinitramfs", I can change it.

But it is meant to work with the initramfs images that mkinitramfs
creates and doesn't support arbitrary concatenations of maybe-
compressed cpio archives.  So, unmkinitramfs it is.

Ben.

-- 
Ben Hutchings
It is easier to change the specification to fit the program than vice
versa.

[signature.asc (application/pgp-signature, inline)]

Reply sent to Ben Hutchings <ben@decadent.org.uk>:
You have taken responsibility. (Thu, 15 Dec 2016 23:15:06 GMT) (full text, mbox, link).


Notification sent to Marc Haber <mh+debian-packages@zugschlus.de>:
Bug acknowledged by developer. (Thu, 15 Dec 2016 23:15:06 GMT) (full text, mbox, link).


Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Fri, 27 Jan 2017 10:09:42 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed Jan 10 11:26:04 2018; Machine Name: beach

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.