udevadm_info should use maxsplit=1 instead of maxsplit=2
In udevadm_info the below code is called to split output lines:
key, value = line.split('=', 2)
It can lead to unhandled exception if there are more than one
equal sign in the string as split will return array of three
or more elements. The correct way to get only two elements is
to use maxsplit=1:
key, value = line.split('=', 1)
If a system has disks without any persistent indentifier (like serial)
then udev won't create any /dev/disk/by-id symlinks. This can happen
in VMs which do not provide serial numbers by default (e.g. virtio).
If /dev/disk/by-id did not exist then os.listdir on that path would
raise a FileNotFoundException and prevented disk_to_byid_path from
returning None (or the correct path).
This is fixed by checking if the target prefix exists and if not
return an empty dict.
UEFI: Handle missing BootCurrent entry when reordering UEFI entries
Curtin typically reorders UEFI boot entries to place the currently
booted entry at the front of the list after install. In some cases a
system UEFI may not present a BootCurrent entry and curtin will not
perform any reordering leaving a node to boot from the newly
installed entry. For MAAS deployments, this causes issues as MAAS
expects to retain control over the node via PXE booting.
Curtin will attempt to reorder the boot menu when BootCurrent is
missing (or when forced via curtin config option) by placing all
network boot entries first followed by the entry curtin installed
and appending all other entries afterward. The feature,
UEFI_REORDER_FALLBACK_SUPPORT, is enabled by default. Users may
disable both reordering and fallback support.
- unittest/helpers.py: Add with_logs support for CiTestCase
- docs: document grub: reorder_uefi and grub:
reorder_uefi_force_fallback config options.
curthooks: uefi_find_grub_device_ids handle type:mount without path
When scanning a curtin storage config for efi mount entries we failed
to handle the case where an entry does not contain the 'path' key.
Curtin storage config type:mount does not require a 'path' element.
Change to using .get('path') when looking for efi mount path.
netplan's openvswitch yaml format has changed and now openvswitch
is not a top-level type but a subkey under various top-level keys.
This change will allow for top-level or subkey matching and retains
the check on renderer type (whether netplan supports that for
openvswitch or not; it's used for NetworkManager, networkd).
tools/curtainer: do not wait for snapd.seeded.service
The curtainer tool is used in CI and other places to extract a certain
curtin source from the archive and then is used to pack/unpack the
curtin code in the correct environment. We have no need or use of
snapd in this container which currently blocks for longer than
curtainer waits for the system to boot due to waiting for snaps to
download and install.
tools/curtainer: enable using ubuntu-minimal images
Ubuntu Minimal images are much smaller and run fewer things at
boot so they're ideal for the curtainer bootstrap environment for
extracting curtin source. The minimal image does not have the
'add-apt-repository' command present so write out the daily ppa
source list file and import the PPA gpg key into apt.