Repository navigation
Conversation
Attribute substitution only looked at the device's own sysfs directory,
while the matching key ATTRS{} walks parents. Devices without an
attribute of their own, partitions in particular whose serial lives in
the parent disk, therefore substituted to an empty string.
disk_serial_id() falls back to <disk>/../serial so a partition got a by-id link named after its parent disk's serial, clobbering the link created for the whole disk.
|
@copilot resolve the merge conflicts in this pull request |
|
Uhhh... Is it going to start? Or I should resolve them, they look easy |
Good question, I'll have a look. Would be neat to not have to do such stuff ourselves :-) |
|
Alr, btw welcome back to finit :D |
Heh, yeah I've been in the wars lately. A bit too much going on at $DAYJOB atm. 😅 |
|
Copilot failed miserably at this simple task, so I've cherry-picked the partition fix (your second commit) onto master as c03059a. The first commit conflicted with #516, which fixes the same thing the way udev does it: |
|
Alr, thanks |
I've found them while writing the finix
keventd's VM tests, only the keventd backend failed to createvirtio-<serial>-part1after hotplugging a GPT disk.Two bugs:
$attr{} / %s{}read only the device's own sysfs directory, while the matching keyATTRS{}walks parents. Partitions have no serial of their own, so ID_SERIAL came out empty and the shipped rule publishedvirtio--part1. Affects the nvme, ieee1394 and mmc partition rules too.The fix adds
sysfs_read_attr_chain(), which falls back tosysfs_parent_walk().disk_serial_id()falls back to<disk>/../serial, so a partition got aby-idlink named after its parent disk's serial, overwriting the whole disk's link.The fix skips for
DEVTYPE=partition.