Add basic NVMe support (#74)

* grubdev detection: also check for /dev/nvme0n1

* add nvme to boot.initrd.kernelModules
This commit is contained in:
Robert Scott 2021-05-04 07:21:50 +01:00 committed by GitHub
parent d2996e3e53
commit 69fa0226d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,6 +42,7 @@ EOF
{ {
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
boot.loader.grub.device = "$grubdev"; boot.loader.grub.device = "$grubdev";
boot.initrd.kernelModules = [ "nvme" ];
fileSystems."/" = { device = "$rootfsdev"; fsType = "ext4"; }; fileSystems."/" = { device = "$rootfsdev"; fsType = "ext4"; };
} }
EOF EOF
@ -137,7 +138,7 @@ removeSwap() {
prepareEnv() { prepareEnv() {
# $grubdev is used in makeConf() # $grubdev is used in makeConf()
for grubdev in /dev/vda /dev/sda; do [[ -e $grubdev ]] && break; done for grubdev in /dev/vda /dev/sda /dev/nvme0n1 ; do [[ -e $grubdev ]] && break; done
# Retrieve root fs block device # Retrieve root fs block device
# (get root mount) (get partition or logical volume) # (get root mount) (get partition or logical volume)