debian-forge-composer/internal
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
..
auth jwt: support multiple key providers 2022-01-31 20:40:22 +00:00
blueprint distro/rhel86: add fido dracut module and enable customizing onboarding 2022-02-24 17:07:34 +01:00
boot tests: update IDs in Openstack image boot test 2022-02-14 12:13:18 +02:00
client client: Add Cancel function and tests 2022-02-18 09:31:07 +01:00
cloud internal/cloud: Allow aws creds from defaults 2022-02-21 15:43:53 +01:00
cloudapi distro/rhel86: add support for azure marketplace 2022-02-27 22:03:36 +01:00
common internal/common: introduce function to convert data sizes 2021-11-02 18:32:47 +01:00
crypt crypt: add automatic darwin support 2020-07-17 07:48:22 +02:00
disk disk: honour the fact that some containers have metadata 2022-02-28 17:09:30 +01:00
distro rhel90: automatically convert to LVM on fs customizations 2022-02-28 17:09:30 +01:00
distroregistry distroregistry: enable CS9 2022-02-18 10:39:08 +00:00
jobqueue fsjobqueue: refactor to allow dequeuing by multiple criteria 2022-02-16 17:14:36 +01:00
jsondb gosec: G306-WriteFile permissions higher than 0600 2021-12-13 12:17:30 +02:00
kojiapi worker/server: typesafe Job and JobStatus 2022-02-01 20:28:40 +00:00
mocks test: Add fixture support for blueprint changes 2022-02-15 10:10:21 +01:00
osbuild1 osbuild2: add X11Keymap option to KeymapStageOptions 2022-02-27 22:03:36 +01:00
osbuild2 osbuild2: lock loopback devices during sfdisk, mkfs 2022-02-28 17:09:30 +01:00
ostree ostree: rename errors and introduce ParameterComboError 2022-02-23 11:08:24 +01:00
prometheus metrics: change job metrics namespace 2022-02-08 15:57:12 +01:00
reporegistry reporegistry: Add a DistroHasRepos helper function 2021-07-12 08:58:42 +02:00
rhsm internal/rhsm: implement fallback to the previous mechanism 2021-08-09 12:40:23 +02:00
rpmmd Move OSBuildMetadataToRPMs and PackageMetadataToSignature to osbuild2 2022-02-18 09:26:35 +01:00
store store: Filter out blank blueprint name 2022-02-15 10:10:21 +01:00
target Add support for OCI upload provider 2022-01-28 15:16:47 +01:00
test gosec: G204 - Subproccess launched as function arg 2021-12-13 12:17:30 +02:00
upload Relax TCP timeouts for koji connections 2022-02-10 14:58:10 +01:00
weldr ostree: move test server to separate package 2022-02-23 11:08:24 +01:00
worker worker: use default transport instead of "blank" one 2022-02-21 14:46:49 +01:00
tools.go go: vendor the oapi-codegen cmd 2021-02-01 15:32:58 +01:00