From ffadd7c2099a8ebb9afcd26594136f7a435775da Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Fri, 13 Apr 2018 20:47:58 +0200 Subject: Add arch parameter to build.sh --- build.sh | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/build.sh b/build.sh index 800e410..6d2dcc4 100755 --- a/build.sh +++ b/build.sh @@ -2,20 +2,21 @@ set -e -arch=x86 -subarch=64 +arch_lxd=x86_64 ver=17.01.4 dist=lede usage() { - echo "Usage: $0 [-v|--version ] [-p|--packages ] [-f|--files] [--help]" + echo "Usage: $0 [-a|--arch ] [-v|--version ] [-p|--packages ] [-f|--files] [--help]" exit 1 } -temp=$(getopt -o "v:p:f:" -l "version:,packages:,files:,help" -- "$@") +temp=$(getopt -o "a:v:p:f:" -l "arch:,version:,packages:,files:,help" -- "$@") eval set -- "$temp" while true; do case "$1" in + -a|--arch) + arch_lxd="$2"; shift 2;; -v|--version) ver="$2"; shift 2 if test ver=snapshot; then @@ -38,6 +39,20 @@ if [ $# -ne 0 ]; then usage fi +case "$arch_lxd" in + i686) + arch=x86 + subarch=generic + ;; + x86_64) + arch=x86 + subarch=64 + ;; + *) + usage + ;; +esac + procd_url=https://github.com/openwrt/openwrt/branches/lede-17.01/package/system/procd procd_extra_ver=lxd-3 @@ -166,12 +181,6 @@ build_metadata() { local date="`date -d \"@${stat}\" +%F`" local desc="$(tar xf $rootfs ./etc/openwrt_release -O|grep DISTRIB_DESCRIPTION|sed -e "s/.*='\(.*\)'/\1/")" - if test ${subarch} = generic; then - local arch_lxd=${arch} - else - local arch_lxd=${arch}_${subarch} - fi - cat > $metadata <