From 44e887f11efbf33c8b60cb0a710a471e747f32a4 Mon Sep 17 00:00:00 2001 From: Minecrell Date: Mon, 20 Jan 2020 11:36:14 +0100 Subject: [PATCH] pmb.install: remove qemu-user binary stub from device rootfs (!1861) Now that the qemu-user binary is bind-mounted, we no longer copy the binary to the device rootfs. However, there is still the empty stub file that we used as a destination mount point. Let's remove it before copying it to the device rootfs. It is automatically re-created the next time the qemu-user binary is needed. --- pmb/install/_install.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pmb/install/_install.py b/pmb/install/_install.py index fd38b583..ceb0c292 100644 --- a/pmb/install/_install.py +++ b/pmb/install/_install.py @@ -127,6 +127,12 @@ def copy_files_from_chroot(args): mountpoint = mount_device_rootfs(args) mountpoint_outside = args.work + "/chroot_native" + mountpoint + # Remove empty qemu-user binary stub (where the binary was bind-mounted) + arch_qemu = pmb.parse.arch.alpine_to_qemu(args.deviceinfo["arch"]) + qemu_binary = mountpoint_outside + "/usr/bin/qemu-" + arch_qemu + "-static" + if os.path.exists(qemu_binary): + pmb.helpers.run.root(args, ["rm", qemu_binary]) + # Get all folders inside the device rootfs (except for home) folders = [] for path in glob.glob(mountpoint_outside + "/*"):