summaryrefslogtreecommitdiff
path: root/functions/architecture.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2009-11-22 14:36:42 +0100
committerDaniel Baumann <daniel@debian.org>2009-11-22 14:38:00 +0100
commita62f12110b19a52a58d7eae871012202cfa16055 (patch)
tree0bd188079c808ee8956fb5304c46ce8266b49f75 /functions/architecture.sh
downloadvyos-live-build-a62f12110b19a52a58d7eae871012202cfa16055.tar.gz
vyos-live-build-a62f12110b19a52a58d7eae871012202cfa16055.zip
Renaming categories to archive areas (Closes: #519690).
Diffstat (limited to 'functions/architecture.sh')
-rwxr-xr-xfunctions/architecture.sh92
1 files changed, 92 insertions, 0 deletions
diff --git a/functions/architecture.sh b/functions/architecture.sh
new file mode 100755
index 000000000..278ec6a6f
--- /dev/null
+++ b/functions/architecture.sh
@@ -0,0 +1,92 @@
+#!/bin/sh
+
+# architecture.sh - handle architecture specific support
+# Copyright (C) 2006-2009 Daniel Baumann <daniel@debian.org>
+#
+# live-helper comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
+# This is free software, and you are welcome to redistribute it
+# under certain conditions; see COPYING for details.
+
+Check_architecture ()
+{
+ ARCHITECTURES="${@}"
+ VALID="false"
+
+ for ARCHITECTURE in ${ARCHITECTURES}
+ do
+ if [ "$(echo ${LH_ARCHITECTURE} | grep ${ARCHITECTURE})" ]
+ then
+ VALID="true"
+ break
+ fi
+ done
+
+ if [ "${VALID}" = "false" ]
+ then
+ Echo_warning "skipping %s, foreign architecture." "${0}"
+ exit 0
+ fi
+}
+
+Check_crossarchitecture ()
+{
+ if [ -x /usr/bin/dpkg ]
+ then
+ HOST="$(dpkg --print-architecture)"
+ else
+ HOST="$(uname -m)"
+ fi
+
+ case "${HOST}" in
+ amd64|i386|lpia|x86_64)
+ CROSS="amd64 i386 lpia"
+ ;;
+
+ powerpc|ppc64)
+ CROSS="powerpc ppc64"
+ ;;
+
+ *)
+ CROSS="${HOST}"
+ ;;
+ esac
+
+ Check_architecture "${CROSS}"
+}
+
+Check_multiarchitecture ()
+{
+ if [ "$(echo ${LH_ARCHITECTURE} | wc -w)" -gt "1" ]
+ then
+ # First, only support multiarch on iso
+ if [ "${LH_BINARY_IMAGES}" = "iso" ]
+ then
+ # Assemble multi-arch
+ case "${LH_CURRENT_ARCHITECTURE}" in
+ amd64)
+ DESTDIR="${DESTDIR}.amd"
+ DESTDIR_LIVE="${DESTDIR_LIVE}.amd"
+ DESTDIR_INSTALL="${DESTDIR_INSTALL}.amd"
+ ;;
+
+ i386)
+ DESTDIR="${DESTDIR}.386"
+ DESTDIR_LIVE="${DESTDIR_LIVE}.386"
+ DESTDIR_INSTALL="${DESTDIR_INSTALL}.386"
+ ;;
+
+ lpia)
+ DESTDIR="${DESTDIR}.lpi"
+ DESTDIR_LIVE="${DESTDIR_LIVE}.lpi"
+ DESTDIR_INSTALL="${DESTDIR_INSTALL}.lpi"
+ ;;
+
+ powerpc)
+ DESTDIR="${DESTDIR}.ppc"
+ DESTDIR_LIVE="${DESTDIR_LIVE}.ppc"
+ DESTDIR_INSTALL="${DESTDIR_INSTALL}.ppc"
+ ;;
+ esac
+ fi
+ fi
+}