iPXE discussion forum
Loading mixed compression initrds fails - Printable Version

+- iPXE discussion forum (https://forum.ipxe.org)
+-- Forum: iPXE user forums (/forumdisplay.php?fid=1)
+--- Forum: General (/forumdisplay.php?fid=2)
+--- Thread: Loading mixed compression initrds fails (/showthread.php?tid=19287)



Loading mixed compression initrds fails - alkisg - 2019-08-26 07:19

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.


RE: Loading mixed compression initrds fails - NiKiZe - 2019-08-26 08:50

(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.


RE: Loading mixed compression initrds fails - alkisg - 2019-08-26 08:58

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.