summaryrefslogtreecommitdiff
path: root/scripts/build/lb_binary_grub2
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/build/lb_binary_grub2')
-rwxr-xr-xscripts/build/lb_binary_grub226
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/build/lb_binary_grub2 b/scripts/build/lb_binary_grub2
index 6ad8c3c..fdfca0d 100755
--- a/scripts/build/lb_binary_grub2
+++ b/scripts/build/lb_binary_grub2
@@ -67,6 +67,32 @@ Grub_live_entry ()
INITRD="${3}"
APPEND="${4}"
+ case "${LB_BINARY_IMAGES}" in
+ iso*|usb*)
+ if [ "${LABEL}" = "live" ]
+ then
+ # Do not number the default kernel / initrd files.
+ _NUMBER=""
+ else
+ # Use order of flavours in LB_LINUX_FLAVOURS for numbering.
+ _NUMBER="$(echo ${LB_LINUX_FLAVOURS} | awk -v FLAVOUR="${FLAVOUR}" 'BEGIN{RS=" "} {if($1 == FLAVOUR) print NR}')"
+ fi
+
+ if [ -e ${KERNEL_PATH}/${KERNEL} ]
+ then
+ mv ${KERNEL_PATH}/${KERNEL} ${KERNEL_PATH}/vmlinuz${_NUMBER}
+ fi
+
+ if [ -e ${KERNEL_PATH}/${INITRD} ]
+ then
+ mv ${KERNEL_PATH}/${INITRD} ${KERNEL_PATH}/initrd${_NUMBER}.img
+ fi
+
+ KERNEL=vmlinuz${_NUMBER}
+ INITRD=initrd${_NUMBER}.img
+ ;;
+ esac
+
LINUX_LIVE="${LINUX_LIVE}\nmenuentry \"Debian GNU/Linux - ${LABEL}\" {"
LINUX_LIVE="${LINUX_LIVE}\nlinux\t\t/${KERNEL} boot=${INITFS} config LB_BOOTAPPEND_LIVE ${APPEND}"
LINUX_LIVE="${LINUX_LIVE}\ninitrd\t\t/${INITRD}"