From 40a076bf350b38888d8fd45c1d722b4351c84612 Mon Sep 17 00:00:00 2001 From: Lyndon Brown Date: Thu, 26 Mar 2020 05:42:11 +0000 Subject: [PATCH] grub2|loopback: use '@' bookended placeholders ...for consistency with syslinux config placeholders and improved clarity of what text is a placeholder. the old placeholders without the bookends are still replaced for user configs for backwards compatibility. the new ones are little used just at the moment but are expected to become used much more in later commits. Gbp-Dch: Short --- scripts/build/binary_loopback_cfg | 19 ++++++++++++++++++- share/bootloaders/grub-pc/grub.cfg | 20 ++++++++++---------- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/scripts/build/binary_loopback_cfg b/scripts/build/binary_loopback_cfg index 9c84e2b18..fbf893a53 100755 --- a/scripts/build/binary_loopback_cfg +++ b/scripts/build/binary_loopback_cfg @@ -276,10 +276,27 @@ escape_for_sed() { echo -n "$1" | perl -npe 's/\n/\\n/gm' } +# Those without '@' markers are for backwards compatibility sed -i \ + -e "s|@LINUX_LIVE@|$(escape_for_sed "${LINUX_LIVE}")|" \ + -e "s|@LINUX_INSTALL@|$(escape_for_sed "${LINUX_INSTALL}")|" \ + -e "s|@LINUX_ADVANCED_INSTALL@|$(escape_for_sed "${LINUX_ADVANCED_INSTALL}")|" \ + -e "s|@MEMTEST@|$(escape_for_sed "${MEMTEST}")|" \ + -e "s|@KERNEL_GI@|${KERNEL_GI}|" \ + -e "s|@INITRD_GI@|${INITRD_GI}|" \ + -e "s|@APPEND_GI@|${APPEND_GI}|" \ + -e "s|@KERNEL_DI@|${KERNEL_DI}|" \ + -e "s|@INITRD_DI@|${INITRD_DI}|" \ + -e "s|@APPEND_DI@|${APPEND_DI}|" \ + -e "s|@KERNEL_LIVE@|${KERNEL_LIVE}|" \ + -e "s|@INITRD_LIVE@|${INITRD_LIVE}|" \ + -e "s|@APPEND_LIVE@|${APPEND_LIVE}|" \ + -e "s|@LB_BOOTAPPEND_INSTALL@|${LB_BOOTAPPEND_INSTALL}|" \ + -e "s|@LB_BOOTAPPEND_LIVE_FAILSAFE@|${LB_BOOTAPPEND_LIVE_FAILSAFE}|" \ + -e "s|@LB_BOOTAPPEND_LIVE@|${LB_BOOTAPPEND_LIVE}|" \ -e "s|LINUX_LIVE|$(escape_for_sed "${LINUX_LIVE}")|" \ - -e "s|LINUX_ADVANCED_INSTALL|$(escape_for_sed "${LINUX_ADVANCED_INSTALL}")|" \ -e "s|LINUX_INSTALL|$(escape_for_sed "${LINUX_INSTALL}")|" \ + -e "s|LINUX_ADVANCED_INSTALL|$(escape_for_sed "${LINUX_ADVANCED_INSTALL}")|" \ -e "s|MEMTEST|$(escape_for_sed "${MEMTEST}")|" \ -e "s|KERNEL_GI|${KERNEL_GI}|" \ -e "s|INITRD_GI|${INITRD_GI}|" \ diff --git a/share/bootloaders/grub-pc/grub.cfg b/share/bootloaders/grub-pc/grub.cfg index 0cfe15bf5..6aedbe420 100644 --- a/share/bootloaders/grub-pc/grub.cfg +++ b/share/bootloaders/grub-pc/grub.cfg @@ -28,31 +28,31 @@ insmod play play 960 440 1 0 4 440 1 # Live boot -LINUX_LIVE +@LINUX_LIVE@ # You can add more entries like this # menuentry "Alternate live boot" { -# linux KERNEL_LIVE APPEND_LIVE custom options here -# initrd INITRD_LIVE +# linux @KERNEL_LIVE@ @APPEND_LIVE@ custom options here +# initrd @INITRD_LIVE@ # } # menuentry "Alternate graphical installer" { -# linux KERNEL_GI APPEND_GI custom options here -# initrd INITRD_GI +# linux @KERNEL_GI@ @APPEND_GI@ custom options here +# initrd @INITRD_GI@ # } # menuentry "Alternate textual installer" { -# linux KERNEL_DI APPEND_DI custom options here -# initrd INITRD_DI +# linux @KERNEL_DI@ @APPEND_DI@ custom options here +# initrd @INITRD_DI@ # } # Installer (if any) -LINUX_INSTALL +@LINUX_INSTALL@ submenu 'Advanced options...' { # More installer entries (if any) -LINUX_ADVANCED_INSTALL +@LINUX_ADVANCED_INSTALL@ # Memtest (if any) -MEMTEST +@MEMTEST@ }