diff options
author | Daniel Baumann <mail@daniel-baumann.ch> | 2013-07-12 16:34:46 +0200 |
---|---|---|
committer | Daniel Baumann <mail@daniel-baumann.ch> | 2013-07-12 16:34:46 +0200 |
commit | 383d4d26b7cdbfb492d69a7ad0a6e7c3ed4b567e (patch) | |
tree | 06017ad52e71dc92caad57537348f95b53b1df81 /scripts/build/binary_syslinux | |
parent | 18e0a2f32525e5092be322272e7bf9296f050584 (diff) | |
download | vyos-live-build-383d4d26b7cdbfb492d69a7ad0a6e7c3ed4b567e.tar.gz vyos-live-build-383d4d26b7cdbfb492d69a7ad0a6e7c3ed4b567e.zip |
Expanding all variables in all syslinux configuration files, rathern than on some selected ones only.
Diffstat (limited to 'scripts/build/binary_syslinux')
-rwxr-xr-x | scripts/build/binary_syslinux | 140 |
1 files changed, 71 insertions, 69 deletions
diff --git a/scripts/build/binary_syslinux b/scripts/build/binary_syslinux index 2ae348240..249c8483b 100755 --- a/scripts/build/binary_syslinux +++ b/scripts/build/binary_syslinux @@ -209,78 +209,80 @@ then esac fi -for _FILE in "${_TARGET}"/*.cfg -do - sed -i -e "s#@APPEND_LIVE@#${LB_BOOTAPPEND_LIVE}#g" \ - -e "s#@APPEND_LIVE_FAILSAFE@#${LB_BOOTAPPEND_LIVE_FAILSAFE}#g" \ - -e "s#@APPEND_INSTALL@#${LB_BOOTAPPEND_INSTALL}#g" \ - -e "s#@APPEND_INSTALL_FAILSAFE@#${LB_BOOTAPPEND_INSTALL_FAILSAFE}#g" \ - "${_FILE}" -done +eval _VERSION="$`echo RELEASE_${LB_DISTRIBUTION}`" -if [ -e "${_TARGET}/splash.svg.in" ] -then - case "${LB_MODE}" in - progress-linux) - _PROJECT="Progress Linux" +_DISTRIBUTION="${LB_DISTRIBUTION}" +_ARCHITECTURE="${LIVE_IMAGE_ARCHITECTURE}" - if ls config/package-lists/client-gnome.list* - then - _DESCRIPTION="Client GNOME" - elif ls config/package-lists/client-lxde.list* > /dev/null 2>&1 - then - _DESCRIPTION="Client LXDE" - elif ls config/package-lists/server-lxc.list* > /dev/null 2>&1 - then - _DESCRIPTION="Server LXC" - else - _DESCRIPTION="Standard" - fi - ;; +_DATE=$(date -R) +_YEAR="$(date +%Y)" +_MONTH="$(date +%m)" +_DAY="$(date +%d)" +_HOUR="$(date +%H)" +_MINUTE="$(date +%M)" +_SECOND="$(date +%S)" - *) - _PROJECT="Debian GNU/Linux" - _DESCRIPTION="" - ;; +_LINUX_VERSIONS="$(for _LINUX in chroot/boot/vmlinuz-* ; do chroot chroot apt-cache policy $(basename ${_LINUX} | sed -e 's|vmlinuz-|linux-image-|') | awk '/Installed: / { print $2 }' ; done | sort -Vru | tr "\n" " ")" - esac +_LIVE_BUILD_VERSION="$(lb --version)" +_LIVE_BOOT_VERSION="$(chroot chroot apt-cache policy live-boot | awk '/Installed: / { print $2 }')" +_LIVE_CONFIG_VERSION="$(chroot chroot apt-cache policy live-config | awk '/Installed: / { print $2 }')" +_LIVE_TOOLS_VERSION="$(chroot chroot apt-cache policy live-tools | awk '/Installed: / { print $2 }')" - eval _VERSION="$`echo RELEASE_${LB_DISTRIBUTION}`" - _DISTRIBUTION="${LB_DISTRIBUTION}" - _ARCHITECTURE="${LIVE_IMAGE_ARCHITECTURE}" - _DATE=$(date -R) - _YEAR="$(date +%Y)" - _MONTH="$(date +%m)" - _DAY="$(date +%d)" - _HOUR="$(date +%H)" - _MINUTE="$(date +%M)" - _SECOND="$(date +%S)" - _LINUX_VERSIONS="$(for _LINUX in chroot/boot/vmlinuz-* ; do chroot chroot apt-cache policy $(basename ${_LINUX} | sed -e 's|vmlinuz-|linux-image-|') | awk '/Installed: / { print $2 }' ; done | sort -Vru | tr "\n" " ")" - _LIVE_BUILD_VERSION="$(lb --version)" - _LIVE_BOOT_VERSION="$(chroot chroot apt-cache policy live-boot | awk '/Installed: / { print $2 }')" - _LIVE_CONFIG_VERSION="$(chroot chroot apt-cache policy live-config | awk '/Installed: / { print $2 }')" - _LIVE_TOOLS_VERSION="$(chroot chroot apt-cache policy live-tools | awk '/Installed: / { print $2 }')" - - sed -e "s|@PROJECT@|${_PROJECT}|g" \ - -e "s|@DISTRIBUTION@|${_DISTRIBUTION}|g" \ - -e "s|@PARENT_DISTRIBUTION@|${LB_PARENT_DISTRIBUTION}|g" \ - -e "s|@VERSION@|${_VERSION}|g" \ - -e "s|@ARCHITECTURE@|${_ARCHITECTURE}|g" \ - -e "s|@DESCRIPTION@|${_DESCRIPTION}|g" \ - -e "s|@DATE@|${_DATE}|g" \ - -e "s|@YEAR@|${_YEAR}|g" \ - -e "s|@MONTH@|${_MONTH}|g" \ - -e "s|@DAY@|${_DAY}|g" \ - -e "s|@HOUR@|${_HOUR}|g" \ - -e "s|@MINUTE@|${_MINUTE}|g" \ - -e "s|@SECOND@|${_SECOND}|g" \ - -e "s|@LINUX_VERSIONS@|${_LINUX_VERSIONS}|g" \ - -e "s|@LIVE_BUILD_VERSION@|${_LIVE_BUILD_VERSION}|g" \ - -e "s|@LIVE_BOOT_VERSION@|${_LIVE_BOOT_VERSION}|g" \ - -e "s|@LIVE_CONFIG_VERSION@|${_LIVE_CONFIG_VERSION}|g" \ - -e "s|@LIVE_TOOLS_VERSION@|${_LIVE_TOOLS_VERSION}|g" \ - "${_TARGET}/splash.svg.in" > "${_TARGET}/splash.svg" -fi +case "${LB_MODE}" in + progress-linux) + _PROJECT="Progress Linux" + + if ls config/package-lists/client-gnome.list* + then + _DESCRIPTION="Client GNOME" + elif ls config/package-lists/client-lxde.list* > /dev/null 2>&1 + then + _DESCRIPTION="Client LXDE" + elif ls config/package-lists/server-lxc.list* > /dev/null 2>&1 + then + _DESCRIPTION="Server LXC" + else + _DESCRIPTION="Standard" + fi + ;; + + *) + _PROJECT="Debian GNU/Linux" + _DESCRIPTION="" + ;; + +esac + +for _FILE in "${_TARGET}"/*.cfg ${_TARGET}/*.svg +do + if [ -e "${_FILE}" ] + then + sed -i -e "s#@APPEND_LIVE@#${LB_BOOTAPPEND_LIVE}#g" \ + -e "s#@APPEND_LIVE_FAILSAFE@#${LB_BOOTAPPEND_LIVE_FAILSAFE}#g" \ + -e "s#@APPEND_INSTALL@#${LB_BOOTAPPEND_INSTALL}#g" \ + -e "s#@APPEND_INSTALL_FAILSAFE@#${LB_BOOTAPPEND_INSTALL_FAILSAFE}#g" \ + -e "s|@PROJECT@|${_PROJECT}|g" \ + -e "s|@DISTRIBUTION@|${_DISTRIBUTION}|g" \ + -e "s|@PARENT_DISTRIBUTION@|${LB_PARENT_DISTRIBUTION}|g" \ + -e "s|@VERSION@|${_VERSION}|g" \ + -e "s|@ARCHITECTURE@|${_ARCHITECTURE}|g" \ + -e "s|@DESCRIPTION@|${_DESCRIPTION}|g" \ + -e "s|@DATE@|${_DATE}|g" \ + -e "s|@YEAR@|${_YEAR}|g" \ + -e "s|@MONTH@|${_MONTH}|g" \ + -e "s|@DAY@|${_DAY}|g" \ + -e "s|@HOUR@|${_HOUR}|g" \ + -e "s|@MINUTE@|${_MINUTE}|g" \ + -e "s|@SECOND@|${_SECOND}|g" \ + -e "s|@LINUX_VERSIONS@|${_LINUX_VERSIONS}|g" \ + -e "s|@LIVE_BUILD_VERSION@|${_LIVE_BUILD_VERSION}|g" \ + -e "s|@LIVE_BOOT_VERSION@|${_LIVE_BOOT_VERSION}|g" \ + -e "s|@LIVE_CONFIG_VERSION@|${_LIVE_CONFIG_VERSION}|g" \ + -e "s|@LIVE_TOOLS_VERSION@|${_LIVE_TOOLS_VERSION}|g" \ + "${_FILE}" + fi +done if [ -e "${_TARGET}/splash.svg" ] then @@ -296,9 +298,9 @@ then rsvg --format png --height 480 --width 640 "${_TARGET}/splash.svg" "${_TARGET}/splash.png" ;; esac -fi -rm -f "${_TARGET}/splash.svg.in" "${_TARGET}/splash.svg" + rm -f "${_TARGET}/splash.svg" +fi case "${LB_MODE}" in progress-linux) |