diff options
Diffstat (limited to 'system/qemu-static')
36 files changed, 657 insertions, 0 deletions
diff --git a/system/qemu-static/README b/system/qemu-static/README new file mode 100644 index 0000000000..671b32adbe --- /dev/null +++ b/system/qemu-static/README @@ -0,0 +1,33 @@ +QEMU is a generic and open source machine emulator and virtualizer. + +This build is only for the user-mode static version of the binaries. + +The primary use-case is to run alien achitecture (aarch64) +docker containers on x86_64. + +This package installs all compatible qemu binfmt descriptions +into /usr/share/binfmts + +If you have installed (and activated in /etc/rc.d/) +the binfmt-support service, they will be loaded at machine start up. + +Then you should be able to run all compatible docker images through +qemu emulation transparently. + +/* +modprobe binfmt_misc +mount -t binfmt_misc none /proc/sys/fs/binfmt_misc +update-binfmts --import +update-binfmts --enable + +docker run --platform=linux/arm64 --rm -it \ +aclemons/slackware:current echo passed || echo failed + +*/ + +See also: + +https://ihlenfeldt.net/binfmt-misc/ +https://www.kernel.org/doc/Documentation/admin-guide/binfmt-misc.rst +https://twdev.blog/2024/01/docker_multi_platform/ + diff --git a/system/qemu-static/binfmts/qemu-aarch64 b/system/qemu-static/binfmts/qemu-aarch64 new file mode 100644 index 0000000000..f0a9c62db5 --- /dev/null +++ b/system/qemu-static/binfmts/qemu-aarch64 @@ -0,0 +1,7 @@ +package qemu-aarch64 +interpreter /usr/bin/qemu-aarch64-static +magic \x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7\x00 +mask \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff +credentials no +preserve no +fix_binary yes diff --git a/system/qemu-static/binfmts/qemu-aarch64_be b/system/qemu-static/binfmts/qemu-aarch64_be new file mode 100644 index 0000000000..71a27c2727 --- /dev/null +++ b/system/qemu-static/binfmts/qemu-aarch64_be @@ -0,0 +1,7 @@ +package qemu-aarch64_be +interpreter /usr/bin/qemu-aarch64_be-static +magic \x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7 +mask \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff +credentials no +preserve no +fix_binary yes diff --git a/system/qemu-static/binfmts/qemu-alpha b/system/qemu-static/binfmts/qemu-alpha new file mode 100644 index 0000000000..51075bfe49 --- /dev/null +++ b/system/qemu-static/binfmts/qemu-alpha @@ -0,0 +1,7 @@ +package qemu-alpha +interpreter /usr/bin/qemu-alpha-static +magic \x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x26\x90 +mask \xff\xff\xff\xff\xff\xfe\xfe\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff +credentials no +preserve no +fix_binary yes diff --git a/system/qemu-static/binfmts/qemu-arm b/system/qemu-static/binfmts/qemu-arm new file mode 100644 index 0000000000..37f0f6a5f6 --- /dev/null +++ b/system/qemu-static/binfmts/qemu-arm @@ -0,0 +1,7 @@ +package qemu-arm +interpreter /usr/bin/qemu-arm-static +magic \x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00 +mask \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff +credentials no +preserve no +fix_binary yes diff --git a/system/qemu-static/binfmts/qemu-armeb b/system/qemu-static/binfmts/qemu-armeb new file mode 100644 index 0000000000..b9b1793006 --- /dev/null +++ b/system/qemu-static/binfmts/qemu-armeb @@ -0,0 +1,7 @@ +package qemu-armeb +interpreter /usr/bin/qemu-armeb-static +magic \x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28 +mask \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff +credentials no +preserve no +fix_binary yes diff --git a/system/qemu-static/binfmts/qemu-hexagon b/system/qemu-static/binfmts/qemu-hexagon new file mode 100644 index 0000000000..9768bc2a10 --- /dev/null +++ b/system/qemu-static/binfmts/qemu-hexagon @@ -0,0 +1,7 @@ +package qemu-hexagon +interpreter /usr/bin/qemu-hexagon-static +magic \x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xa4\x00 +mask \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff +credentials no +preserve no +fix_binary yes diff --git a/system/qemu-static/binfmts/qemu-hppa b/system/qemu-static/binfmts/qemu-hppa new file mode 100644 index 0000000000..915c9c166e --- /dev/null +++ b/system/qemu-static/binfmts/qemu-hppa @@ -0,0 +1,7 @@ +package qemu-hppa +interpreter /usr/bin/qemu-hppa-static +magic \x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x0f +mask \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff +credentials no +preserve no +fix_binary yes diff --git a/system/qemu-static/binfmts/qemu-loongarch64 b/system/qemu-static/binfmts/qemu-loongarch64 new file mode 100644 index 0000000000..42c57584cd --- /dev/null +++ b/system/qemu-static/binfmts/qemu-loongarch64 @@ -0,0 +1,7 @@ +package qemu-loongarch64 +interpreter /usr/bin/qemu-loongarch64-static +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 +credentials no +preserve no +fix_binary yes diff --git a/system/qemu-static/binfmts/qemu-m68k b/system/qemu-static/binfmts/qemu-m68k new file mode 100644 index 0000000000..1c09ee3929 --- /dev/null +++ b/system/qemu-static/binfmts/qemu-m68k @@ -0,0 +1,7 @@ +package qemu-m68k +interpreter /usr/bin/qemu-m68k-static +magic \x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x04 +mask \xff\xff\xff\xff\xff\xff\xfe\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff +credentials no +preserve no +fix_binary yes diff --git a/system/qemu-static/binfmts/qemu-microblaze b/system/qemu-static/binfmts/qemu-microblaze new file mode 100644 index 0000000000..3125de463d --- /dev/null +++ b/system/qemu-static/binfmts/qemu-microblaze @@ -0,0 +1,7 @@ +package qemu-microblaze +interpreter /usr/bin/qemu-microblaze-static +magic \x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xba\xab +mask \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff +credentials no +preserve no +fix_binary yes diff --git a/system/qemu-static/binfmts/qemu-microblazeel b/system/qemu-static/binfmts/qemu-microblazeel new file mode 100644 index 0000000000..e7fb5ff19d --- /dev/null +++ b/system/qemu-static/binfmts/qemu-microblazeel @@ -0,0 +1,7 @@ +package qemu-microblazeel +interpreter /usr/bin/qemu-microblazeel-static +magic \x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xab\xba +mask \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff +credentials no +preserve no +fix_binary yes diff --git a/system/qemu-static/binfmts/qemu-mips b/system/qemu-static/binfmts/qemu-mips new file mode 100644 index 0000000000..f3f75aaca1 --- /dev/null +++ b/system/qemu-static/binfmts/qemu-mips @@ -0,0 +1,7 @@ +package qemu-mips +interpreter /usr/bin/qemu-mips-static +magic \x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 +mask \xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20 +credentials no +preserve no +fix_binary yes diff --git a/system/qemu-static/binfmts/qemu-mips64 b/system/qemu-static/binfmts/qemu-mips64 new file mode 100644 index 0000000000..62e2ebdb27 --- /dev/null +++ b/system/qemu-static/binfmts/qemu-mips64 @@ -0,0 +1,7 @@ +package qemu-mips64 +interpreter /usr/bin/qemu-mips64-static +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\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff +credentials no +preserve no +fix_binary yes diff --git a/system/qemu-static/binfmts/qemu-mips64el b/system/qemu-static/binfmts/qemu-mips64el new file mode 100644 index 0000000000..e748c79b71 --- /dev/null +++ b/system/qemu-static/binfmts/qemu-mips64el @@ -0,0 +1,7 @@ +package qemu-mips64el +interpreter /usr/bin/qemu-mips64el-static +magic \x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00 +mask \xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff +credentials no +preserve no +fix_binary yes diff --git a/system/qemu-static/binfmts/qemu-mipsel b/system/qemu-static/binfmts/qemu-mipsel new file mode 100644 index 0000000000..1e0d642090 --- /dev/null +++ b/system/qemu-static/binfmts/qemu-mipsel @@ -0,0 +1,7 @@ +package qemu-mipsel +interpreter /usr/bin/qemu-mipsel-static +magic \x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 +mask \xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00 +credentials no +preserve no +fix_binary yes diff --git a/system/qemu-static/binfmts/qemu-mipsn32 b/system/qemu-static/binfmts/qemu-mipsn32 new file mode 100644 index 0000000000..c3b8531ba4 --- /dev/null +++ b/system/qemu-static/binfmts/qemu-mipsn32 @@ -0,0 +1,7 @@ +package qemu-mipsn32 +interpreter /usr/bin/qemu-mipsn32-static +magic \x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20 +mask \xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20 +credentials no +preserve no +fix_binary yes diff --git a/system/qemu-static/binfmts/qemu-mipsn32el b/system/qemu-static/binfmts/qemu-mipsn32el new file mode 100644 index 0000000000..8b5a84c4a5 --- /dev/null +++ b/system/qemu-static/binfmts/qemu-mipsn32el @@ -0,0 +1,7 @@ +package qemu-mipsn32el +interpreter /usr/bin/qemu-mipsn32el-static +magic \x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00 +mask \xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00 +credentials no +preserve no +fix_binary yes diff --git a/system/qemu-static/binfmts/qemu-or1k b/system/qemu-static/binfmts/qemu-or1k new file mode 100644 index 0000000000..907ab0941a --- /dev/null +++ b/system/qemu-static/binfmts/qemu-or1k @@ -0,0 +1,7 @@ +package qemu-or1k +interpreter /usr/bin/qemu-or1k-static +magic \x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x5c +mask \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff +credentials no +preserve no +fix_binary yes diff --git a/system/qemu-static/binfmts/qemu-ppc b/system/qemu-static/binfmts/qemu-ppc new file mode 100644 index 0000000000..308a66a9d4 --- /dev/null +++ b/system/qemu-static/binfmts/qemu-ppc @@ -0,0 +1,7 @@ +package qemu-ppc +interpreter /usr/bin/qemu-ppc-static +magic \x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14 +mask \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff +credentials no +preserve no +fix_binary yes diff --git a/system/qemu-static/binfmts/qemu-ppc64 b/system/qemu-static/binfmts/qemu-ppc64 new file mode 100644 index 0000000000..824009ac7d --- /dev/null +++ b/system/qemu-static/binfmts/qemu-ppc64 @@ -0,0 +1,7 @@ +package qemu-ppc64 +interpreter /usr/bin/qemu-ppc64-static +magic \x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15 +mask \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff +credentials no +preserve no +fix_binary yes diff --git a/system/qemu-static/binfmts/qemu-ppc64le b/system/qemu-static/binfmts/qemu-ppc64le new file mode 100644 index 0000000000..797be74f41 --- /dev/null +++ b/system/qemu-static/binfmts/qemu-ppc64le @@ -0,0 +1,7 @@ +package qemu-ppc64le +interpreter /usr/bin/qemu-ppc64le-static +magic \x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15\x00 +mask \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\x00 +credentials no +preserve no +fix_binary yes diff --git a/system/qemu-static/binfmts/qemu-riscv32 b/system/qemu-static/binfmts/qemu-riscv32 new file mode 100644 index 0000000000..c410ef86e0 --- /dev/null +++ b/system/qemu-static/binfmts/qemu-riscv32 @@ -0,0 +1,7 @@ +package qemu-riscv32 +interpreter /usr/bin/qemu-riscv32-static +magic \x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xf3\x00 +mask \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff +credentials no +preserve no +fix_binary yes diff --git a/system/qemu-static/binfmts/qemu-riscv64 b/system/qemu-static/binfmts/qemu-riscv64 new file mode 100644 index 0000000000..afabab5453 --- /dev/null +++ b/system/qemu-static/binfmts/qemu-riscv64 @@ -0,0 +1,7 @@ +package qemu-riscv64 +interpreter /usr/bin/qemu-riscv64-static +magic \x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xf3\x00 +mask \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff +credentials no +preserve no +fix_binary yes diff --git a/system/qemu-static/binfmts/qemu-s390x b/system/qemu-static/binfmts/qemu-s390x new file mode 100644 index 0000000000..b4eda2b391 --- /dev/null +++ b/system/qemu-static/binfmts/qemu-s390x @@ -0,0 +1,7 @@ +package qemu-s390x +interpreter /usr/bin/qemu-s390x-static +magic \x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x16 +mask \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff +credentials no +preserve no +fix_binary yes diff --git a/system/qemu-static/binfmts/qemu-sh4 b/system/qemu-static/binfmts/qemu-sh4 new file mode 100644 index 0000000000..4d87525173 --- /dev/null +++ b/system/qemu-static/binfmts/qemu-sh4 @@ -0,0 +1,7 @@ +package qemu-sh4 +interpreter /usr/bin/qemu-sh4-static +magic \x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00 +mask \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff +credentials no +preserve no +fix_binary yes diff --git a/system/qemu-static/binfmts/qemu-sh4eb b/system/qemu-static/binfmts/qemu-sh4eb new file mode 100644 index 0000000000..8306838863 --- /dev/null +++ b/system/qemu-static/binfmts/qemu-sh4eb @@ -0,0 +1,7 @@ +package qemu-sh4eb +interpreter /usr/bin/qemu-sh4eb-static +magic \x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a +mask \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff +credentials no +preserve no +fix_binary yes diff --git a/system/qemu-static/binfmts/qemu-sparc b/system/qemu-static/binfmts/qemu-sparc new file mode 100644 index 0000000000..d14466f0d5 --- /dev/null +++ b/system/qemu-static/binfmts/qemu-sparc @@ -0,0 +1,7 @@ +package qemu-sparc +interpreter /usr/bin/qemu-sparc-static +magic \x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02 +mask \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff +credentials no +preserve no +fix_binary yes diff --git a/system/qemu-static/binfmts/qemu-sparc32plus b/system/qemu-static/binfmts/qemu-sparc32plus new file mode 100644 index 0000000000..15976ba50b --- /dev/null +++ b/system/qemu-static/binfmts/qemu-sparc32plus @@ -0,0 +1,7 @@ +package qemu-sparc32plus +interpreter /usr/bin/qemu-sparc32plus-static +magic \x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x12 +mask \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff +credentials no +preserve no +fix_binary yes diff --git a/system/qemu-static/binfmts/qemu-sparc64 b/system/qemu-static/binfmts/qemu-sparc64 new file mode 100644 index 0000000000..f439ceb91e --- /dev/null +++ b/system/qemu-static/binfmts/qemu-sparc64 @@ -0,0 +1,7 @@ +package qemu-sparc64 +interpreter /usr/bin/qemu-sparc64-static +magic \x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2b +mask \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff +credentials no +preserve no +fix_binary yes diff --git a/system/qemu-static/binfmts/qemu-xtensa b/system/qemu-static/binfmts/qemu-xtensa new file mode 100644 index 0000000000..697622e931 --- /dev/null +++ b/system/qemu-static/binfmts/qemu-xtensa @@ -0,0 +1,7 @@ +package qemu-xtensa +interpreter /usr/bin/qemu-xtensa-static +magic \x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x5e\x00 +mask \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff +credentials no +preserve no +fix_binary yes diff --git a/system/qemu-static/binfmts/qemu-xtensaeb b/system/qemu-static/binfmts/qemu-xtensaeb new file mode 100644 index 0000000000..d0540196f0 --- /dev/null +++ b/system/qemu-static/binfmts/qemu-xtensaeb @@ -0,0 +1,7 @@ +package qemu-xtensaeb +interpreter /usr/bin/qemu-xtensaeb-static +magic \x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x5e +mask \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff +credentials no +preserve no +fix_binary yes diff --git a/system/qemu-static/qemu-static.SlackBuild b/system/qemu-static/qemu-static.SlackBuild new file mode 100644 index 0000000000..260f7a318f --- /dev/null +++ b/system/qemu-static/qemu-static.SlackBuild @@ -0,0 +1,289 @@ +#!/bin/bash + +# Slackware build script for qemu + +# Copyright 2009, 2010 Andrew Brouwers <abrouwers@gmail.com> +# Copyright 2013-2024 Edward W. Koenig, Vancouver, USA <kingbeowulf@linuxgalaxy.org> +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=qemu-static +VERSION=${VERSION:-9.2.0} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +TARNAM=${PRGNAM%-static} + +PCRE_VERSION=8.45 +GLIB2_VERSION=2.70.5 +GLIBC_VERSION=2.33 + +KVMGROUP=${KVMGROUP:-users} +TARGETS=${TARGETS:-all} +VNC_ENABLE=${VNC_ENABLE:-yes} +AUDIODRIVERS=${AUDIODRIVERS:-pa,alsa,oss,sdl} +BRIDGE_HELPER_SETUID=${BRIDGE_HELPER_SETUID:-yes} +SLIRP=${SLIRP:-=yes} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" + KVMARCH="i386" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" + KVMARCH="i386" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" + KVMARCH="x86_64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP + +( + rm -rf $TMP/static-glibc + mkdir -p $TMP/static-glibc + rm -rf glibc-$GLIBC_VERSION + tar xvf $CWD/glibc-$GLIBC_VERSION.tar.*z* + cd glibc-$GLIBC_VERSION + patch -p1 < $CWD/staticpie.patch + + chown -R root:root . + find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} + -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} + || true + + export CC='ccache gcc' + export CXX='ccache g++' + unset LD_LIBRARY_PATH + mkdir build + cd build + CFLAGS="$SLKCFLAGS" \ + CXXFLAGS="$SLKCFLAGS" \ + ../configure \ + --enable-static-pie \ + --prefix=$TMP/static-glibc/ + + make V=1 + make install +) + +L_LIBFLAG_PCRE=-L$TMP/static-pcre/usr/local/lib/ +( + rm -rf $TMP/static-pcre + mkdir -p $TMP/static-pcre +rm -rf pcre-$PCRE_VERSION +tar xvf $CWD/pcre-$PCRE_VERSION.tar.*z* +cd pcre-$PCRE_VERSION +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} + -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} + || true + +export CC='ccache gcc' +export CXX='ccache g++' + +LD_LIBRARY_PATH="$TMP/static-glibc/tmp/glibc/lib/" \ +LIBRARY_PATH="$TMP/static-glibc/tmp/glibc/lib/" \ +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --enable-static \ + --disable-shared \ + --enable-utf8 \ + --enable-pcre16 \ + --enable-pcre32 \ + --enable-jit \ + --disable-cpp \ + --enable-unicode-properties + +make V=1 +make install DESTDIR=$TMP/static-pcre +) + + +L_LIBFLAG_GLIB2=-L$TMP/static-glib2/usr/local/lib$LIBDIRSUFFIX/ +( + # TODO: https://gist.github.com/greyltc/c379a37366454ae6f6732fb23a80194b +rm -rf glib-$GLIB2_VERSION +tar xvf $CWD/glib-$GLIB2_VERSION.tar.*z* +cd glib-$GLIB2_VERSION + +rm -rf $TMP/static-glib2 +mkdir -p $TMP/static-glib2 + +mkdir meson-build +cd meson-build + +LDFLAGS='-static-pie' \ +CFLAGS="$SLKCFLAGS -I$TMP/static-pcre/usr/local/include $TMP/static-glibc/lib/rcrt1.o " \ +CXXFLAGS="$SLKCFLAGS $TMP/static-glibc/lib/rcrt1.o " +meson setup \ + --default-library static \ + --buildtype=release \ + -Dselinux=disabled \ + -Dfam=false \ + -Dman=false \ + -Dgtk_doc=false \ + -Dtests=false \ + -Dinstalled_tests=false \ + .. || exit 1 + "${NINJA:=ninja}" $NUMJOBS || exit 1 + DESTDIR=$TMP/static-glib2 $NINJA install || exit 1 +) + +rm -rf $TARNAM-$VERSION +tar xvf $CWD/$TARNAM-$VERSION.tar.xz +cd $TARNAM-$VERSION +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} + -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} + || true + + +# Use newer meson from python3-meson-opt +PYVER=$(python3 -c 'import sys; print("%d.%d" % sys.version_info[:2])') +export PYTHONPATH=/opt/python$PYVER/site-packages + +sed -i "/subdir('tests/d" meson.build + +LIBRARY_PATH="$TMP/static-glibc/lib/" \ +CC='ccache gcc' \ +LDFLAGS="$SLKCFLAGS $L_LIBFLAG_GLIB2 $L_LIBFLAG_PCRE -L$TMP/static-glibc/lib" \ +./configure \ +--prefix=/usr \ +--libdir=/usr/lib${LIBDIRSUFFIX} \ +--sysconfdir=/etc \ +--includedir=/usr/include \ +--localstatedir=/var \ +--docdir=/usr/doc/$PRGNAM-$VERSION \ +--enable-kvm \ +--disable-debug-info \ +--enable-user \ +--static \ +--disable-numa \ +--disable-linux-io-uring \ +--enable-attr \ +--enable-linux-user \ +--enable-tcg \ +--disable-bpf \ +--disable-bsd-user \ +--disable-capstone \ +--disable-docs \ +--disable-fdt \ +--disable-gcrypt \ +--disable-glusterfs \ +--disable-gnutls \ +--disable-gtk \ +--disable-install-blobs \ +--disable-kvm \ +--disable-libiscsi \ +--disable-libnfs \ +--disable-libssh \ +--disable-linux-io-uring \ +--disable-nettle \ +--disable-opengl \ +--disable-qom-cast-debug \ +--disable-sdl \ +--disable-system \ +--disable-tools \ +--disable-tpm \ +--disable-vde \ +--disable-vhost-crypto \ +--disable-vhost-kernel \ +--disable-vhost-net \ +--disable-vhost-user \ +--disable-vnc \ +--disable-werror \ +--disable-xen \ +--disable-zstd \ +--enable-pie + +LIBRARY_PATH="$TMP/static-glibc/lib/" \ +make V=1 +make install DESTDIR=$PKG + +( + cd $PKG/usr/bin/ + for b in qemu-* ; do + mv $b $b-static + done +) + +mkdir -p $PKG/usr/share/binfmts/ +cp $CWD/binfmts/* $PKG/usr/share/binfmts/ +chown root:root $PKG/usr/share/binfmts/* + +rm -rf $PKG/var +rm -rf $PKG/usr/share/qemu + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +# Add docs to the proper location +rm -rf $PKG/usr/doc/$PRGNAM-$VERSION +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a COPYING* LICENSE \ + $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +cat > $PKG/usr/doc/$PRGNAM-$VERSION/README <<EOF +For actual documentation see /usr/doc/qemu-*/ +EOF + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/system/qemu-static/qemu-static.info b/system/qemu-static/qemu-static.info new file mode 100644 index 0000000000..ff19fb34f7 --- /dev/null +++ b/system/qemu-static/qemu-static.info @@ -0,0 +1,16 @@ +PRGNAM="qemu-static" +VERSION="9.2.0" +HOMEPAGE="https://www.qemu.org" +DOWNLOAD="UNSUPPORTED" +MD5SUM="" +DOWNLOAD_x86_64="https://download.qemu.org/qemu-9.2.0.tar.xz \ +https://ftp.exim.org/pub/pcre/pcre-8.45.tar.bz2 \ +https://download.gnome.org/sources/glib/2.70/glib-2.70.5.tar.xz \ +https://slackware.uk/slackware/slackware64-15.0/source/l/glibc/glibc-2.33.tar.xz" +MD5SUM_x86_64="ece615b98642720430236e20237dd936 \ +4452288e6a0eefb2ab11d36010a1eebb \ +c59d43d79902312311cb7e6a1f449035 \ +390bbd889c7e8e8a7041564cb6b27cca" +REQUIRES="device-tree-compiler python3-meson-opt qemu" +MAINTAINER="Lockywolf" +EMAIL="for_sbo.qemu-static_2025-07-13@lockywolf.net" diff --git a/system/qemu-static/slack-desc b/system/qemu-static/slack-desc new file mode 100644 index 0000000000..0bc6492ec5 --- /dev/null +++ b/system/qemu-static/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +qemu-static: qemu-static (open source processor emulator, static) +qemu-static: +qemu-static: QEMU-STATIC is a user-mode extenstion to QEMU as it is +qemu-static: available on SBo. +qemu-static: +qemu-static: Its primary use is to run arm and other alien containers +qemu-static: on x86_64 docker. +qemu-static: +qemu-static: +qemu-static: +qemu-static: diff --git a/system/qemu-static/staticpie.patch b/system/qemu-static/staticpie.patch new file mode 100644 index 0000000000..fc249c6716 --- /dev/null +++ b/system/qemu-static/staticpie.patch @@ -0,0 +1,83 @@ +diff --git a/sysdeps/x86_64/configure b/sysdeps/x86_64/configure +old mode 100644 +new mode 100755 +index 198554d788..75c96d60d4 +--- a/sysdeps/x86_64/configure ++++ b/sysdeps/x86_64/configure +@@ -107,39 +107,6 @@ if test x"$build_mathvec" = xnotset; then + build_mathvec=yes + fi + +-if test "$static_pie" = yes; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker static PIE support" >&5 +-$as_echo_n "checking for linker static PIE support... " >&6; } +-if ${libc_cv_ld_static_pie+:} false; then : +- $as_echo_n "(cached) " >&6 +-else +- cat > conftest.s <<\EOF +- .text +- .global _start +- .weak foo +-_start: +- leaq foo(%rip), %rax +-EOF +- libc_cv_pie_option="-Wl,-pie" +- if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -nostartfiles -nostdlib $no_ssp $libc_cv_pie_option -o conftest conftest.s 1>&5' +- { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 +- test $ac_status = 0; }; }; then +- libc_cv_ld_static_pie=yes +- else +- libc_cv_ld_static_pie=no +- fi +-rm -f conftest* +-fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_ld_static_pie" >&5 +-$as_echo "$libc_cv_ld_static_pie" >&6; } +- if test "$libc_cv_ld_static_pie" != yes; then +- as_fn_error $? "linker support for static PIE needed" "$LINENO" 5 +- fi +-fi +- + $as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h + + +diff --git a/sysdeps/x86_64/configure.ac b/sysdeps/x86_64/configure.ac +index ec776274af..66219e7ce5 100644 +--- a/sysdeps/x86_64/configure.ac ++++ b/sysdeps/x86_64/configure.ac +@@ -53,31 +53,6 @@ if test x"$build_mathvec" = xnotset; then + build_mathvec=yes + fi + +-dnl Check if linker supports static PIE with the fix for +-dnl +-dnl https://sourceware.org/bugzilla/show_bug.cgi?id=21782 +-dnl +-if test "$static_pie" = yes; then +- AC_CACHE_CHECK(for linker static PIE support, libc_cv_ld_static_pie, [dnl +-cat > conftest.s <<\EOF +- .text +- .global _start +- .weak foo +-_start: +- leaq foo(%rip), %rax +-EOF +- libc_cv_pie_option="-Wl,-pie" +- if AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -nostartfiles -nostdlib $no_ssp $libc_cv_pie_option -o conftest conftest.s 1>&AS_MESSAGE_LOG_FD); then +- libc_cv_ld_static_pie=yes +- else +- libc_cv_ld_static_pie=no +- fi +-rm -f conftest*]) +- if test "$libc_cv_ld_static_pie" != yes; then +- AC_MSG_ERROR([linker support for static PIE needed]) +- fi +-fi +- + dnl It is always possible to access static and hidden symbols in an + dnl position independent way. + AC_DEFINE(PI_STATIC_AND_HIDDEN) + |