clear_holders: only export zpools that have been imported
Curtin may encounter disks which are zfs_members but are part of a pool which
isn't currently imported. Attempting to exporting a pool that is not imported
results in a failure. Instead, only export a pool if it's found in the list of
currently imported pools.
vmtests: allow env control of apt, system_upgrade, package upgrade
Add environment variables to support adding repositories, toggling
system_upgrade boolean, and installing packages.
This supports several use-cases where we want to test if a package
fixes an issue found in vmtest.
CURTIN_VMTEST_ADD_REPOS:
Comma separated list of repos to add via apt: config
Typically in the form: ppa:lpuser/pocket but also supports
'proposed' to generate a sources entry for adding that pocket.
extend the apt syntax to allow for the string 'proposed' to turn
CURTIN_VMTEST_SYSTEM_UPGRADE:
Enable curtin's system_upgrade feature, default value is 0
If there are values in CURTIN_VMTEST_ADD_REPOS, this will default to 1.
Users may use ADD_REPOS and disable system_upgrade by setting value
to 0.
CURTIN_VMTEST_UPGRADE_PACKAGES:
Comma separated list of packages that will be installed/upgraded
in a late command.
Lastly, allow ./tools/jenkins-runner to take CURTIN_* declarations
on the command line. This makes it easier to feed these to a manually
run jenkins run.
util.get_efibootmgr: filter bootorder by found entries
In some cases a previous EFI configuration may reference boot
items that are no longer present which results in curtin
invoking efibootmgr with invalid parameters:
% efibootmgr -o 0001,0000,3000,2001,2002,2003
Invalid BootOrder order entry value0001,0000,3000,2001,2002,2003
Curtin will update the the order list by dropping any elements
that don't have an actual boot entry.
vmtests: adjust lvm_iscsi dnames to match configuration
Previous to dname/bcache changes, we failed to check the correct dname
symlinks.
In test_lvm.py we included a test_dname override to prevent checking dname
on trusty but it failed to call the parent class if we weren't skipping.
Commit 12d7163cea8, make_dname, replaced all of the per-subclass checks
for trusty and added the SkipTest to the base class implementation which
then showed the error.
This change adjusts the dnames to match what's actually generated.
make_dname for bcache should use backing device uuid
bcache minor numbers are not stable across reboots which means
the dname symlinks pointing to a bcacheN isn't going to be stable either.
Instead, build a udev rule that links the backing device's bcache uuid
to the assigned dname. Additionally also update the backing device
'label' sysfs attribute with the dname value.
This does rely on changes to bcache-tools to trigger the rules, currently
there is a kernel bug (LP: #1729145) which is pending, and a user-space
workaround in bcache-tools (LP: #1728742). Either is sufficent for
the updated rules to be effective.
Some additional fixes found during this work
command/curthooks.py
- don't append .rule to rule files, they already have .rule
examples/tests/mdadm_bcache_complex.yaml
- removed, duplicate of mdadm_bcache.yaml
zfsroot: add additional checks, do not require disk 'serial' attribute
Add some additional validation to the storage config when using 'zfsroot'
format type. Ensure that the bootdisk is formated with GPT. Allow a
storage config using zfsroot/zpool to work with disks without a 'serial'
attribute, but log a warning that the pool may be unstable due to changes
in device names. Add unittests; update documentation with restrictions.
clear-holders: fix lvm name use when shutting down
The shutdown_lvm handler was reconstructing the name of
the lvm device incorrectly if the vg or lv name included
a hyphen. LVM requires names with hyphens to duplicate the hyphen.
Resolve this issue by keeping the original name from the sysfs
entry and using that when issuing the dmsetup command.