debian-forge-composer/test/data
Christian Kellner 9e5b265a58 osbuild2: lock loopback devices during sfdisk, mkfs
Since udev will probe block devices it is advisable to hold a lock
on the device when modifying its partition table or the superblock
of the filesystem (see [1]). osbuild loopback devices do support
this via the `lock` option. Set this option for all operation that
involve changing block device "metadata" that could potentionally
race with udev, such as sfdisk, mkfs, creating a luks2 container
and creating LVM2 volume groups and logical volumes.
NB: osbuild also has its own device inhibition logic to prevent
udev/lvm2 from auto activating devices and in general to limit the
interaction between the host and devices used by osbuild. See [2]
for more information.
NB: this also locks the loopback device in situation where we the
it is strickly not the right thing to do, e.g. when creating a fs
on a logical voume that is located on a loopback device, since in
this case the device we would need to lock is the logical volume.
Sadly, LVM/DM devices are exempt from block device locking. But,
due to a bug in osbuild < 50, the udev inhibitor does *not* work
for loopback devices and therefore we have to use the actual lock
to preven LVM device auto-activation via `69-dm-lvm-metad.rules`.
The change was implemented by adding a new boolean to `getDevices`
indicating if the loopback device should be locked or not. Once
we depend on osbuild 50 we can change the logic in `getDevices`
to only lock the loopback device if the number of devices is one,
i.e. we are working directly on the loopback device.

[1] https://systemd.io/BLOCK_DEVICE_LOCKING/
[2] /usr/lib/udev/rules.d/10-osbuild-inhibitor.rules
2022-02-28 17:09:30 +01:00
..
ansible test: change condition for greenboot checks in ansible playbooks 2022-02-24 17:07:34 +01:00
azure Test Azure images on HyperV Gen1 and Gen2 2021-06-22 13:44:19 +03:00
cloud-init tests: ship all tests in the -tests sub-package 2020-10-06 13:08:26 +02:00
composer test: Fix installation of osbuild-worker.toml in provision.sh 2021-02-25 18:44:21 +00:00
kerberos tests: ship all tests in the -tests sub-package 2020-10-06 13:08:26 +02:00
keyring tests: ship all tests in the -tests sub-package 2020-10-06 13:08:26 +02:00
koji test/koji: remove the koji-cli patch 2022-01-26 14:44:27 +01:00
manifests osbuild2: lock loopback devices during sfdisk, mkfs 2022-02-28 17:09:30 +01:00
openshift test: Add case - running edge-container on OCP as stage repo 2021-08-27 09:29:28 +02:00
repositories repos: bump RHEL 8.6 test repositories 2022-02-24 17:07:34 +01:00
upgrade8to9 tests/upgrade: gather more logs 2022-02-18 09:25:01 +01:00
worker test: Fix installation of osbuild-worker.toml in provision.sh 2021-02-25 18:44:21 +00:00
x509 test: generate certificates on fly instead of shipping them in the test RPM 2020-11-05 13:48:48 +01:00