Uploaded initramfs-tools 0.150ubuntu5 for resolute and 0.150ubuntu3.1 to
questing (waiting for the SRU team to accept it).

** Description changed:

+ [ Impact ]
+ 
+ Users with 3cpio and pigz installed using gzip as compression will run
+ into this bug (gzip will be used as fallback when zstd is not
+ available).
+ 
+ [ Test Plan ]
+ 
+ 1. Install 3cpio,initramfs-tools,linux-image-generic,pigz
+ 2. Call: mkinitramfs -c gzip -o initrd 6.17.0-5-generic
+ 
+ It will fail with:
+ 
+ ```
+ 3cpio: Error: Failed to create 'cpio on stdout': line 1597: Unknown 
compression format: pigz
+ E: mkinitramfs failure 3cpio 1
+ ```
+ 
+ 3. Upgrade the initramfs-tools script
+ 4. Run step 2 again. It should succeed.
+ 
+ [ Where problems could occur ]
+ 
+ The fix touches the code in mkinitramfs that is only used for 3cpio.
+ This update could break building initrds which would most likely surface
+ when users install new kernels or this initramfs-tools update.
+ 
+ initramfs-tools comes with autopkgtest to lower the regression risk.
+ 
+ [ Other Info ]
+ 
+ This bug has been fixed differently for resolute. The fix for questing
+ was kept as small as possible.
+ 
+ [ Original report ]
+ 
  So I have a fairly uncommon use case, so I'm assuming that is why this
  hasn't been reported..
  
  As background I am running into this problem in the midst of upgrading
  from noble to questing. (I'm not sure if something in the upgrade path
  was supposed to catch this incompatibility, but -- if so -- it did not.)
  That shouldn't be necessary to reproduce this bug, however.
  
  I have both 3cpio and pigz installed, and `COMPRESS=gzip` set in
  `/etc/initramfs-tools/initramfs.conf`.
  
  It seems that any attempt to build an initramfs image in such
  circumstances will result in the following error:
  
  ===
  update-initramfs: Generating /boot/initrd.img-6.14.0-34-generic
  3cpio: Error: Failed to create 'cpio on stdout': line 2387: Unknown 
compression format: pigz
  E: mkinitramfs failure 3cpio 1
  update-initramfs: failed for /boot/initrd.img-6.14.0-34-generic with 1.
  ===
  
- A quick visual inspection of the man page for 3cpio and the contents of the 
/usr/sbin/mkinitramfs script explain why: 
+ A quick visual inspection of the man page for 3cpio and the contents of the 
/usr/sbin/mkinitramfs script explain why:
  a) the man page for 3cpio doesn't list 'pigz' as a valid compression format
  b) mkinitramfs uses pigz as the value for the compression format if it is 
initially set to gzip and the pigz binary is found in PATH
  c) mkinitramfs uses 3cpio in lieu of cpio if the 3cpio binary is found in PATH
  d) mkinitramfs performs no check for when (b) and (c) are both true
  
  The obvious temporary workaround would be to either change the initramfs
  compression format, or else uninstall one of the packages (assuming no
  dependency issues preclude the latter).
  
  As for versions installed, I have the latest:
  
  ===
  root@vastdesk:~# dpkg -l 3cpio initramfs-tools-core pigz
  ii  3cpio                0.10.2-0ubuntu1 amd64        Manage initrd cpio 
archives
  ii  initramfs-tools-core 0.150ubuntu3    all          generic modular 
initramfs generator (core tools)
  ii  pigz                 2.8-1           amd64        Parallel Implementation 
of GZip
  
  root@vastdesk:~# lsb_release -rd
  No LSB modules are available.
  Description:    Ubuntu 25.10
  Release:        25.10
  ===

** Description changed:

  [ Impact ]
  
  Users with 3cpio and pigz installed using gzip as compression will run
  into this bug (gzip will be used as fallback when zstd is not
  available).
  
  [ Test Plan ]
  
  1. Install 3cpio,initramfs-tools,linux-image-generic,pigz
  2. Call: mkinitramfs -c gzip -o initrd 6.17.0-5-generic
  
  It will fail with:
  
  ```
  3cpio: Error: Failed to create 'cpio on stdout': line 1597: Unknown 
compression format: pigz
  E: mkinitramfs failure 3cpio 1
  ```
  
- 3. Upgrade the initramfs-tools script
+ 3. Upgrade the initramfs-tools-core package
  4. Run step 2 again. It should succeed.
  
  [ Where problems could occur ]
  
  The fix touches the code in mkinitramfs that is only used for 3cpio.
  This update could break building initrds which would most likely surface
  when users install new kernels or this initramfs-tools update.
  
  initramfs-tools comes with autopkgtest to lower the regression risk.
  
  [ Other Info ]
  
  This bug has been fixed differently for resolute. The fix for questing
  was kept as small as possible.
  
  [ Original report ]
  
  So I have a fairly uncommon use case, so I'm assuming that is why this
  hasn't been reported..
  
  As background I am running into this problem in the midst of upgrading
  from noble to questing. (I'm not sure if something in the upgrade path
  was supposed to catch this incompatibility, but -- if so -- it did not.)
  That shouldn't be necessary to reproduce this bug, however.
  
  I have both 3cpio and pigz installed, and `COMPRESS=gzip` set in
  `/etc/initramfs-tools/initramfs.conf`.
  
  It seems that any attempt to build an initramfs image in such
  circumstances will result in the following error:
  
  ===
  update-initramfs: Generating /boot/initrd.img-6.14.0-34-generic
  3cpio: Error: Failed to create 'cpio on stdout': line 2387: Unknown 
compression format: pigz
  E: mkinitramfs failure 3cpio 1
  update-initramfs: failed for /boot/initrd.img-6.14.0-34-generic with 1.
  ===
  
  A quick visual inspection of the man page for 3cpio and the contents of the 
/usr/sbin/mkinitramfs script explain why:
  a) the man page for 3cpio doesn't list 'pigz' as a valid compression format
  b) mkinitramfs uses pigz as the value for the compression format if it is 
initially set to gzip and the pigz binary is found in PATH
  c) mkinitramfs uses 3cpio in lieu of cpio if the 3cpio binary is found in PATH
  d) mkinitramfs performs no check for when (b) and (c) are both true
  
  The obvious temporary workaround would be to either change the initramfs
  compression format, or else uninstall one of the packages (assuming no
  dependency issues preclude the latter).
  
  As for versions installed, I have the latest:
  
  ===
  root@vastdesk:~# dpkg -l 3cpio initramfs-tools-core pigz
  ii  3cpio                0.10.2-0ubuntu1 amd64        Manage initrd cpio 
archives
  ii  initramfs-tools-core 0.150ubuntu3    all          generic modular 
initramfs generator (core tools)
  ii  pigz                 2.8-1           amd64        Parallel Implementation 
of GZip
  
  root@vastdesk:~# lsb_release -rd
  No LSB modules are available.
  Description:    Ubuntu 25.10
  Release:        25.10
  ===

** Changed in: initramfs-tools (Ubuntu Questing)
   Importance: Undecided => High

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2130550

Title:
  mkinitramfs incorrectly attempts to use incompatible compression
  format pigz with 3cpio

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/2130550/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to