Allow riscv64 image to run without binfmt_misc

This commit is contained in:
Vidar Holen
2024-06-11 06:00:22 +00:00
parent 15de97e33f
commit 23e76de4f2
3 changed files with 126 additions and 21 deletions

View File

@@ -1,15 +1,19 @@
#!/bin/sh
set -xe
IFS=';'
{
tar xzv --strip-components=1
chmod +x striptests && ./striptests
# Use a freeze file to ensure we use the same dependencies we cached during
# the docker image build. We don't want to spend time compiling anything new.
cp /etc/cabal.project.freeze .
mkdir "$TARGETNAME"
cabal update
( IFS=';'; cabal build --enable-executable-static )
# Retry in case of random segfault
cabal build --enable-executable-static || cabal build --enable-executable-static
find . -name shellcheck -type f -exec mv {} "$TARGETNAME/" \;
ls -l "$TARGETNAME"
"$TARGET-strip" -s "$TARGETNAME/shellcheck"
ls -l "$TARGETNAME"
qemu-riscv64-static "$TARGETNAME/shellcheck" --version
"$TARGETNAME/shellcheck" --version
} >&2
tar czv "$TARGETNAME"