Skip to content

initrd/bin/unpack_initramfs.sh: add xz unpacking support.#1860

Merged
tlaurion merged 2 commits intolinuxboot:masterfrom
tlaurion:fix_initrd_unpack_for_repacking
Nov 22, 2024
Merged

initrd/bin/unpack_initramfs.sh: add xz unpacking support.#1860
tlaurion merged 2 commits intolinuxboot:masterfrom
tlaurion:fix_initrd_unpack_for_repacking

Conversation

@tlaurion
Copy link
Copy Markdown
Collaborator

@tlaurion tlaurion commented Nov 22, 2024

Closes #1644 : was preventing to setup TPM DUK key because initrd couldn't be unpacked and repacked on the fly to be passed at kexec call to contain unsealed DUK key for final OS to pick up and use to unlock LUKS on boot.

  • reformat with tabs and unify

95c6eb5:

  • adds xz unpacking that was missing and needed for debian derivatives.
  • other format added in comments so easy to test when testing candidates will be reported in the wild

Ubuntu 24.10 switched from lz4 to zstd which was already supported, so does not add lz4 but still closes #1644 :)


xz unpacking

Before:
signal-2024-11-22-160535

After this PR:
signal-2024-11-22-173850

Which permitted to extract exfat.ko size, which was needed for #1810:
signal-2024-11-22-174226

…h tabs

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…: bzip2, lzma, lzo and lz4)

xz: tested working with tails test build and 6.8.1's initrd
latest ubuntu 24.10: switched back to zstd, works as expected (tested)

Magic numbers referred at:
- https://github.com/torvalds/linux/blob/28eb75e178d389d325f1666e422bc13bbbb9804c/scripts/extract-vmlinux#L52C1-L58C43
- https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/lib/decompress.c#n51

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setting a TPM DUK on Ubuntu 24.04 fails at unpacking initramfs

1 participant