curthooks: always use ChrootableTarget.subp when calling efibootmgr
There was a bug recently introduced when adding the feature to remove
duplicate UEFI boot entries which removed use of ChrootableTarget
subp method. The assumption was that util.subp calls would also get
the target parameter set but this was not the case. The ephemeral
environment does not usually have efibootmgr package installed but
we ensure that it is present in the target system. This branch
replaces calls to util.subp with the ChrootableTarget subp method.
storage: enable and use multipath during storage configuration
Curtin has attempted to avoid using multipath enabled during installation
as that requires reworking a number of areas with in curtin that use Linux
tooling which is not multipath friendly. In particular, partitions on
multipath devices appear as disk not as partitions and this makes programs
confused. However, some scenarios just cannot be handled sanely without
multipath devices enabled. One such scenario is creating an LVM root on
top of multipath devices. This branch adds a vmtest scenario to recreate
this deployment configuration. To resolve the issue curtin will now keep
multipath enabled if available and adjust partition handling to make use
of 'kpartx' and 'dmsetup' to create, manipulate and calculate partition
related information. There was quite a bit of fallout with this change
so this branch includes a large amount of changes to handle this all the
way back to Xenial. Xenial and Bionic do not enable multipath by default,
and curtin does not enable multipath in the ephemeral environment, rather
if multipath is presnet in the ephemeral environment then curtin will
make use of it.
Additional changes needed/used to resolve this issue:
- Add --shutdown-plan to curtin clear-holders CLI tool for dumping the
clear-holders plan of action for a given storage configuration.
- Add --probe-data to curtin block-discover CLI to dump the probert probe
data out to a file and skip converting to a storage config.
- clear-holders will reload multipath maps to ensure mp is active.
- Add use of --filter to lvm commands to only use mpath devices if mp is
enabled.
- curthooks now modifies target /etc/lvm.conf with a devices filter if mp
is enabled.
- Fix dname for mpath devices, using dm-uuid and handling the oddity that
multipath partitions prefix their dm-uuid with part-X-.
- If multipath enabled, don't hard code root devices to mpath0
NVME "multipath" devices are a virtual subsystem inside the kernel
that has nothing to do with traditional multipath. The kernel nvme
driver jumps through hoops to hide a controller node and pretend that
it is a block device when it is emphatically _not_. It's not suprising
that this breaks lots of things.
These phony block devices do present a virtual NVME block device and
curtin block-discover ignores composed virtual devices when
constructing storage-config 'type: disk' devices. We must include such
devices as 'type: disk'.
This patch narrows our filter to exclude any DEVPATH which is
/devices/virtual/block and NVME mp devices use
/devices/virtual/nvme-subsystem.
DASD devices have a 'vtoc' partition table type. When we're handling
a disk config with 'preserve': True we raised a ValueError expecting
either 'gpt' or 'msdos'. Fix this by refactoring the code to check
the expected ptable value and adding a check_vtoc_signature method.