~mwhudson/curtin:udevadm_info-fix

Last commit made on 2020-05-11
Get this branch:
git clone -b udevadm_info-fix https://git.launchpad.net/~mwhudson/curtin
Only Michael Hudson-Doyle can upload to this branch. If you are Michael Hudson-Doyle please log in for upload directions.

Branch merges

Branch information

Name:
udevadm_info-fix
Repository:
lp:~mwhudson/curtin

Recent commits

ead7675... by Michael Hudson-Doyle

fix crash in udevadm_info

It appears someone did not understand how the maxplit argument to the
"".split method works.

6cbdc02... by Ryan Harper

Makefile: make adjustments to call lint/style tools via python module

- Drop nosetest invocation
- Drop tools/run-pyflakes*
- Add pylint targets
- Add pylintopts and target_dirs
- Fix style and lint issues

145e493... by Ryan Harper

block-discover: ignore invalid id_serial/id_wwn values

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.

LP: #1876848

8ab48f6... by Ryan Harper

Fix handing of reusing msdos partitions and flags

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

LP: #1875903

f4bd38f... by Michael Hudson-Doyle

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.

LP: #1876626

9b99e4b... by Ryan Harper

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.

- Python2.7 does not have shlex.quote, use pipes.quote (which was
  renamed to shlex.quote in Py3:
  https://docs.python.org/2/library/pipes.html#pipes.quote)
- Add unittest with original info dump from bug submitters system

LP: #1875085

f47a4c2... by Ryan Harper

lvm: don't use vgscan --mknodes

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.

9d85462... by Ryan Harper

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.

LP: #1873909

9943398... by Ryan Harper

vmtest: basic/basic_scsi adjust collect/tests for unstable device names

- For virtio-disks (TestBasic) use dname, except on centos66, use the byid
  serial name.
- For scsi-disks (TestScsiBasic) use wwn everywhere

LP: #1874100

07e9ed2... by Ryan Harper

Add unittests for partition_handler calc_[dm]_part_info and kpartx paths