~raharper/curtin:fix/uefi-remove-dups-v2

Last commit made on 2020-09-09
Get this branch:
git clone -b fix/uefi-remove-dups-v2 https://git.launchpad.net/~raharper/curtin
Only Ryan Harper can upload to this branch. If you are Ryan Harper please log in for upload directions.

Branch merges

Branch information

Name:
fix/uefi-remove-dups-v2
Repository:
lp:~raharper/curtin

Recent commits

d28422d... by Ryan Harper on 2020-09-09

Add unittest for missing BootCurrent value when removing duplicates

800cd78... by Ryan Harper on 2020-09-09

Refactor remove-dups unittests per feedback

f62686a... by Ryan Harper on 2020-09-08

curthooks: UEFI remove dupes: don't remove BootCurrent, config option

When removing duplicate UEFI bootmenu entries do not remove the
BootCurrent entry. Fix this by adding BootCurrent to the seen set
before processing the list and then skip it during iteration of the
entries.

- Add grub config option: remove_duplicate_entries bool
- Add documentation around remove_duplicate_entries grub config
- Add unittests to verify we don't remove boot current and to
  check that dupe removal can be disabled.

LP: #1894217

b3e627c... by Paride Legovini on 2020-09-09

Pin the dependency on pyrsistent

pyrsistent 0.16.0 is the latest version supporting Python < 3.5.
Newer versions make the *py27 tox environments fail.

83944d6... by Michael Hudson-Doyle on 2020-08-28

restore default of grub.update_nvram to True in install_grub

This was accidentally changed when the grub installation code was
converted from shell to Python.

4cb1035... by Ryan Harper on 2020-08-23

block: disk_to_byid_path handle missing /dev/disk/by-id directory

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.

LP: #1876258

7a48737... by Ryan Harper on 2020-08-21

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.

LP: #1789650

d18bb85... by Paride Legovini on 2020-08-21

dasd: fix off-by-one device_id devno range check

devno can be in the 0-0xffff range, inclusive.

1304d3e... by Ryan Harper on 2020-08-20

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.

LP: #1892242

0f6a06b... by Ryan Harper on 2020-08-19

netplan openvswitch yaml changed

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).

LP: #1891608