Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Loading mixed compression initrds fails
2019-08-26, 07:19
Post: #1
Loading mixed compression initrds fails
I think that ipxe doesn't properly align the initrds into 4-byte boundaries or something, as if one tries to load two initrds of different compressions, it fails and the kernel reports "decompression error", while it works with grub.

For example, the Ubuntu initrd.img is actually two concatenated initrds: [early cpio microcode + main gzip initrd.img]
If I create an additional one of my own with:
Code:
# date > date.txt
# echo date.txt | cpio -oH newc | lzma > extra.img

And I specify in boot.ipxe:
Code:
initrd initrd.img
initrd extra.img

Then the problem is reproduced; while the same initrds are loaded fine with grub.

On the other hand using same compressions works, maybe because it doesn't have the alignment issue? I.e. [(cpio+gzip)+gzip] or [cpio+(cpio+gzip)] or [(cpio+lz4)+lz4] work.
Find all posts by this user
Quote this message in a reply
2019-08-26, 08:50
Post: #2
RE: Loading mixed compression initrds fails
(2019-08-26 07:19)alkisg Wrote:  I think that ipxe doesn't properly align the initrds into 4-byte boundaries or something, as if one tries to load two initrds of different compressions, it fails and the kernel reports "decompression error", while it works with grub.

My guess for this is that ... grub does decompression of initrd files - while iPXE does not.
iPXE expects the kernel to deal with the decompression - so if you have a kernel that supports some, but not other decompression methods you would get this result.

Use GitHub Discussions
VRAM bin
Visit this user's website Find all posts by this user
Quote this message in a reply
2019-08-26, 08:58
Post: #3
RE: Loading mixed compression initrds fails
Thank you NiKiZe for your input.

The kernel in question properly supports all the tested formats. The problem only appears when mixing them.
E.g. gzip + gzip works, lz4 + lz4 works, but gzip + lz4 fails.

If it's not a problem in iPXE, then it would be a bug or feature request for the kernel initrd decompression code. I will try to find a solution there.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 2 Guest(s)