1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-11-08 00:24:56 +03:00

dissect-image: optionally, reference dissected partition device nodes by diskseq

This is useful to make the dissection logic at boot a bit safer, as we
can reference device nodes by diskseq.

This locks down dissection a bit, since it makes it harder to swap out
the backing device between the time we dissected and validated it, until
we actually mounted it.

This is not complete though, as /bin/mount would have to verify the
diskseq after opening the diskseq symlink again.

See: https://github.com/util-linux/util-linux/issues/1786
This commit is contained in:
Lennart Poettering
2022-12-21 12:26:21 +01:00
parent a559088671
commit 1a81ddef00
2 changed files with 67 additions and 21 deletions

View File

@@ -78,6 +78,7 @@ typedef enum DissectImageFlags {
DISSECT_IMAGE_ADD_PARTITION_DEVICES = 1 << 20, /* Create partition devices via BLKPG_ADD_PARTITION */
DISSECT_IMAGE_PIN_PARTITION_DEVICES = 1 << 21, /* Open dissected partitions and decrypted partitions and pin them by fd */
DISSECT_IMAGE_RELAX_SYSEXT_CHECK = 1 << 22, /* Don't insist that the extension-release file name matches the image name */
DISSECT_IMAGE_DISKSEQ_DEVNODE = 1 << 23, /* Prefer /dev/disk/by-diskseq/… device nodes */
} DissectImageFlags;
struct DissectedImage {