summaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorChris Lamb <chris@chris-lamb.co.uk>2008-08-31 23:46:38 +0100
committerDaniel Baumann <daniel@debian.org>2011-03-09 19:03:40 +0100
commit5a4b8ca4f9c00d3329d62edc390ce34cf2d9cd5a (patch)
tree5f780956633048a797224959cb6e8aea7c20d64a /functions
parent2cf18ef7f3244b3b2bf57cf96b9a39bc812870dd (diff)
downloadvyos-live-build-5a4b8ca4f9c00d3329d62edc390ce34cf2d9cd5a.tar.gz
vyos-live-build-5a4b8ca4f9c00d3329d62edc390ce34cf2d9cd5a.zip
Improve architecture auto-detection.
Diffstat (limited to 'functions')
-rwxr-xr-xfunctions/defaults.sh14
1 files changed, 12 insertions, 2 deletions
diff --git a/functions/defaults.sh b/functions/defaults.sh
index 791cf3c95..ba3d944b2 100755
--- a/functions/defaults.sh
+++ b/functions/defaults.sh
@@ -237,8 +237,18 @@ Set_defaults ()
then
LH_ARCHITECTURE="$(dpkg --print-architecture)"
else
- Echo_warning "Can't process file /usr/bin/dpkg, setting architecture to i386"
- LH_ARCHITECTURE="i386"
+ case "$(uname -m)" in
+ sparc|powerpc)
+ LH_ARCHITECTURE="$(uname -m)"
+ ;;
+ x86_64)
+ LH_ARCHITECTURE="amd64"
+ ;;
+ *)
+ Echo_warning "Can't determine architecture, assuming i386"
+ LH_ARCHITECTURE="i386"
+ ;;
+ esac
fi
fi