block_meta: pass lvm_partition size through human2bytes
type:lvm_partition schema allows for the 'size' field as integer
or string. Process the 'size' value through human2bytes which
converts 'size' values into bytes.
clear-holders: refactor bcache shutdown and add longer timeout
Currently curtin will shutdown a bcache device by stopping the associated
cacheset. In some cases, the cacheset is responsible for multiple backing
devices each of which may have a large amount of dirty data which needs to
be flushed to the backing device before the cacheset can completely stop.
A better approach is to stop each backing device and monitor for when
their dirty-data and state indicate that it's clean and once all
related backing devices were stopped to stop the cacheset. However,
this triggered numerous kernel BUG() in kernels from Xenial 4.4 GA
through Disco 5.0 kernels.
A second approach unregistered the cacheset device; this was an
improvement but ultimately still triggered kernel BUG() in several
released kernels. This would have introduced a regression from
current behavior.
This patchset retains the original process of stopping the cacheset
and then the bcache device, however it refactors the code which
discovers, stops and waits into curtin.block.bcache and introduces
a higher timeout while waiting for bcache devices to stop.
The original fix mentioned was a 1200 second timeout.
This patch retains the total time, but breaks the sleep periods
up into smaller amounts and progressively increases the timeout.
tools/schema-validate-storage:3: 'jsonschema' imported but unused
tools/schema-validate-storage:4: 'json' imported but unused
tools/schema-validate-storage:6: 'yaml' imported but unused
add subcommand schema for storage-config validation
Introduce curtin feature 'STORAGE_CONFIG_SCHEMA' and a subcommand,
'schema' which accepts a path to a storage configuration file and
will validate the configuration against the storage schema.
Add some exception handling logic to decode the schema errors and
print useful pointers to users on where the error occurred.
clear-holders: wipe raid members at data offsets when not assembled
RAID5 arrays are assembled in degraded mode for speed[1]. If an
array is INACTIVE, then curtin cannot wipe the array through the
md device. Instead, examine the array members and find the mdadm
superblock and data offsets and wipe members at those locations.
This wipes the array contents without requiring it to be runnable.
ChrootableTarget: add /run to mounts for redhat targets
Recent updates to redhat target images appear to require
/run to be mounted. Update ChrootableTarget to allow callers
to specify a list of mounts needed. In curthooks.setup_grub
if target is redhat, then ensure that /run is in the list.