mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-16 18:37:04 +03:00
systemd 254: ZFS /usr fix with systemd-stage-1
This commit is contained in:
parent
fdd898f8f7
commit
524714f7ea
@ -90,12 +90,17 @@ let
|
||||
|
||||
getPoolMounts = prefix: pool:
|
||||
let
|
||||
poolFSes = getPoolFilesystems pool;
|
||||
|
||||
# Remove the "/" suffix because even though most mountpoints
|
||||
# won't have it, the "/" mountpoint will, and we can't have the
|
||||
# trailing slash in "/sysroot/" in stage 1.
|
||||
mountPoint = fs: escapeSystemdPath (prefix + (lib.removeSuffix "/" fs.mountPoint));
|
||||
|
||||
hasUsr = lib.any (fs: fs.mountPoint == "/usr") poolFSes;
|
||||
in
|
||||
map (x: "${mountPoint x}.mount") (getPoolFilesystems pool);
|
||||
map (x: "${mountPoint x}.mount") poolFSes
|
||||
++ lib.optional hasUsr "sysusr-usr.mount";
|
||||
|
||||
getKeyLocations = pool: if isBool cfgZfs.requestEncryptionCredentials then {
|
||||
hasKeys = cfgZfs.requestEncryptionCredentials;
|
||||
|
@ -690,6 +690,9 @@ in {
|
||||
"zpool create rpool /dev/vda2",
|
||||
"zfs create -o mountpoint=legacy rpool/root",
|
||||
"mount -t zfs rpool/root /mnt",
|
||||
"zfs create -o mountpoint=legacy rpool/root/usr",
|
||||
"mkdir /mnt/usr",
|
||||
"mount -t zfs rpool/root/usr /mnt/usr",
|
||||
"udevadm settle",
|
||||
)
|
||||
'';
|
||||
|
Loading…
Reference in New Issue
Block a user