Just one syslinux.cfg to edit for BIOS/UEFI

  • There are 2 syslinux.cfg files, 1 for BIOS and 1 for UEFI. I do forghet that some time and edit the wrong one on my UEFI boxes. The reason i do edit them is that i have at least 2 LE versions on my box (stable, nightly) and select with the help of menu.c32 or vesamenu.c32.

    My solution is the UEFI one just includes the BIOS one.

    /flash/syslinux.cfg normal as ever

    /flash/EFI/BOOT/syslinux.cfg only with one line "INCLUDE /syslinux.cfg"

    That works perfect for me. But at least in packages/sysutils/busybox/scripts/init and the getedid tool the syslinux.cfg is manipulated and copied.

    Thanks for reading my proposal

    Edited once, last by sky42 (May 6, 2018 at 11:07 AM).

  • The configuration can be more simplified: when /EFI/BOOT/syslinux.cfg is deleted from the file system UEFI syslinux automatically uses /syslinux.cfg.

  • I've confirmed that removing /flash/EFI/BOOT/syslinux.cfg automatically defaults to /flash/syslinux.cfg, and I've added a second commit that drops EFI/BOOT/syslinux.cfg entirely.

    Does anyone have any ideas if we can do the same for /flash/EFI/BOOT/grub.cfg?

  • For grub2 that depends on your grub version. On CentOS and Ubuntu they are diffrent.

    On my pxe server at home i use one /uefi/grub.cfg and in all the other places is a grub.cfg with "configfile /uefi/grub.cfg", because for secure boot i need to use the grub from the distro.

    So yes it should be possible and the content of /flash/EFI/BOOT/grub.cfg must be "configfile /grub.cfg"

    There is also a way to write one grub.cfg which does different things if it is uefi or not. I had my guys at work build one with this differentiation to start the correct memtest. I dont thing that is needed for LE, but i can get these configs.

  • Thanks. Unfortunately grub usage is a bit of a rarity in LibreELEC so I may leave grub alone this time to avoid breaking anything - I don't have a system on which I can test a grub installation.

  • I see a potetial problem or two.

    A old installation is updated with a image with PR 2698. After that the user does getedid which changes syslinux.cfg, but it is a UEFI system with a existing /flash/EFI/BOOT/syslinux.cfg and getedid only changes /flash/syslinux.cfg. So the UEFI system will still use the /flash/EFI/BOOT/syslinux.cfg which is not changed.

    Move the /flash/EFI/BOOT/syslinux.cfg to /flash/EFI/BOOT/syslinux.cfg.off will solve that. Deleting it may destroy work in syslinux.cfg what somebody did on his box.

  • I see a potetial problem or two.

    A old installation is updated with a image with PR 2698. After that the user does getedid which changes syslinux.cfg, but it is a UEFI system with a existing /flash/EFI/BOOT/syslinux.cfg and getedid only changes /flash/syslinux.cfg. So the UEFI system will still use the /flash/EFI/BOOT/syslinux.cfg which is not changed.

    getedid will continue to update /flash/EFI/BOOT/syslinux.cfg if it exists AND the user has booted using UEFI. If the file doesn't exist (never installed, or deleted by the user) or the system is not booting with UEFI, then getedid will update /flash/syslinux.cfg.

    Move the /flash/EFI/BOOT/syslinux.cfg to /flash/EFI/BOOT/syslinux.cfg.off will solve that. Deleting it may destroy work in syslinux.cfg what somebody did on his box.

    Cleaning up an existing installation is likely to be a case of damned if you do, damned if you don't.

    Moving /flash/EFI/BOOT/syslinux.cfg to /flash/syslinux.cfg is all fine, so long as the user doesn't mind having their non-UEFI config overwritten (which may contain custom changes).

    And if we were to delete /flash/EFI/BOOT/syslinux.cfg then again we're potentially losing custom changes that may not be in /flash/syslinux.cfg.

    Currently (in PR2698) we do neither, *except* when the user is booting in "run" mode when we know the file we're deleting is always an exact copy of /flash/syslinux.cfg, so no custom changes will be lost.

    After PR2698, clean installations will not have /flash/EFI/BOOT/syslinux.cfg, but users with upgraded installations can choose to move or delete the file if they wish (and they should, to avoid future confusion).

    Going forward I imagine any documentation will refer only to /flash/syslinux.cfg as referencing two files is confusing, and we'll just have to deal somehow with legacy installations (ie. "Delete /flash/EFI/BOOT/syslinux.cfg - you don't need it").