dracut
dracut copied to clipboard
fw_cfg support for qemu module
Enhance the qemu dracut module so that it can extend the command line that was passed in when Linux kernel started.
This can happen either using the fw_cfg or smbios qemu arguments.
-
-fw_cfg name=opt/io.dracut.cmdline-extra,string=ro
-
-smbios type=11,value=io.dracut.cmdline-extra:ro
See https://www.qemu.org/docs/master/specs/fw_cfg.html and https://www.qemu.org/docs/master/system/invocation.html#hxtool-4
systemd has similar feature for credential management - https://github.com/systemd/systemd/blob/main/docs/CREDENTIALS.md?plain=1#L53
When qemu is used with UKI (and not Direct Linux Boot), -append command line option is not available to control kernel command line arguments.
To read the value from within the guest passed in via qemu
cat /sys/firmware/qemu_fw_cfg/by_name/opt/io.dracut.cmdline-extra/raw