Skip to content

Fix bug in path to UUID code with multi-device btrfs#28

Open
andykitchen wants to merge 18 commits intoisantop:masterfrom
andykitchen:multi-dev-btrfs-fix-2
Open

Fix bug in path to UUID code with multi-device btrfs#28
andykitchen wants to merge 18 commits intoisantop:masterfrom
andykitchen:multi-dev-btrfs-fix-2

Conversation

@andykitchen
Copy link

This is a rebase of the same patch from #22

This also makes the UUID matching code more robust
at the expense of using the external tool `findmnt'

This bug is caused by the assumtion that there is a
1-1 correspondence between device files and UUIDs
(which is almost always true). Unfortunately BTRFS
multi-device filesystems may have multiple devices
associated with a single UUID. The old link reading
code does not handle this case and fails to work.

Ultimately it's probably better to use a upstream
maintained tool for computing path -> UUID as it
is subtle and not a core problem this tool is trying
to solve. Also, findmnt' is already provided by the util-linux' package so another package dependency
is not added.

Ian Santopietro and others added 18 commits November 28, 2018 17:18
This option wasn't really useful because kernelstub still did
things when it was used. It's been official deprecated since
version 2.0 and has been removed from the online and other
documentation already, so this finally removes it from the program.
We don't want to flat-out remove the command line parameter without potentially
informing scripts. For now, we will print a warning message and silently exit
successfully without taking action. In the future, we will exit with non-zero
status. Following that, we'll remove the option entirely.
This ensures that each entry applies strictly to the installation that created it.
Before, if two OSs (possibly of different versions) used kernelstub, whichever one last
had kernelstub run would be the one whose entry was written. This change cleans that up
a bit by writing the hostname and the UUID into the filename of the entry. This ensures
that the entry files are unique to that installation, and provides a human-readable way
to select which installation to boot (if the hostname was changed).
Kernelstub 3.2

The PR releases Kernelstub  3.2 into the stable branch. This new version includes a number of fixes and new features:

* Systemd-boot entry files are now named (nearly) uniquely for each OS, ensuring that parallel installs of the same OS don't conflict with loader entry files. (fixes isantop#23 )
* Adds new, more reliable UUID detection. Thanks @andykitchen (closes isantop#22 )
* Adds new online documentation (manpage)
This also makes the UUID matching code more robust
at the expense of using the external tool `findmnt'

This bug is caused by the assumtion that there is a
1-1 correspondence between device files and UUIDs
(which is almost always true). Unfortunately BTRFS
multi-device filesystems may have multiple devices
associated with a single UUID. The old link reading
code does not handle this case and fails to work.

Ultimately it's probably better to use a upstream
maintained tool for computing path -> UUID as it
is subtle and not a core problem this tool is trying
to solve. Also, `findmnt' is already provided by the
`util-linux' package so another package dependency
is not added.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants