** Description changed:

- Concatenating multiple initrds works fine with gzipped initrds.
- (microcode+gzip+gzip) => the kernel properly decompresses that
+ Updated description:
  
- With lz4, it can't decompress anything after the first lz4:
- (microcode+lz4+whatever) => it doesn't decompress whatever.
+ The kernel supports loading multiple initrds, like: [cpio microcode,
+ gzip initrd.img].
+ 
+ Appending yet another initrd after that only works for selected
+ compressions, not all of them. I'm not sure if this is a bug or a
+ feature request.
+ 
+ So for example, this works: [cpio microcode, xz initrd.img, gzip extra.img]
+ And this doesn't: [cpio microcode, lz4 initrd.img, gzip extra.img]
  
  To reproduce:
  Get vmlinuz and initrd.img from an eoan daily build and put them in a 
directory.
- Create an lz4 (or gzip or uncompressed cpio, it doesn't matter):
+ Create a compressed extra.img:
  # date > date.txt
- # echo date.txt | cpio -oH newc | lz4 > date.img
+ # echo date.txt | cpio -oH newc | gzip > extra.img
  Concatenate them:
- # cat initrd.img.original date.img > initrd.img
+ # cat initrd.img.original extra.img > initrd.img
  Boot them:
  # kvm -m 512 -kernel vmlinuz -initrd initrd.img -append rdinit=/bin/sh
  
  Then inside kvm:
  # ls /date.txt
  
- The additional file doesn't exist.
+ The date.txt file doesn't exist when initrd.img is lz4, while it appears
+ if it's xz.
  
  `dmesg | grep -i initramfs` reports:
  Trying to unpack rootfs image as initramfs...
  Initramfs unpacking failed: Decoding failed

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1840945

Title:
  Mixed compression initrds partially work

Status in linux package in Ubuntu:
  Confirmed

Bug description:
  Updated description:

  The kernel supports loading multiple initrds, like: [cpio microcode,
  gzip initrd.img].

  Appending yet another initrd after that only works for selected
  compressions, not all of them. I'm not sure if this is a bug or a
  feature request.

  So for example, this works: [cpio microcode, xz initrd.img, gzip extra.img]
  And this doesn't: [cpio microcode, lz4 initrd.img, gzip extra.img]

  To reproduce:
  Get vmlinuz and initrd.img from an eoan daily build and put them in a 
directory.
  Create a compressed extra.img:
  # date > date.txt
  # echo date.txt | cpio -oH newc | gzip > extra.img
  Concatenate them:
  # cat initrd.img.original extra.img > initrd.img
  Boot them:
  # kvm -m 512 -kernel vmlinuz -initrd initrd.img -append rdinit=/bin/sh

  Then inside kvm:
  # ls /date.txt

  The date.txt file doesn't exist when initrd.img is lz4, while it
  appears if it's xz.

  `dmesg | grep -i initramfs` reports:
  Trying to unpack rootfs image as initramfs...
  Initramfs unpacking failed: Decoding failed

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1840945/+subscriptions

-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to