From f43f177cb04b74bdf95e17c2a010ed147f4535be Mon Sep 17 00:00:00 2001 From: Ian Davis Date: Thu, 6 Feb 2020 09:18:27 -0800 Subject: [PATCH] Adding script to configure binfmt.service for users. --- scripts/configure-binfmt.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 scripts/configure-binfmt.sh diff --git a/scripts/configure-binfmt.sh b/scripts/configure-binfmt.sh new file mode 100755 index 0000000..e10753c --- /dev/null +++ b/scripts/configure-binfmt.sh @@ -0,0 +1,11 @@ +#! /bin/bash + +if [ ! -f /lib/binfmt.d/qemu-aarch64-static.conf ]; then + sudo mkdir -p /lib/binfmt.d + + # Create a configuration for arm64v8 + sudo sh -c 'echo :qemu-aarch64:M::\\x7f\\x45\\x4c\\x46\\x02\\x01\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\xb7\\x00:\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xfe\\xff\\xff\\xff:/usr/bin/qemu-aarch64-static:F > /lib/binfmt.d/qemu-aarch64-static.conf' + + # Restart the service to force an evaluation of the /lib/binfmt.d directory + sudo systemctl restart systemd-binfmt.service +fi \ No newline at end of file