Repository navigation
gpt-auto-generator: be more defensive when checking the presence of E… - #31181
Conversation
|
Sorry, but I'm still not convinced. My argument in #30994 (comment) still stands.
What is this supposed to mean? Please elaborate. Note that |
|
So I think it would be OK to mount neither ESP nor XBOOTLDR automatically if any path that starts with /efi or /boot exists in fstab. i.e. I think people should either configure their boot partitions in full in fstab or not at all in fstab. We should not bother with a case where one is configured explicitly and the other shall be mounted automatically. That's just doomed to fail I think. But please make this a nice helper call that prefix checks both dirs with path_startswith() in fstab, and returns a result. |
|
Great, that's even simpler. I'll rework the patch accordingly. |
It means that the naive approche that consists in adding 'p' suffix to the disk dev name that contains the partitions doesn't work for DM devices. For example, dm-0p2 isn't a valid device name for DM devices. |
401f402 to
a29c781
Compare
a29c781 to
0ac909e
Compare
keszybz
left a comment
There was a problem hiding this comment.
I like the simplicity of this approach. I guess that if we were doing this for the first, I would certainly prefer it. But we're not, so it's possible that there are people out there who are relying on the details of the previous behaviour. It's impossible to say for certain… But I think it's worth trying: let's merge this and later add a verbose entry in NEWS about changed behaviour and hope for the best. If reports from unhappy users start pouring in, we will have to revisit the issue.
|
I think we also need a mention in the man page. It currently says
but this patch does something more. |
Is this statement actually true ? I don't see what would prevent the generator from creating a mount unit for |
0ac909e to
d17079f
Compare
…SP in fstab Looking for the ESP node is useful to shortcut things but if we're told that the node is not referenced in fstab that doesn't necessarily mean that ESP is not mounted via fstab. Indeed the check is not reliable in all cases. Firstly because it assumes that udev already set the symlinks up. This is not the case for initrd-less boots. Secondly the devname of the ESP partition can be wrongly constructed by the dissect code. For example, the approach which consists in appending "p<partnum>" suffix to construct the partition devname from the disk devname doesn't work for DM devices. Hence this patch makes the logic more defensive and do not mount neither ESP nor XBOOTLDR automatically if any path in paths that starts with /efi or /boot exists.
d17079f to
76c883d
Compare
…SP in fstab
Looking for the ESP node is useful to shortcut things but if we're told that the node is not referenced in fstab that doesn't necessarily mean that ESP is not mounted via fstab. Indeed the check is not reliable in all cases. Firstly because it assumes that udev already set the symlinks up. This is not the case for initrd-less boots. Secondly the devname of the ESP partition can be wrongly constructed (e.g. multipath). Hence we need to be defensive here and also verify the paths of the mount point directory.