diff options
author | Daniel Baumann <daniel@debian.org> | 2012-02-06 23:02:06 +0100 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2012-02-06 23:17:23 +0100 |
commit | 3004ef6851e591b31026bf1925b2ffeb0f98faf4 (patch) | |
tree | 1db3cde2de30e452226abc7836611953c22739bd /scripts | |
parent | 3f62ac0a3d7984f1ea0f555a056c5220a2b33a84 (diff) | |
download | vyos-live-build-3004ef6851e591b31026bf1925b2ffeb0f98faf4.tar.gz vyos-live-build-3004ef6851e591b31026bf1925b2ffeb0f98faf4.zip |
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.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build/lb_binary_syslinux | 50 |
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" \ |