When obtaining unique ids for identifying a block storage
device, block-discover looks for ID_WWN and ID_SERIAL values
and will use them in the rendered storage config. In some cases
the value of these attributes may be invalid. For example, some
consumer disks might have an invalid WWN number:
0x00000000000000000000
Curtin will also ignore empty values, like
ID_SERIAL=' '
Excluded ids will not be emitted in the final storage config.
Disks with an MSDOS partition table and one partition with the
'bootable' flag set exposed a parsing error in block.sfdisk_info;
further digging revealed that curtin was not setting the bootable
flag on MSDOS partitions when required. Not setting isn't fatal,
grub still boots the partition, but we should set the flag if told
to do so. Additionally storage-config conversion of probe data
where the MSDOS boot flag is set was missing. The following changes
are done to fix this issue
- switch to sfdisk --json output and use/introduce util.load_json()
- block-meta: update parted command to set boot flag if present
- block-discover: prefer ID_PART_ENTRY_FLAGS when present, and 0x80
- Add vmtest to verify reuse of msdos partition and bootable flag
- Fix boot, extended, logical flag verfication
- Fix extended partition size verification
block.detect_multipath: ignore fake "devices" from /proc/mounts
A tmpfs can be mounted with any old junk in the "device" field and
unfortunately casper sometimes puts "/dev/shm" there, which is usually a
directory. Ignore such cases.
udev: use shlex.quote when shlex.split errors on shell-escape chars
The udev database may include shell escape characters in the output.
We want to avoid using shlex_quote unless needed as curtin does not
use the quoted value in our code and applying it to all of the values
breaks parsing of the udevadm info content.
If we encounter a ValueError while invoking shlex.split() then we
first use shlex_quote() and try parsing again and if that fails we
will try replacing shell-quote values with '_'. We log warning
whenever we have to quote or replace values.
vgscan --mknodes has a bug which creates block device nodes for any
entry in dmsetup table if it doesn't exist yet. This breaks the
assumption that /dev/mapper entries are symlinks created by udev.
Until upstream RHBZ: #1828617 is resolved do not use --mknodes.
vmtest: rsync don't cross filesystem boundaries when copying
In some scenarios /var/lib/lxcfs is mounted with kernel bits
and rsync complains; instead we now copy using the --one-file-system
flag which avoids crossing these boundaries.