From 3004ef6851e591b31026bf1925b2ffeb0f98faf4 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 6 Feb 2012 23:02:06 +0100 Subject: Shortening kernel and initrd filenames in /live again similar to what we did with in lenny. Unfortunately, syslinux as of wheezy and newer apparently does not support long filenames anymore. Therefore, we do have to shorten the filenames from: /live/vmlinuz-3.2.0-1-amd64 /live/initrd.img-3.2.0-1-amd64 to: /live/vmlinuz /live/initrd.img In case more than one kernel flavour is used, the files are being numbered, starting with vmlinuz1 and initrd1.img. --- scripts/build/lb_binary_syslinux | 50 +++++++++++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 13 deletions(-) (limited to 'scripts/build') 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" \ -- cgit v1.2.3