Commit graph

3 commits

Author SHA1 Message Date
Michael Vogt
ca558c2479 devices: create /dev/mapper/<logical-volume> as well
When we create the device node inside the buildroot so far it's
very minimal - just `/dev/{vg}-{lv}` with the appopriate major/minor.

However when mount runs it will create a mapper device with the
same major/minor under `/dev/mapper/{escaped(vg)}-{escaped(lv)}`
and use that to mount the actual filesystem. Without this additional
device findmnt will not be able to detect the udev attributes of
the source (as the source is just missing from /dev).

This commit create the right mapper in the same way that we
create the non-mapper device node.
2024-08-27 13:52:59 +02:00
Michael Vogt
a2fed3e0d8 devices: extract get_parent_path(), use for manage_devices_file()
This commit extract a helper `get_parent_path()` that is unit
tested and also uses this generated parent_path for the call
to manage_devices_file to be consistent with the exiting behavior
of only including the device that actually contains the VG.
2024-08-26 14:16:01 +02:00
Michael Vogt
6788a2c840 devices: add pytest conftest infra for devices
This is similar to the other `inputs`, `sources` etc conftest.py
modules and allows us to write unit test for the devices code.
2024-08-26 14:16:01 +02:00