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_grub225
1 files changed, 25 insertions, 0 deletions
diff --git a/scripts/build/lb_binary_grub2 b/scripts/build/lb_binary_grub2
index 6ad8c3c..549274a 100755
--- a/scripts/build/lb_binary_grub2
+++ b/scripts/build/lb_binary_grub2
@@ -67,6 +67,31 @@ 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 binary/${KERNEL} ]
+ then
+ mv binary/${KERNEL} "binary/$(dirname ${KERNEL})/vmlinuz${_NUMBER}"
+ KERNEL="$(dirname ${KERNEL})/vmlinuz${_NUMBER}"
+ fi
+
+ if [ -e binary/${INITRD} ]
+ then
+ mv binary/${INITRD} "binary/$(dirname ${INITRD})/initrd${_NUMBER}.img"
+ INITRD="$(dirname ${INITRD})/initrd${_NUMBER}.img"
+ fi
+ ;;
+ 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}"