diff options
author | David P <megver83@parabola.nu> | 2022-05-29 19:46:00 -0400 |
---|---|---|
committer | David P <megver83@parabola.nu> | 2022-05-29 19:46:00 -0400 |
commit | 13d41a2a2f829a80f9d377f9a01e466212ed46c8 (patch) | |
tree | 00ac9a27d923aaf2b65b4040c8bc9dbf5407493c | |
parent | 85eca122a2d5fd77c19cc981d334e0b1f239c45d (diff) |
manually register qemu-arm-static if it is not already
Signed-off-by: David P <megver83@parabola.nu>
-rwxr-xr-x | parabolaiso/mkparabolaiso | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/parabolaiso/mkparabolaiso b/parabolaiso/mkparabolaiso index 5af1851..71d5c41 100755 --- a/parabolaiso/mkparabolaiso +++ b/parabolaiso/mkparabolaiso @@ -362,6 +362,14 @@ _make_packages() { # Install the qemu-arm-static binary if [[ "${arch}" == "armv7h" ]] && ! setarch armv7l /bin/true 2>/dev/null; then + # Make sure that qemu-static is set up with binfmt_misc + if [[ -z $(grep -l -xF \ + -e "interpreter /usr/bin/qemu-arm-static" \ + -r -- /proc/sys/fs/binfmt_misc 2> /dev/null \ + | xargs -r grep -xF 'enabled') ]]; then + # Register the qemu-arm-static as an ARM interpreter in the kernel (using binfmt_misc kernel module) + echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:' > /proc/sys/fs/binfmt_misc/register + fi install -d -m 0755 -- "${pacstrap_dir}/usr/bin" install -m 0755 -- /usr/bin/qemu-arm-static "${pacstrap_dir}/usr/bin" fi @@ -943,14 +951,6 @@ _validate_requirements_buildmode_bootstrap() { fi if [[ "${arch}" == "armv7h" ]] && ! setarch armv7l /bin/true &> /dev/null; then - # Make sure that qemu-static is set up with binfmt_misc - if [[ -z $(grep -l -xF \ - -e "interpreter /usr/bin/qemu-arm-static" \ - -r -- /proc/sys/fs/binfmt_misc 2> /dev/null \ - | xargs -r grep -xF 'enabled') ]]; then - (( validation_error=validation_error+1 )) - _msg_error "Validating build mode '${_buildmode}': binfmt_misc entry for qemu-arm-static is not available. Install 'qemu-user-static-binfmt'!" 0 - fi if ! command -v qemu-arm-static &> /dev/null; then (( validation_error=validation_error+1 )) _msg_error "Validating build mode '${_buildmode}': qemu-arm-static is not available on this host. Install 'qemu-user-static'!" 0 |