Skip to content

Commit

Permalink
include arch detect, used for compiled pkgs
Browse files Browse the repository at this point in the history
  • Loading branch information
binhex committed May 2, 2020
1 parent 26f3ea6 commit 54db3d1
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions build/root/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,22 @@ unzip /tmp/scripts-master.zip -d /tmp
# move shell scripts to /root
mv /tmp/scripts-master/shell/arch/docker/*.sh /usr/local/bin/

# detect image arch
####

OS_ARCH=$(cat /etc/os-release | grep -P -o -m 1 "(?=^ID\=).*" | grep -P -o -m 1 "[a-z]+$")
if [[ ! -z "${OS_ARCH}" ]]; then
if [[ "${OS_ARCH}" == "arch" ]]; then
OS_ARCH="x86-64"
else
OS_ARCH="aarch64"
fi
echo "[info] OS_ARCH defined as '${OS_ARCH}'"
else
echo "[warn] Unable to identify OS_ARCH, defaulting to 'x86-64'"
OS_ARCH="x86-64"
fi

# pacman packages
####

Expand Down

0 comments on commit 54db3d1

Please sign in to comment.