Unverified Commit e6ade691 authored by Ryan Lahfa's avatar Ryan Lahfa Committed by GitHub
Browse files

Merge pull request #259347 from ElvishJerricco/systemd-stage-1-zfs-sysusr-dependency

systemd 254: ZFS /usr fix with systemd-stage-1
parents 68c8ffed 524714f7
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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;
+3 −0
Original line number Diff line number Diff line
@@ -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",
      )
    '';