Skip to content

Commit 755a8eb

Browse files
committed
include arch detect, used for compiled pkgs
1 parent 3c40561 commit 755a8eb

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

build/root/install.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,22 @@ unzip /tmp/scripts-master.zip -d /tmp
1515
# move shell scripts to /root
1616
mv /tmp/scripts-master/shell/arch/docker/*.sh /usr/local/bin/
1717

18+
# detect image arch
19+
####
20+
21+
OS_ARCH=$(cat /etc/os-release | grep -P -o -m 1 "(?=^ID\=).*" | grep -P -o -m 1 "[a-z]+$")
22+
if [[ ! -z "${OS_ARCH}" ]]; then
23+
if [[ "${OS_ARCH}" == "arch" ]]; then
24+
OS_ARCH="x86-64"
25+
else
26+
OS_ARCH="aarch64"
27+
fi
28+
echo "[info] OS_ARCH defined as '${OS_ARCH}'"
29+
else
30+
echo "[warn] Unable to identify OS_ARCH, defaulting to 'x86-64'"
31+
OS_ARCH="x86-64"
32+
fi
33+
1834
# pacman packages
1935
####
2036

0 commit comments

Comments
 (0)