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.
This commit is contained in:
Minecrell 2020-01-20 11:36:14 +01:00 committed by Oliver Smith
parent d0376ee0fb
commit 44e887f11e
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 6 additions and 0 deletions

View File

@ -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 + "/*"):