summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLyndon Brown <jnqnfe@gmail.com>2020-03-26 05:42:11 +0000
committerRaphaƫl Hertzog <raphael@offensive-security.com>2020-04-23 09:12:24 +0200
commit40a076bf350b38888d8fd45c1d722b4351c84612 (patch)
treee2670ac05fae533abd5c18aefab12129221a127c
parentd5d1e35f22c5f161442326fe5f5351abe498a3b1 (diff)
downloadvyos-live-build-40a076bf350b38888d8fd45c1d722b4351c84612.tar.gz
vyos-live-build-40a076bf350b38888d8fd45c1d722b4351c84612.zip
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
-rwxr-xr-xscripts/build/binary_loopback_cfg19
-rw-r--r--share/bootloaders/grub-pc/grub.cfg20
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@
}