NiKiZe / Gentoo-iPXE

Sample to support iPXE boot of Gentoo Minimal livecd
https://gentoo.ipxe.se/
MIT License
19 stars 4 forks source link

Update needed for new dracut (distkernel) based minimal install cds #11

Open DarkDefender opened 1 month ago

DarkDefender commented 1 month ago

Hello! Recently the gentoo minimal install cd switched from genkernel to using dracut. This means that the current iPXE kernel parameters does not work.

I figured out what to change to make it work with the new dracut init scripts. The kernel commands needs to be changed to this:

# The "rootok=1" parameter is to force dracut to search for the squashfs image in the initial tmpfs root directory
kernel gentoo root=live:/image.squashfs rootok=1 cdroot rd.live.ram=1 ${keymap} ${cmdline}

After this is should work with the latest minimal gentoo isos.

We should probably also update the instructions here: https://wiki.gentoo.org/wiki/Installation_alternatives#Diskless_install_using_PXE_from_the_LiveCD

NiKiZe commented 1 month ago

Thanks for the report.

Actually, I think this should be reported as a bug to the maintainers, having the squashfs on disk should "just work", I have not looked at the initscripts or any details here, but I guess it just skips checks for existence? While that works, it could hide nice to have error messages.

DarkDefender commented 1 month ago

Here is the code in question: https://github.com/dracutdevs/dracut/blob/master/modules.d/90dmsquash-live/parse-dmsquash-live.sh

Looking at it now, I see that they actually do support booting this way without any extra hacks. It is just that the squash image file name has to end with ".img".

If we rename the image.squashfs to squashfs.img and update the kernel command line to: kernel gentoo root=live:/squashfs.img cdroot rd.live.ram=1 ${keymap} ${cmdline}

It works :) Thanks for prodding a bit more so we actually got a proper solution to this.

NiKiZe commented 1 month ago

Thanks!

So either Gentoo should rename the file (which would require several updates in several places) Or maybe dracut could be updated to allow for the .squashfs extension as is?

DarkDefender commented 1 month ago

Those seems to be the options to avoid extra work from end users, yes. Don't know which one of them would be the easiest to get merged as I haven't worked with the gentoo release team or the dracut team before.