Merge pull request #238021 from dcarosone/empty-zpool-name-assertion

nixos/zfs: assert that pool names are not empty
This commit is contained in:
Will Fancher 2023-06-15 23:21:07 -04:00 committed by GitHub
commit e57b65abbb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -523,6 +523,15 @@ in
assertion = cfgZfs.allowHibernation -> !cfgZfs.forceImportRoot && !cfgZfs.forceImportAll;
message = "boot.zfs.allowHibernation while force importing is enabled will cause data corruption";
}
{
assertion = !(elem "" allPools);
message = ''
Automatic pool detection found an empty pool name, which can't be used.
Hint: for `fileSystems` entries with `fsType = zfs`, the `device` attribute
should be a zfs dataset name, like `device = "pool/data/set"`.
This error can be triggered by using an absolute path, such as `"/dev/disk/..."`.
'';
}
];
boot = {