Repository navigation
dissect: turn systemd-dissect into a plugin for udev that creates symlinks for dissected partitions - #36209
dissect: turn systemd-dissect into a plugin for udev that creates symlinks for dissected partitions#36209poettering wants to merge 4 commits into
Conversation
… with explicit property So far udev-builtin-blkid only marked the root partition of the main block device we booted from. Let's also mark the main block device explicitly. This is later useful to use as property to run the dissect_id plugin on.
All other rules in 99-systemd.rules are pretty much concerned about SYSTEMD_READY=1 and tagging devices the service manager shall track. But the gpt-root symlink is different, and it makes sense independently of the service manager. Hence give it a separate file.
…ection symlinks benefits: * can eventually take image policies into accounts * works for all designators * understands versioning * understands architecture matching * gpt-auto-generator and root fs logic use the same dissection logic
|
Will this support dm_verity protected partitions? Currently they seem to be somewhat broken with dissect (#34807). I apologize if this question does not apply - I just know that some parts (e.g. mounting) of sd-dissect are broken with verity protection (which in turn breaks sd-repart - #32029) and would like to know if this is affected by that or still works |
There was a problem hiding this comment.
Could you split out the main dissect logic to shared/dissect-image.c ? Then, please introduce udev-builtin-dissect.c, rather than reusing systemd-dissect. Why? Several merits:
- we do not need to install systemd-dissect in initrd (even on the main system, if people want),
- we can use sd_device_open(), which verifies DISKSEQ,
- we can directly set/import properties through
udev_builtin_add_property()and friends, rather than printing to stdout and parse it.
Please add test cases for the new feature.
| # If this is a partition, and we found something on the parent, then copy the right properties from the parent, and rename them | ||
| ENV{DEVTYPE}=="partition", ENV{ID_DISSECT_IMAGE}!="", IMPORT{program}="dissect_id --copy $devnode" | ||
|
|
||
| ENV{DEVTYPE}=="partition", ENV{ID_DISSECT_PART_DESIGNATOR}!="", SYMLINK+="gpt-auto-$env{ID_DISSECT_PART_DESIGNATOR}" |
There was a problem hiding this comment.
I still think disk/by-parttype/ as implemented in #28894 is way more descriptive and well-organized than laying all these directly in /dev/
There was a problem hiding this comment.
well, my goal here was to not introduce new naming, but to just mildly extend the naming of the existing /dev/gpt-auto-root symlink
There was a problem hiding this comment.
or to say this differently, this is a natural extension of the existing /dev/gpt-auto-root logic, just with a bunch more partitions.
i think the /dev/disk/by-* is kinda important if we basically unbounded number of devices in there. But this is different, the number of symlinks we'll create here is bounded by the number of designators, which is pretty low. hence I think we can get away with following the current naming scheme and extending it a tiny bit for the other designators, and don't have to introduce something entirely new.
|
Closing, a new version is #36631 |
hmm? dm-verity works perfectly her with dissect. but you do have to specify a roothash or place it in a file next to the image. |
I can only speak from my experience in the issues I referenced where stuff did not seem to work. At least sd-repart uses dissect under the hood and I cannot pass a roothash to sd-repart so I am not sure how this is supposed to work. For some weird reasons however ParticleOS does not seem to have problems with that even though they use a similar setup. I am not sure if this might depend on the order of hash partition and hash data partition. |
No description provided.