summaryrefslogtreecommitdiff
path: root/scripts/build
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/build')
-rwxr-xr-xscripts/build/lb_binary_syslinux50
1 files changed, 37 insertions, 13 deletions
diff --git a/scripts/build/lb_binary_syslinux b/scripts/build/lb_binary_syslinux
index c306b2242..08d725890 100755
--- a/scripts/build/lb_binary_syslinux
+++ b/scripts/build/lb_binary_syslinux
@@ -170,19 +170,43 @@ esac
# Configuring files
if [ -e "${_TARGET}/live.cfg.in" ]
then
- # FIXME: only works with one kernel version for the time being
- for _FLAVOUR in ${LB_LINUX_FLAVOURS}
- do
- _VERSION="$(basename binary/live/vmlinuz-*-${_FLAVOUR} -${_FLAVOUR} | sed -e 's|vmlinuz-||')"
-
- sed -e "s|@FLAVOUR@|${_FLAVOUR}|g" \
- -e "s|@KERNEL@|/live/vmlinuz-${_VERSION}-${_FLAVOUR}|g" \
- -e "s|@INITRD@|/live/initrd.img-${_VERSION}-${_FLAVOUR}|g" \
- -e "s|@LB_BOOTAPPEND_LIVE@|${LB_BOOTAPPEND_LIVE}|g" \
- "${_TARGET}/live.cfg.in" >> "${_TARGET}/live.cfg"
- done
-
- rm -f "${_TARGET}/live.cfg.in"
+ # This is all rather suboptimal.. needs prettifying at some point
+ _FLAVOURS="$(echo ${LB_LINUX_FLAVOURS} | wc -w)"
+
+ case "${_FLAVOURS}" in
+ 1)
+ mv binary/live/vmlinuz-* binary/live/vmlinuz
+ mv binary/live/initrd.img-* binary/live/initrd.img
+
+ sed -e "s|@FLAVOUR@|${LB_LINUX_FLAVOUR}|g" \
+ -e "s|@KERNEL@|/live/vmlinuz|g" \
+ -e "s|@INITRD@|/live/initrd.img|g" \
+ -e "s|@LB_BOOTAPPEND_LIVE@|${LB_BOOTAPPEND_LIVE}|g" \
+ "${_TARGET}/live.cfg.in" >> "${_TARGET}/live.cfg"
+
+ rm -f "${_TARGET}/live.cfg.in"
+ ;;
+
+ *)
+ _NUMBER="0"
+
+ for _FLAVOUR in ${LB_LINUX_FLAVOURS}
+ do
+ _NUMBER="$((${_NUMBER} + 1))"
+
+ mv binary/live/vmlinuz-*-${_FLAVOUR} binary/live/vmlinuz${_NUMBER}
+ mv binary/live/initrd.img-*-${_FLAVOUR} binary/live/initrd${_NUMBER}.img
+
+ sed -e "s|@FLAVOUR@|${_FLAVOUR}|g" \
+ -e "s|@KERNEL@|/live/vmlinuz${_NUMBER}|g" \
+ -e "s|@INITRD@|/live/initrd${_NUMBER}.img|g" \
+ -e "s|@LB_BOOTAPPEND_LIVE@|${LB_BOOTAPPEND_LIVE}|g" \
+ "${_TARGET}/live.cfg.in" >> "${_TARGET}/live.cfg"
+ done
+
+ rm -f "${_TARGET}/live.cfg.in"
+ ;;
+ esac
elif [ -e "${_TARGET}/live.cfg" ]
then
sed -i -e "s|@LB_BOOTAPPEND_LIVE@|${LB_BOOTAPPEND_LIVE}|g" \