mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-01 21:13:09 +00:00
choose base image by arch instead of platform
This commit is contained in:
2
container-runtime/.gitignore
vendored
2
container-runtime/.gitignore
vendored
@@ -4,5 +4,5 @@ bundle.js
|
||||
startInit.js
|
||||
service/
|
||||
service.js
|
||||
alpine.squashfs
|
||||
*.squashfs
|
||||
/tmp
|
||||
@@ -9,10 +9,11 @@ VERSION=3.19
|
||||
ARCH=${ARCH:-$(uname -m)}
|
||||
FLAVOR=default
|
||||
|
||||
if [ "$ARCH" = "x86_64" ]; then
|
||||
ARCH=amd64
|
||||
elif [ "$ARCH" = "aarch64" ]; then
|
||||
ARCH=arm64
|
||||
_ARCH=$ARCH
|
||||
if [ "$_ARCH" = "x86_64" ]; then
|
||||
_ARCH=amd64
|
||||
elif [ "$_ARCH" = "aarch64" ]; then
|
||||
_ARCH=arm64
|
||||
fi
|
||||
|
||||
curl https://images.linuxcontainers.org/$(curl --silent https://images.linuxcontainers.org/meta/1.0/index-system | grep "^$DISTRO;$VERSION;$ARCH;$FLAVOR;" | head -n1 | sed 's/^.*;//g')/rootfs.squashfs --output alpine.squashfs
|
||||
curl https://images.linuxcontainers.org/$(curl --silent https://images.linuxcontainers.org/meta/1.0/index-system | grep "^$DISTRO;$VERSION;$_ARCH;$FLAVOR;" | head -n1 | sed 's/^.*;//g')/rootfs.squashfs --output alpine.${ARCH}.squashfs
|
||||
@@ -9,7 +9,7 @@ set -e
|
||||
if mountpoint tmp/combined; then sudo umount tmp/combined; fi
|
||||
if mountpoint tmp/lower; then sudo umount tmp/lower; fi
|
||||
mkdir -p tmp/lower tmp/upper tmp/work tmp/combined
|
||||
sudo mount alpine.squashfs tmp/lower
|
||||
sudo mount alpine.${ARCH}.squashfs tmp/lower
|
||||
sudo mount -t overlay -olowerdir=tmp/lower,upperdir=tmp/upper,workdir=tmp/work overlay tmp/combined
|
||||
|
||||
QEMU=
|
||||
@@ -33,9 +33,9 @@ fi
|
||||
|
||||
sudo truncate -s 0 tmp/combined/etc/resolv.conf
|
||||
sudo chown -R 0:0 tmp/combined
|
||||
rm -f ../build/lib/container-runtime/rootfs.squashfs
|
||||
rm -f rootfs.${ARCH}.squashfs
|
||||
mkdir -p ../build/lib/container-runtime
|
||||
sudo mksquashfs tmp/combined ../build/lib/container-runtime/rootfs.squashfs
|
||||
sudo mksquashfs tmp/combined rootfs.${ARCH}.squashfs
|
||||
sudo umount tmp/combined
|
||||
sudo umount tmp/lower
|
||||
sudo rm -rf tmp
|
||||
Reference in New Issue
Block a user