From 79a82cba76c0cdafc1724670217614fe332ab186 Mon Sep 17 00:00:00 2001 From: "Gerd v. Egidy" Date: Sat, 11 Mar 2023 22:18:44 +0100 Subject: [PATCH] add customization hooks to boot menus Adds empty sysresccd_custom.cfg and /boot/grub/custom.cfg files that are included from the regular boot menus (syslinux and grub). These are intended for the user to customize. Having dedicated files for this allows completely replacing the files. This is easier than requiring careful patching with potential conflicts with different versions of SystemRescue. --- build.sh | 1 + efiboot/grub/custom.cfg | 5 +++++ efiboot/grub/grubsrcd.cfg | 2 ++ syslinux/sysresccd_custom.cfg | 5 +++++ syslinux/sysresccd_sys.cfg | 2 ++ 5 files changed, 15 insertions(+) create mode 100644 efiboot/grub/custom.cfg create mode 100644 syslinux/sysresccd_custom.cfg diff --git a/build.sh b/build.sh index 3d4a6df..b210046 100755 --- a/build.sh +++ b/build.sh @@ -342,6 +342,7 @@ make_efi() { s|%INSTALL_DIR%|${install_dir}|g" \ ${script_path}/efiboot/grub/grubsrcd.cfg > ${work_dir}/iso/boot/grub/grubsrcd.cfg cp ${script_path}/efiboot/grub/loopback.cfg ${work_dir}/iso/boot/grub/ + cp ${script_path}/efiboot/grub/custom.cfg ${work_dir}/iso/boot/grub/ cp -a /usr/share/edk2-shell/${edk2arch}/Shell_Full.efi ${work_dir}/iso/EFI/shell.efi cp ${work_dir}/${arch}/airootfs/boot/memtest86+/memtest.efi ${work_dir}/iso/EFI/memtest.efi } diff --git a/efiboot/grub/custom.cfg b/efiboot/grub/custom.cfg new file mode 100644 index 0000000..04c960e --- /dev/null +++ b/efiboot/grub/custom.cfg @@ -0,0 +1,5 @@ +# This file is intended for customizing the boot menu of SystemRescue +# +# Either edit this file on a writable media +# or use https://www.system-rescue.org/scripts/sysrescue-customize/ to replace it + diff --git a/efiboot/grub/grubsrcd.cfg b/efiboot/grub/grubsrcd.cfg index 9636241..9435c30 100644 --- a/efiboot/grub/grubsrcd.cfg +++ b/efiboot/grub/grubsrcd.cfg @@ -87,6 +87,8 @@ menuentry 'Stop during the boot process before mounting the root filesystem' { initrd /%INSTALL_DIR%/boot/intel_ucode.img /%INSTALL_DIR%/boot/amd_ucode.img /%INSTALL_DIR%/boot/%ISO_ARCH%/sysresccd.img } +source /boot/grub/custom.cfg + menuentry 'Memtest86+ memory tester for UEFI' { insmod fat set gfxpayload=800x600,1024x768 diff --git a/syslinux/sysresccd_custom.cfg b/syslinux/sysresccd_custom.cfg new file mode 100644 index 0000000..04c960e --- /dev/null +++ b/syslinux/sysresccd_custom.cfg @@ -0,0 +1,5 @@ +# This file is intended for customizing the boot menu of SystemRescue +# +# Either edit this file on a writable media +# or use https://www.system-rescue.org/scripts/sysrescue-customize/ to replace it + diff --git a/syslinux/sysresccd_sys.cfg b/syslinux/sysresccd_sys.cfg index 9773291..146b9cc 100644 --- a/syslinux/sysresccd_sys.cfg +++ b/syslinux/sysresccd_sys.cfg @@ -73,4 +73,6 @@ LINUX boot/%ISO_ARCH%/vmlinuz INITRD boot/intel_ucode.img,boot/amd_ucode.img,boot/%ISO_ARCH%/sysresccd.img APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% %DEFAULT_KERNEL_PARAM% break +INCLUDE boot/syslinux/sysresccd_custom.cfg + INCLUDE boot/syslinux/sysresccd_tail.cfg