diff options
author | Daniel Baumann <daniel@debian.org> | 2012-12-19 11:21:28 +0100 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2012-12-19 11:34:34 +0100 |
commit | 802179e59d615721e1d1614e6250485fedd7aa3c (patch) | |
tree | 9d2e7c758b7ad6f9fd82dd1d64385072d12643c3 /functions | |
parent | 9949a3a9125c96ad47234404b15cb4fd3eb4282e (diff) | |
download | vyos-live-build-802179e59d615721e1d1614e6250485fedd7aa3c.tar.gz vyos-live-build-802179e59d615721e1d1614e6250485fedd7aa3c.zip |
Also reading in existing values from new config tree format.
Diffstat (limited to 'functions')
-rwxr-xr-x | functions/common.sh | 2 | ||||
-rwxr-xr-x | functions/defaults.sh | 89 |
2 files changed, 57 insertions, 34 deletions
diff --git a/functions/common.sh b/functions/common.sh index 9621e476b..1a339c7e7 100755 --- a/functions/common.sh +++ b/functions/common.sh @@ -13,6 +13,6 @@ VERSION="$(if [ -e ${LIVE_BUILD}/VERSION ]; then cat ${LIVE_BUILD}/VERSION; else CONFIG_VERSION="$(echo ${VERSION} | awk -F- '{ print $1 }')" # FIXME -LIVE_CONFIGURATION_VERSION="${CONFIG_VERSION}" +LIVE_BUILD_VERSION="${CONFIG_VERSION}" PATH="${PWD}/local/bin:${PATH}" diff --git a/functions/defaults.sh b/functions/defaults.sh index 34b5979f8..59836c282 100755 --- a/functions/defaults.sh +++ b/functions/defaults.sh @@ -8,8 +8,60 @@ ## under certain conditions; see COPYING for details. +New_configuration () +{ + # Configuration-Version + LIVE_CONFIGURATION_VERSION="$(Get_configuration config/control Configuration-Version)" + LIVE_CONFIGURATION_VERSION="${LIVE_CONFIGURATION_VERSION:-${LIVE_BUILD_VERSION}}" + export LIVE_CONFIGURATION_VERSION + + # Image + #LIVE_IMAGE="$(Get_configuration config/control Image)" + #LIVE_IMAGE="${LIVE_IMAGE:-binary}" + + # Image Type + LIVE_IMAGE_TYPE="$(Get_configuration config/control Type)" + LIVE_IMAGE_TYPE="${LIVE_IMAGE_TYPE:-iso-hybrid}" + export LIVE_IMAGE_TYPE + + # Image Architecture + LIVE_IMAGE_ARCHITECTURE="$(Get_configuration config/control Architecture)" + + if [ -z "${LIVE_IMAGE_ARCHITECTURE}" ] + then + if [ -x "/usr/bin/dpkg" ] + then + LIVE_IMAGE_ARCHITECTURE="$(dpkg --print-architecture)" + else + case "$(uname -m)" in + sparc|powerpc) + LIVE_IMAGE_ARCHITECTURE="$(uname -m)" + ;; + x86_64) + LIVE_IMAGE_ARCHITECTURE="amd64" + ;; + *) + if [ -e /lib64 ] + then + LIVE_IMAGE_ARCHITECTURE="amd64" + else + LIVE_IMAGE_ARCHITECTURE="i386" + fi + + Echo_warning "Can't determine architecture, assuming ${LIVE_IMAGE_ARCHITECTURE}" + ;; + esac + fi + fi + + export LIVE_IMAGE_ARCHITECTURE +} + Set_defaults () { + # FIXME + New_configuration + ## config/common if [ -e local/live-build ] @@ -299,34 +351,6 @@ Set_defaults () ## config/bootstrap - # Setting architecture value - if [ -z "${LIVE_IMAGE_ARCHITECTURE}" ] - then - if [ -x "/usr/bin/dpkg" ] - then - LIVE_IMAGE_ARCHITECTURE="$(dpkg --print-architecture)" - else - case "$(uname -m)" in - sparc|powerpc) - LIVE_IMAGE_ARCHITECTURE="$(uname -m)" - ;; - x86_64) - LIVE_IMAGE_ARCHITECTURE="amd64" - ;; - *) - if [ -e /lib64 ] - then - LIVE_IMAGE_ARCHITECTURE="amd64" - else - LIVE_IMAGE_ARCHITECTURE="i386" - fi - - Echo_warning "Can't determine architecture, assuming ${LIVE_IMAGE_ARCHITECTURE}" - ;; - esac - fi - fi - # Setting mirror to fetch packages from case "${LB_MODE}" in debian) @@ -1140,20 +1164,19 @@ Set_defaults () Check_defaults () { - if [ -n "${LIVE_CONFIGURATION_VERSION}" ] + if [ -n "${LIVE_BUILD_VERSION}" ] then # We're only checking when we're actually running the checks # that's why the check for emptyness of the version; - # however, as live-build always declares LIVE_CONFIGURATION_VERSION + # however, as live-build always declares LIVE_BUILD_VERSION # internally, this is safe assumption (no cases where it's unset, # except when bootstrapping the functions/defaults etc.). - CURRENT_CONFIGURATION_VERSION="$(Get_configuration config/control Configuration-Version)" - CURRENT_CONFIGURATION_VERSION="$(echo ${CURRENT_CONFIGURATION_VERSION} | awk -F. ' { print $1 }')" + CURRENT_CONFIGURATION_VERSION="$(echo ${LIVE_CONFIGURATION_VERSION} | awk -F. ' { print $1 }')" if [ -n "${CURRENT_CONFIGURATION_VERSION}" ] then - CORRECT_VERSION="$(echo ${LIVE_CONFIGURATION_VERSION} | awk -F. '{ print $1 }')" + CORRECT_VERSION="$(echo ${LIVE_BUILD_VERSION} | awk -F. '{ print $1 }')" TOO_NEW_VERSION="$((${CORRECT_VERSION} + 1))" TOO_OLD_VERSION="$((${CORRECT_VERSION} - 1))" |