summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLyndon Brown <jnqnfe@gmail.com>2020-03-24 22:09:35 +0000
committerRaphaƫl Hertzog <raphael@offensive-security.com>2020-04-23 09:12:52 +0200
commit6e86a6480cd6abc5b0e950adb4e3fcaf03f2be7c (patch)
tree087de89c03e4e14b941e5162c84afc360c383596
parent40a076bf350b38888d8fd45c1d722b4351c84612 (diff)
downloadvyos-live-build-6e86a6480cd6abc5b0e950adb4e3fcaf03f2be7c.tar.gz
vyos-live-build-6e86a6480cd6abc5b0e950adb4e3fcaf03f2be7c.zip
grub2|loopback: allow providing hotkey to menu entry creation helpers
-rwxr-xr-xscripts/build/binary_loopback_cfg8
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/build/binary_loopback_cfg b/scripts/build/binary_loopback_cfg
index fbf893a53..25130410a 100755
--- a/scripts/build/binary_loopback_cfg
+++ b/scripts/build/binary_loopback_cfg
@@ -50,9 +50,10 @@ Grub_menu_entry() {
local KERNEL="$2"
local INITRD="$3"
local APPEND="$4"
+ local HOTKEY="${5:+ --hotkey=$5}"
cat <<END
-menuentry "$LABEL" {
+menuentry "${LABEL}"${HOTKEY} {
linux $KERNEL $APPEND
initrd $INITRD
}
@@ -71,6 +72,7 @@ Grub_install_entry ()
local KERNEL="${3}"
local INITRD="${4}"
local APPEND="${5}"
+ local HOTKEY="${6}"
# Drop "quiet" kernel parameter for expert entries
case $TYPE in
@@ -81,10 +83,10 @@ Grub_install_entry ()
if [ -z "$LINUX_INSTALL" ]; then
# First entry recorded in LINUX_INSTALL
- LINUX_INSTALL="$(Grub_menu_entry "$LABEL" "$KERNEL" "$INITRD" "$APPEND")$NL"
+ LINUX_INSTALL="$(Grub_menu_entry "$LABEL" "$KERNEL" "$INITRD" "$APPEND" "$HOTKEY")$NL"
else
# Remaining entries recorded in LINUX_ADVANCED_INSTALL
- LINUX_ADVANCED_INSTALL="$LINUX_ADVANCED_INSTALL$(Grub_menu_entry "$LABEL" "$KERNEL" "$INITRD" "$APPEND")$NL"
+ LINUX_ADVANCED_INSTALL="$LINUX_ADVANCED_INSTALL$(Grub_menu_entry "$LABEL" "$KERNEL" "$INITRD" "$APPEND" "$HOTKEY")$NL"
fi
}