55-dm.rules will disable cold plugged device mapper block devices. In
order for it not to disable them we need to keep the state from initrd
to main boot. That is we need to mark the devices as `persist_db` so
that initrd-udevadm-cleanup-db.service does not remove it.
When a device mapper device gets disabled, then all systemd mounts
with BindsTo to the device will get unmounted, as well as all bind
mounts that depend on it. Which causes a catastrophic failure of
Ubuntu Core.
As a work-around for this issue we have used a stateless reexecution
of systemd. This was making systemd forget about encrypted mount units
and thus did not trigger unmount when devices were taken down.
Now that we mark the device mapper devices as `persist_db`, this
work-around is not needed anymore.
Tested on:
- qemu x86_64 without secure boot
- qemu x86_64 with secure boot
- intel nuc with secure boot
- raspberry pi 4
The mounts in `/proc/mounts` are the same as before the fix, except
than now `systemd-mount --list` properly lists device mapper mounts.
This commit does not contain the removal of the stateless reexecutil
work around.
Two attempts were made to call create-efi on arm64 on focal before,
but focal lacks up to date systemd & backports to use llvm-objcopy and
thus create-efi simply fails on arm64 on focal.
Revert this change, and leave a comment to prevent re-enabling this a
3rd time.
Signed-off-by: Dimitri John Ledkov <email address hidden>