Misc GRUB + boot related changes#27
Conversation
To match the behavior of our default ISO boot. Closes: #25
We switched to GRUB 2 for BIOS boot instead of isolinux in grml-live recently, see grml/grml-live#459 Now we no longer provide the expected files on our ISO any longer. Booting BIOS systems via PXE using grml-terminalserver on recent Grml ISOs now fails with: PXELINUX 6.04 PXE 20250811 Copyright (c) 1994-2015 H. Peter Anvin et al Failed to load ldlinux.c32 Boot failed: press a key to retry, or wait for reset... So point both isc-dhcp-server and dnsmasq at grub/i386-pc/core.0 for BIOS/legacy clients instead of pxelinux.0. The GRUB i386-pc netboot image is generated via grub-mknetdir (from grub2-common, requires grub-pc-bin for the i386-pc modules), and shares the same grub/grub.cfg already served to EFI clients. Generation is decided whether pxelinux.0 is present in the TFTP directory, which indicates that BIOS boot support is expected, regardless of how the terminalserver system itself booted. pxelinux.0 and pxelinux.cfg/default remain in the TFTP tree for backwards compatibility with clients that request pxelinux explicitly. While at it, also drop the legacy /lib/live/mount/medium and grml-live template fallback code paths from grub-pxelinux_config, keeping only the /run/live/medium path in use since December 2018. Closes: #26
|
i think the problem here is a mismatch between what grml2usb expects and does and what the ISO provides and grml-terminalserver then copies. grml2usb always writes "multiboot" config, thus the grub config expects I think thats best fixed in grml2usb, either by adding vmlinuz, initrd copying to |
|
Indeed. But what's strange is that even with the |
|
Alright, managed to get this initially working, at least for BIOS + EFI boot when booting |
|
I'll try to further verify this together with grml/grml-live#548, but I think it's ready for an actual round of review :) |
| echo "${TFTPD_DATA_DIR_}/grub/i386-pc/core.0 exists already, nothing to do." | ||
| else | ||
| echo "Generating GRUB i386-pc netboot image for BIOS PXE boot" | ||
| grub-mknetdir --net-directory="${TFTPD_DATA_DIR_}" --subdir=grub |
There was a problem hiding this comment.
can we do this (Additionally for now i guess) also do this in grml-live and pack the relevant files into the iso? (not squashfs)
There was a problem hiding this comment.
yeah maybe, didn't look into this yet (and I guess I could use some second pair of eyes + another brain to make sure we don't add too much duplicated code and all of it still makes sense, so far I tried to get it working with what we have, also want to avoid having a too strict version dependency between Grml ISOs and grml-terminalserver)
Remove all pxelinux/syslinux installation and configuration code, now pxelinux.0, pxelinux.cfg/, boot.msg, logo.16, ISOLIN_PATH_, PXE_BOOT_MSG_, and PXE_BOOT_LOGO_ are all gone. The grub-pxelinux_config template gets renamed to grub-bios_config to reflect that GRUB now handles both BIOS and EFI network boot. The GRUB BIOS setup is handled depending on grub-pc-bin being present or not, which as expected skips the i386-pc setup on arm64. We drop the dependency on pxelinux, and add grub-pc-bin (as required by grub-mknetdir to generate grub/i386-pc/core.0) to Recommends, as we have an architecture all package. Drop the deprecated ldbsd.com / addon__*_bsd.cfg support, while at it.
… defaults Now that we support $prefix instead of hardcoded /boot/grub usage in our GRUB configuration files (see grml/grml-live#548), we can also support custom GRUB themes and alike. Set up `grub` directory in tftpboot directory (/var/lib/tftpboot by default) for booting GRUB via PXE/netboot, providing all files that might be relevant for booting. Avoid rewriting the configuration files on the fly, and instead bring grub.cfg as close as possible to what we're using on the live system also (the GRUB netboot binary sadly doesn't neither support sourcing files with regexp nor testing for files with [ -e ....]). NOTE: we are *not* setting up / including `addons.cfg`, as all entries are known to be failing (the test for the files all fail as stated in the previous paragraph already), even when removing the tests and adjusting the paths to use $prefix/../addons/ instead of /boot/addons/, it doesn't work and chainloading the addons via PXE/netboot fail with: error: Access violation See grml/grml-live#321
While 32-bit UEFI hopefully isn't common any longer, let's support it if either the grub-efi-ia32-signed or grub-efi-ia32-unsigned packages are available, given we also support it in grml-live's config/media-scripts/GRMLBASE/31-grub.
Addressing #26 (not yet ready though, messed up something about
/var/lib/tftpboot/boot/grub/grml*files which are missing and having wrong paths for kernel/initrd files then)