dracut icon indicating copy to clipboard operation
dracut copied to clipboard

feat(dracut-initramfs-restore.sh): get compression method from image

Open aafeijoo-suse opened this issue 1 year ago • 3 comments

Instead of trying every possible compression method until the right one is found, parse the header of the initramfs image to get the right one and use it without hiding possible decompression errors, using the same logic that is implemented in lsinitrd.sh.

For that, refactor lsinitrd.sh moving common code to dracut-functions.sh. In particular:

  • get_machine_id
  • get_default_initramfs_image [<kernel_version>]
  • has_early_microcode <initramfs_image>
  • get_decompression_command <initramfs_image_header>

Also, added a new get_dollar_boot function to get the $BOOT partition placeholder, as defined in the Boot Loader Specification. If bootctl is available, use it to support a possible XBOOTLDR partition, otherwise, check only the ESP, as before.

Also refactored dracut.sh using these new functions to get the outfile path.

Checklist

  • [X] I have tested it locally
  • [ ] I have reviewed and updated any documentation if relevant
  • [ ] I am providing new code and test(s) for it

aafeijoo-suse avatar Dec 20 '23 16:12 aafeijoo-suse

@tblume JFYI, this is what we discussed internally this week.

aafeijoo-suse avatar Dec 21 '23 08:12 aafeijoo-suse

This issue is being marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. If this is still an issue in the latest release of Dracut and you would like to keep it open please comment on this issue within the next 7 days. Thank you for your contributions.

stale[bot] avatar Mar 13 '24 06:03 stale[bot]

This issue is being marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. If this is still an issue in the latest release of Dracut and you would like to keep it open please comment on this issue within the next 7 days. Thank you for your contributions.

stale[bot] avatar Apr 22 '24 06:04 stale[bot]