Enable grub zfsSupport if zfs is built into the initrd

This commit is contained in:
William A. Kennington III 2014-04-09 13:27:45 -05:00
parent 3c6e2fbba9
commit 02ab48d0ee
2 changed files with 6 additions and 2 deletions

View File

@ -7,7 +7,7 @@ let
cfg = config.boot.loader.grub; cfg = config.boot.loader.grub;
realGrub = if cfg.version == 1 then pkgs.grub realGrub = if cfg.version == 1 then pkgs.grub
else pkgs.grub2.override { zfsSupport = cfg.zfsSupport }; else pkgs.grub2.override { zfsSupport = cfg.zfsSupport; };
grub = grub =
# Don't include GRUB if we're only generating a GRUB menu (e.g., # Don't include GRUB if we're only generating a GRUB menu (e.g.,

View File

@ -133,7 +133,7 @@ in
}; };
boot.initrd = mkIf inInitrd { boot.initrd = mkIf inInitrd {
kernelModules = [ "spl" "zfs" ] ; kernelModules = [ "spl" "zfs" ];
extraUtilsCommands = extraUtilsCommands =
'' ''
cp -v ${zfsPkg}/sbin/zfs $out/bin cp -v ${zfsPkg}/sbin/zfs $out/bin
@ -148,6 +148,10 @@ in
''; '';
}; };
boot.loader.grub = mkIf inInitrd {
zfsSupport = true;
};
systemd.services."zpool-import" = { systemd.services."zpool-import" = {
description = "Import zpools"; description = "Import zpools";
after = [ "systemd-udev-settle.service" ]; after = [ "systemd-udev-settle.service" ];