Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nixos/storage: Generate UUID for each device spec
We want to have deterministic UUIDs for every device specification in order to avoid the need to manually set labels all over the place. Of course, we could internally set labels instead of precomputing UUIDs, but labels have different length restrictions for every file system (for example XFS has a maximum of 12 bytes, for ext4 it's 16 bytes). In addition to that we remove the ability for people to set their own labels during runtime. The UUIDs generated here are based on version 5: https://tools.ietf.org/html/rfc4122#section-4.1.3 Our variant deviates from this a bit in that we use string concatenation to build up the input for the SHA1 hash instead of binaries. The results however are pretty much the same and in our part the most important aspect is determinism rather than having a truly unique value across the whole planet. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
- Loading branch information