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
This commit is contained in:
Lyndon Brown 2020-03-26 05:42:11 +00:00 committed by Raphaël Hertzog
parent d5d1e35f22
commit 40a076bf35
2 changed files with 28 additions and 11 deletions

View File

@ -276,10 +276,27 @@ escape_for_sed() {
echo -n "$1" | perl -npe 's/\n/\\n/gm' echo -n "$1" | perl -npe 's/\n/\\n/gm'
} }
# Those without '@' markers are for backwards compatibility
sed -i \ 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_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_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|MEMTEST|$(escape_for_sed "${MEMTEST}")|" \
-e "s|KERNEL_GI|${KERNEL_GI}|" \ -e "s|KERNEL_GI|${KERNEL_GI}|" \
-e "s|INITRD_GI|${INITRD_GI}|" \ -e "s|INITRD_GI|${INITRD_GI}|" \

View File

@ -28,31 +28,31 @@ insmod play
play 960 440 1 0 4 440 1 play 960 440 1 0 4 440 1
# Live boot # Live boot
LINUX_LIVE @LINUX_LIVE@
# You can add more entries like this # You can add more entries like this
# menuentry "Alternate live boot" { # menuentry "Alternate live boot" {
# linux KERNEL_LIVE APPEND_LIVE custom options here # linux @KERNEL_LIVE@ @APPEND_LIVE@ custom options here
# initrd INITRD_LIVE # initrd @INITRD_LIVE@
# } # }
# menuentry "Alternate graphical installer" { # menuentry "Alternate graphical installer" {
# linux KERNEL_GI APPEND_GI custom options here # linux @KERNEL_GI@ @APPEND_GI@ custom options here
# initrd INITRD_GI # initrd @INITRD_GI@
# } # }
# menuentry "Alternate textual installer" { # menuentry "Alternate textual installer" {
# linux KERNEL_DI APPEND_DI custom options here # linux @KERNEL_DI@ @APPEND_DI@ custom options here
# initrd INITRD_DI # initrd @INITRD_DI@
# } # }
# Installer (if any) # Installer (if any)
LINUX_INSTALL @LINUX_INSTALL@
submenu 'Advanced options...' { submenu 'Advanced options...' {
# More installer entries (if any) # More installer entries (if any)
LINUX_ADVANCED_INSTALL @LINUX_ADVANCED_INSTALL@
# Memtest (if any) # Memtest (if any)
MEMTEST @MEMTEST@
} }