diff options
author | Cody A.W. Somerville <cody.somerville@canonical.com> | 2010-12-17 11:30:36 +0100 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2011-03-09 19:17:32 +0100 |
commit | 327b0ff6e03321f75d900b76ff7ec0ad7016bbfe (patch) | |
tree | 2e4b0a26bae9ab42f593103e55a1d8a858c0da60 /scripts/build | |
parent | 27e88b6501f6a732b87c687026e5c028af662a42 (diff) | |
download | live-build-327b0ff6e03321f75d900b76ff7ec0ad7016bbfe.zip live-build-327b0ff6e03321f75d900b76ff7ec0ad7016bbfe.tar.gz |
Fixing numbering of live kernels and initrd files when using syslinux.
Diffstat (limited to 'scripts/build')
-rwxr-xr-x | scripts/build/lb_binary_syslinux | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/scripts/build/lb_binary_syslinux b/scripts/build/lb_binary_syslinux index 9a96c5d..46b607a 100755 --- a/scripts/build/lb_binary_syslinux +++ b/scripts/build/lb_binary_syslinux @@ -95,27 +95,28 @@ Syslinux_live_entry () case "${LB_BINARY_IMAGES}" in iso*|usb*) - NUMBER="$(ls -1 ${KERNEL_PATH} | grep 'vmlinuz-' | wc -l)" - - # Do not add numbering to filenames if first kernel/initrd - if [ "${NUMBER}" = "2" ] + if [ "${LABEL}" = "live" ] then - NUMBER="" + # 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 - # Note: ISOLINUX will not find the kernel if the name ends in ".img". if [ -e ${KERNEL_PATH}/${KERNEL} ] then - mv ${KERNEL_PATH}/${KERNEL} ${KERNEL_PATH}/vmlinuz${NUMBER} + # Note: ISOLINUX will not find the kernel if the name ends in ".img". + mv ${KERNEL_PATH}/${KERNEL} ${KERNEL_PATH}/vmlinuz${_NUMBER} fi if [ -e ${KERNEL_PATH}/${INITRD} ] then - mv ${KERNEL_PATH}/${INITRD} ${KERNEL_PATH}/initrd${NUMBER}.img + mv ${KERNEL_PATH}/${INITRD} ${KERNEL_PATH}/initrd${_NUMBER}.img fi - KERNEL=vmlinuz${NUMBER} - INITRD=initrd${NUMBER}.img + KERNEL=vmlinuz${_NUMBER} + INITRD=initrd${_NUMBER}.img ;; esac |