Files
repertory/run_arm64_shell.sh
Scott E. Graves 3ff46723b8
Some checks failed
BlockStorage/repertory_osx/pipeline/head There was a failure building this commit
BlockStorage/repertory_windows/pipeline/head This commit looks good
BlockStorage/repertory_linux_builds/pipeline/head This commit looks good
initial commit
2022-03-05 00:30:50 -06:00

25 lines
761 B
Bash
Executable File

#!/bin/bash
NAME=$1
if [ -z "$NAME" ]; then
echo "Name not set"
elif [ "$UID" != 0 ]; then
echo "Must be run as root"
exit 1
else
DISTROPART=$NAME
DISTRONAME=arm64_${DISTROPART}
ARM64_DIR="./${DISTRONAME}"
mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc
echo -1 > /proc/sys/fs/binfmt_misc/qemu-aarch64 || true
echo ':qemu-aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-aarch64-static:OCF' > /proc/sys/fs/binfmt_misc/register
if mount -o bind "$(pwd)" "${ARM64_DIR}/mnt"; then
systemd-nspawn -D "${ARM64_DIR}"
umount "${ARM64_DIR}/mnt"
else
echo "Mount failed: ${DISTRONAME}"
fi
fi