multipath: attempt to enforce /dev/mapper/mpath files are symlinks
Multipath device scanning and bring up variablity may result in
the creation if /dev/mapper/mpath* files that are block devices
instead of a symlink to the device mapper device (/dev/dm-0).
When these block files are present, this breaks assumptions in
curtin used to look up details in sysfs for a mapper device.
block-meta: device mapper partitions may be block devices not links
In some cases the multipath library may create a block device which
is not a symbolic link to the device-mapper dev[1]. Curtin expects the
symlink. Remove the non-symlink file and allow kpartx to create it.
Default to dm_name being id if empty earlier in dm_crypt_handler()
In other parts of the code, when deciding the path for dmcrypt_dev,
we default to 'id' when 'dm_name' is not defined. We ideally want
that to happen in all the cases. The defaulting has been there
already but a bit too late.
Curtin extracts the devices from storage config with wipe enabled.
These devices may not exist yet (curtin will be creating them) so
there's no need to clear them, instead drop them from the list of
devices to send to clear-holders.
Other changes:
multipath:
- Clarify multipath logging on device type checking
block-meta:
- Stop iterating through disk lookup keys after we find one
- Use udevadm_settle after parted partition creation before
calling kpartx to prevent race with kernel partition update
clear-holders:
- Log the inputs to clear-holders
block:
- Log a warning when sys_block_path is called on a non-existent
device path.
- Log the return value from block.lookup_disk()
curthooks: support multiple ESP on UEFI bootable systems
On debian systems we generate and set debconf selections values
to tell grub the set of configured devices. Also refactor
setup_grub to extract all UEFI boot partitions and determine
the primary ESP (mounted at /boot/efi). We include all ESPs
in the debconf selection for grub-[multi]-install to use.
The grub-efi/install_devices is a new template value used for
handling multiple ESP partitions for boot resilience.
Curtin will check for the grub-multi-install tool and if
present will invoke that tool to install grub to all ESPs.
- Add block.schema update to allow partitions to set
grub_device: True
- Refactor finding ESPs to prefer partition with grub_device,
ESPs on disks with grub_device and fallback to grubcfg
install_devices if we don't find one in storage config.