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. (See https://bugs.launchpad.net/bugs/1876626)
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.
multipath: attempt to enforce /dev/mapper/mpath files are symlinks
Multipath device scanning and bring up variablity may result in
the creation of /dev/mapper/mpath* files that are block devices
instead of a symlink to the device mapper device (/dev/dm-0).
When these block files are present, this breaks assumptions in
curtin used to look up details in sysfs for a mapper device.
block-meta: device mapper partitions may be block devices not links
In some cases the multipath library may create a block device which
is not a symbolic link to the device-mapper dev[1]. Curtin expects the
symlink. Remove the non-symlink file and allow kpartx to create it.
Default to dm_name being id if empty earlier in dm_crypt_handler()
In other parts of the code, when deciding the path for dmcrypt_dev,
we default to 'id' when 'dm_name' is not defined. We ideally want
that to happen in all the cases. The defaulting has been there
already but a bit too late.