Since systemd 256~rc3-3, /tmp is mounted as tmpfs by default. This
breaks our tests because /tmp is mounted with nodev which makes it
impossible for debootstrap to mknod.
This emulates what unshare(1) does by default or by passing
--propagation=private explicitly. Mounting and unmounting filesystems
will affect mounts outside the namespace which are marked as shared (see
last column of `findmnt -o+PROPAGATION`). Since mmdebstrap's goal is to
isolate the mounts in the new namespace, we perform the equivalent of
mount(NULL, "/", MS_REC | MS_PRIVATE, NULL);
from util-linux/sys-utils/unshare.c:set_propagation() which is in shell:
mount --make-rprivate /
See mount_namespaces(7) for details. Without setting this, unmounting
/sys (and its sub-mounts) in unshare mode as root user will also unmount
the sub-mounts of /sys on the outside of the namespace. This breaks
tests/unshare-as-root-user which will fail to shut down with the following
errors in the log:
[FAILED] Failed unmounting mnt.mount - /mnt.
[FAILED] Failed unmounting run-lock.mount - Legacy Locks Directory /run/lock.
[...]
[ OK ] Reached target poweroff.target - System Power Off.
Afterwards it will stall indefinitely. Stopping mmdebstrap from messing
with the /sys mounts on the outside stops this behaviour and allows to
cleanly shut down the virtual machine.
Thanks: Helmut Grohne
Otherwise it fails with:
umount: /tmp/mmdebstrap.Tw9G7ZLL4J/mnt: filesystem was unmounted, but failed to update userspace mount table.
E: setup failed: E: command failed: umount --lazy "$1/mnt"
Also umount mnt/dev.
- explicitly instruct to add --boot=efi to autopkgtest-virt-qemu
- add example how to run autopkgtest with --boot=efi
- document image location requirements giving unshare restrictions
- check if foreign arch is configured
- instruct how to add a foreign architecture
- check that the unshared user is able to access the image location
- suggest to install qemu-system-* packages if they are missing
- suggest to install packages containing EDK II OVMF UEFI firmware