Skip to content

Commit

Permalink
entrypoint: setup binfmt_misc handling for cross building
Browse files Browse the repository at this point in the history
  • Loading branch information
mvo5 committed Jan 30, 2024
1 parent 9f8639a commit 8c39f48
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
#!/bin/bash
set -euo pipefail

if mount -t binfmt_misc none /proc/sys/fs/binfmt_misc; then
case "$(uname -m)" in
"x86_64")
if [ ! -e /proc/sys/fs/binfmt_misc/qemu-aarch64 ]; then
cat /usr/lib/binfmt.d/qemu-aarch64-static.conf > /proc/sys/fs/binfmt_misc/register
fi
;;
"aarch64")
if [ ! -e /proc/sys/fs/binfmt_misc/qemu-x86_64 ]; then
cat /usr/lib/binfmt.d/qemu-x86_64-static.conf > /proc/sys/fs/binfmt_misc/register
fi
esac
else
echo "WARN: cannot setup binfmt_misc handling"
fi


/usr/bin/bootc-image-builder build --store /store --rpmmd /rpmmd --output /output "$@"

0 comments on commit 8c39f48

Please sign in to comment.