From 02ab48d0eea6e37d3432f6b8ce4c31b85e8d3ffe Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Wed, 9 Apr 2014 13:27:45 -0500 Subject: [PATCH] Enable grub zfsSupport if zfs is built into the initrd --- nixos/modules/system/boot/loader/grub/grub.nix | 2 +- nixos/modules/tasks/filesystems/zfs.nix | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/nixos/modules/system/boot/loader/grub/grub.nix b/nixos/modules/system/boot/loader/grub/grub.nix index 25cec57431e1..67fcd10ceb8c 100644 --- a/nixos/modules/system/boot/loader/grub/grub.nix +++ b/nixos/modules/system/boot/loader/grub/grub.nix @@ -7,7 +7,7 @@ let cfg = config.boot.loader.grub; realGrub = if cfg.version == 1 then pkgs.grub - else pkgs.grub2.override { zfsSupport = cfg.zfsSupport }; + else pkgs.grub2.override { zfsSupport = cfg.zfsSupport; }; grub = # Don't include GRUB if we're only generating a GRUB menu (e.g., diff --git a/nixos/modules/tasks/filesystems/zfs.nix b/nixos/modules/tasks/filesystems/zfs.nix index d7deb44c407c..1c4bbc16b499 100644 --- a/nixos/modules/tasks/filesystems/zfs.nix +++ b/nixos/modules/tasks/filesystems/zfs.nix @@ -133,7 +133,7 @@ in }; boot.initrd = mkIf inInitrd { - kernelModules = [ "spl" "zfs" ] ; + kernelModules = [ "spl" "zfs" ]; extraUtilsCommands = '' cp -v ${zfsPkg}/sbin/zfs $out/bin @@ -148,6 +148,10 @@ in ''; }; + boot.loader.grub = mkIf inInitrd { + zfsSupport = true; + }; + systemd.services."zpool-import" = { description = "Import zpools"; after = [ "systemd-udev-settle.service" ];