Detect boot partition regardless of boot flags if mounted on /boot#3303
Detect boot partition regardless of boot flags if mounted on /boot#3303Torxed merged 1 commit intoarchlinux:masterfrom
Conversation
|
@svartkanin request review, please. |
|
Looks good from my side, I believe the original code was implemented by @codefiles so I will wait for a potential review otherwise happy to merge in a day or so |
if self.mountpoint is not None:
return Path('/boot') == self.mountpoint
else:
return any(set(self.flags) & set(self._boot_indicator_flags))I'm wondering if it's wiser to check the flags first? And then use the path as a fallback? At least checking the path lastly would make sense, in case the mount point isn't set yet (which would cause the return any(set(self.flags) & set(self._boot_indicator_flags)) or Path('/boot') == self.mountpointIt seems strange that none of the boot flags from |
But it is a real scenario that does happen when using a pre-mounted configuration, and in general the IMO if there is a partition mounted on Other than that, the point being raised about the order of checks and the issue with the else block not being entered under certain conditions is perfectly valid, and I will update the PR to use the line of code you shared. |
|
Thanks for being accommodating, I agree that it might be fragile. |
PR Description:
The boot partition is always to be mounted to
/boot(afaik). This allows skipping potentially misleading checks of partition type to determine whether to use a certain partition as/boot, if it is already mounted there.Tests and Checks