Skip to content

Commit

Permalink
Merge pull request #151 from yzewei/master
Browse files Browse the repository at this point in the history
add support for loongarch64
  • Loading branch information
tonistiigi authored Feb 9, 2024
2 parents 1e4d1fb + b94a306 commit 51a64e6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,14 @@ jobs:
name: Test mainline
if: matrix.target == 'mainline'
run: |
docker run --rm --privileged tonistiigi/binfmt:test --uninstall amd64,arm64,arm,ppc64le,s390x,riscv64
docker run --rm --privileged tonistiigi/binfmt:test --uninstall amd64,arm64,arm,ppc64le,s390x,riscv64,loongarch64
docker run --rm --privileged tonistiigi/binfmt:test --install all
docker run --rm arm64v8/alpine uname -a
docker run --rm arm32v7/alpine uname -a
docker run --rm ppc64le/alpine uname -a
docker run --rm s390x/alpine uname -a
docker run --rm tonistiigi/debian:riscv uname -a
docker run --rm yangzewei2023/debian:loongarch64 uname -a
docker run --rm --platform=linux/s390x s390x/ubuntu apt update
docker run --rm --platform=linux/ppc64le ppc64le/ubuntu apt update
docker run --rm --platform=linux/arm64 arm64v8/ubuntu apt update
Expand Down
5 changes: 5 additions & 0 deletions cmd/binfmt/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ var configs = map[string]config{
magic: `\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08`,
mask: `\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff`,
},
"loongarch64": {
binary: "qemu-loongarch64",
magic: `\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02\x01`,
mask: `\xff\xff\xff\xff\xff\xff\xff\xfc\x00\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff`,
},
}

func allArch() []string {
Expand Down
3 changes: 3 additions & 0 deletions scripts/configure_qemu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ if [ -z "$QEMU_TARGETS" ]; then
if [ "$arch" != "mips64" ] ; then
QEMU_TARGETS="$QEMU_TARGETS mips64-linux-user"
fi
if [ "$arch" != "loong64" ] ; then
QEMU_TARGETS="$QEMU_TARGETS loongarch64-linux-user"
fi
fi

set -x
Expand Down

0 comments on commit 51a64e6

Please sign in to comment.