From a7a20d50d34872d35968b6d9126972e5a7e2287a Mon Sep 17 00:00:00 2001 From: Renato Aguiar Date: Thu, 20 Feb 2020 05:54:13 -0800 Subject: [PATCH] Fix execution of post install scripts on cross builds Add missing call to register_binfmt before installing packages on mkrootfs. --- lib.sh.in | 2 +- mkrootfs.sh.in | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib.sh.in b/lib.sh.in index 29471d6..55cb73b 100644 --- a/lib.sh.in +++ b/lib.sh.in @@ -242,7 +242,7 @@ register_binfmt() { # use the static one always and make sure it shows up at the same # place in the host and the chroot. if [ ! -x "$ROOTFS/usr/bin/$QEMU_BIN" ] ; then - cp -f "$(which "$QEMU_BIN")" "$ROOTFS/usr/bin" || + install -m755 -D "$(which "$QEMU_BIN")" "$ROOTFS/usr/bin/$QEMU_BIN" || die "Could not install $QEMU_BIN to $ROOTFS/usr/bin/" fi } diff --git a/mkrootfs.sh.in b/mkrootfs.sh.in index 93b9f94..8353a94 100644 --- a/mkrootfs.sh.in +++ b/mkrootfs.sh.in @@ -136,8 +136,10 @@ run_cmd_target "xbps-install -S $XBPS_CONFFILE $XBPS_CACHEDIR $XBPS_REPOSITORY - # so we set this here. chmod 755 "$ROOTFS" -# The pseudofs mountpoints are needed for the qemu support in cases -# where we are running things that aren't natively executable. +# The binfmt setup and pseudofs mountpoints are needed for the qemu +# support in cases where we are running things that aren't natively +# executable. +register_binfmt mount_pseudofs # With everything setup, we can now run the install to load the