One thought. From a quick test, it looks like I can mount a directory tmpfs over and over again, building up the list of mounts. So if there's some other reason the script can't execute in /run/qemu, every time the postinst runs, we'd mount over it again. So maybe we should additionally not mount if /run/qemu is already a mount point, based on findmnt?
So I suggest:
Testing if we can execute ("test the fact"), AND checking that /run/qemu isn't already mounted, to stop us doing it multiple times, and only then manually adding the mount.
One thought. From a quick test, it looks like I can mount a directory tmpfs over and over again, building up the list of mounts. So if there's some other reason the script can't execute in /run/qemu, every time the postinst runs, we'd mount over it again. So maybe we should additionally not mount if /run/qemu is already a mount point, based on findmnt?
So I suggest:
Testing if we can execute ("test the fact"), AND checking that /run/qemu isn't already mounted, to stop us doing it multiple times, and only then manually adding the mount.