Improve handling for the dracut root=live parameter
GBA-17 opened this issue · comments
Is your feature request related to a problem? Please describe.
Distros that use dracut require 2 parameters to boot from an ISO file:
- iso-scan/filename=PATH_TO_ISO
- root=live:CDLABEL=ISO_LABEL
Fedora is an example where these parameters are easy to provide. We are able to parse the syslinux config file, which provides the following line. When we append the iso-scan/filename
parameter, we have everything we need to boot.
root=live:CDLABEL=Fedora-WS-Live-32-1-6 rd.live.image quiet
This becomes trickier with something like openSUSE. Our config file parser can't handle the grub config file they provide, so one way around that is to provide the configuration ourselves in a bootiso.Config
object. However, that would involve hardcoding the ISO_LABEL, which might vary between the KDE and Gnome versions for example.
Describe the solution you'd like
Find a way to locate the ISO_LABEL so we can append it to the kernel parameters in the same way as PATH_TO_ISO. This might involve mounting the ISO to grab the label.
Describe alternatives you've considered
The following supportedDistros
entry will boot into the openSUSE KDE Live ISO. However, we should avoid hardcoding the root=live parameter.
"OpenSUSE": Distro{
url: "http://download.opensuse.org/distribution/leap/15.2/live/openSUSE-Leap-15.2-KDE-Live-x86_64-Media.iso",
isoPattern: "^openSUSE-.+",
kernelParams: "iso-scan/filename={{.IsoPath}}",
customConfigs: []bootiso.Config{
bootiso.Config{
Label: "Default Config",
KernelPath: "/boot/x86_64/loader/linux",
InitrdPath: "/boot/x86_64/loader/initrd",
Cmdline: "splash=silent quiet root=live:CDLABEL=openSUSE_Leap_15.2_KDE_Live rd.live.image rd.live.overlay.persistent rd.live.overlay.cowfs=ext4",
},
},
}
Additional context
More info on dracut's parameters