summaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2012-12-19 12:04:36 +0100
committerDaniel Baumann <mail@daniel-baumann.ch>2013-05-06 14:50:03 +0200
commit8c0760a13af6f7856d7d8cc8b2459a9340ad9548 (patch)
tree52bd5063ffb8e10c9ab263809db5c7ba7861fcfb /functions
parent904824308aa5e8964b741b54e240f5d3b3467101 (diff)
downloadvyos-live-build-8c0760a13af6f7856d7d8cc8b2459a9340ad9548.tar.gz
vyos-live-build-8c0760a13af6f7856d7d8cc8b2459a9340ad9548.zip
Separate between configured values and runtime values in new configuration handling.
Diffstat (limited to 'functions')
-rwxr-xr-xfunctions/defaults.sh56
1 files changed, 27 insertions, 29 deletions
diff --git a/functions/defaults.sh b/functions/defaults.sh
index 59836c282..ff5e1a1fa 100755
--- a/functions/defaults.sh
+++ b/functions/defaults.sh
@@ -10,6 +10,8 @@
New_configuration ()
{
+ ## Configuration
+
# Configuration-Version
LIVE_CONFIGURATION_VERSION="$(Get_configuration config/control Configuration-Version)"
LIVE_CONFIGURATION_VERSION="${LIVE_CONFIGURATION_VERSION:-${LIVE_BUILD_VERSION}}"
@@ -19,42 +21,37 @@ New_configuration ()
#LIVE_IMAGE="$(Get_configuration config/control Image)"
#LIVE_IMAGE="${LIVE_IMAGE:-binary}"
- # Image Type
+ # Image: Architecture
+ LIVE_IMAGE_ARCHITECTURE="$(Get_configuration config/control Architecture)"
+ LIVE_IMAGE_ARCHITECTURE="${LIVE_IMAGE_ARCHITECTURE:-any}"
+ export LIVE_IMAGE_ARCHITECTURE
+
+ # 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)"
+ ## Runtime
- if [ -z "${LIVE_IMAGE_ARCHITECTURE}" ]
+ # Image: Architecture
+ if [ -x "/usr/bin/dpkg" ]
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
+ CURRENT_IMAGE_ARCHITECTURE="$(dpkg --print-architecture)"
+ else
+ case "$(uname -m)" in
+ x86_64)
+ CURRENT_IMAGE_ARCHITECTURE="amd64"
+ ;;
- Echo_warning "Can't determine architecture, assuming ${LIVE_IMAGE_ARCHITECTURE}"
- ;;
- esac
- fi
- fi
+ i?86)
+ CURRENT_IMAGE_ARCHITECTURE="i386"
+ ;;
- export LIVE_IMAGE_ARCHITECTURE
+ *)
+ Echo_warning "Unable to determine current architecture, using ${CURRENT_IMAGE_ARCHITECTURE}"
+ ;;
+ esac
+ fi
}
Set_defaults ()
@@ -312,8 +309,9 @@ Set_defaults ()
fi
fi
- if [ "${LIVE_IMAGE_ARCHITECTURE}" = "i386" ] && [ "$(uname -m)" = "x86_64" ]
+ if [ "${LIVE_IMAGE_ARCHITECTURE}" = "i386" ] && [ "${CURRENT_IMAGE_ARCHITECTURE}" = "amd64" ]
then
+ # Use linux32 when building amd64 images on i386
_LINUX32="linux32"
else
_LINUX32=""