Handle loopback booting with dracut-live properly

dracut uses the `iso-scan/filename` kernel parameter for loopback
booting with tools like Super Grub Disk, whereas live-boot uses the
`findiso` parameter for this purpose. Conditionally set which one is
used depending on the selected initramfs.
This commit is contained in:
Aaron Rainbolt 2024-10-31 00:05:45 -05:00
parent 399393565c
commit 7349ab156f
No known key found for this signature in database
GPG Key ID: A709160D73C79109
1 changed files with 14 additions and 1 deletions

View File

@ -121,9 +121,22 @@ DEFAULT_INITRD="initrd.img-$(echo ${DEFAULT_KERNEL} | sed -e 's|vmlinuz-||')"
KERNEL_LIVE="/${INITFS}/${DEFAULT_KERNEL}"
INITRD_LIVE="/${INITFS}/${DEFAULT_INITRD}"
APPEND_LIVE="${LB_BOOTAPPEND_LIVE} findiso=\${iso_path}"
FLAVOUR_LIVE="${DEFAULT_FLAVOUR}"
# live-boot and dracut use different kernel parameters for loopback
# booting
case "${LB_INITRAMFS}" in
live-boot)
APPEND_LIVE="${LB_BOOTAPPEND_LIVE} findiso=\${iso_path}"
;;
dracut-live)
APPEND_LIVE="${LB_BOOTAPPEND_LIVE} iso-scan/filename=\${iso_path}"
;;
none)
APPEND_LIVE="${LB_BOOTAPPEND_LIVE}"
;;
esac
# Ensure fresh live entries
LIVE_ENTRIES_TMP="${_TARGET}/live.cfg.tmp"
rm -f "${LIVE_ENTRIES_TMP}"