From 2a983acaffd9382302ebc3a36a2649f9b2f53a6c Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Wed, 1 Aug 2012 21:50:43 -0400 Subject: [PATCH 01/15] Enable specifying which kernel config options are needed for a given module --- modules/system/boot/kernel.nix | 61 +++++++++++++++++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) diff --git a/modules/system/boot/kernel.nix b/modules/system/boot/kernel.nix index 1b247a658908..5bb479698352 100644 --- a/modules/system/boot/kernel.nix +++ b/modules/system/boot/kernel.nix @@ -108,6 +108,24 @@ let kernel = config.boot.kernelPackages.kernel; in apply = pkgs.aggregateModules; }; + system.requiredKernelConfig = mkOption { + default = []; + example = literalExample '' + with config.lib.kernelConfig; [ + (isYes "MODULES") + (isEnabled "FB_CON_DECOR") + (isEnabled "BLK_DEV_INITRD") + ] + ''; + internal = true; + type = types.listOf types.attrs; + description = '' + This option allows modules to specify the kernel config options that + must be set (or unset) for the module to work. Please use the + lib.kernelConfig functions to build list elements. + ''; + }; + }; @@ -173,6 +191,47 @@ let kernel = config.boot.kernelPackages.kernel; in # The Linux kernel >= 2.6.27 provides firmware. hardware.firmware = [ "${kernel}/lib/firmware" ]; - }; + lib.kernelConfig = { + isYes = option: { + assertion = config: config.isYes option; + message = "CONFIG_${option} is not yes!"; + }; + isNo = option: { + assertion = config: config.isNo option; + message = "CONFIG_${option} is not no!"; + }; + + isModule = option: { + assertion = config: config.isModule option; + message = "CONFIG_${option} is not built as a module!"; + }; + + ### Usually you will just want to use these two + # True if yes or module + isEnabled = option: { + assertion = config: config.isEnabled option; + message = "CONFIG_${option} is not enabled!"; + }; + + # True if no or omitted + isDisabled = option: { + assertion = config: config.isDisabled option; + message = "CONFIG_${option} is not disabled!"; + }; + }; + + # The config options that all modules can depend upon + system.requiredKernelConfig = with config.lib.kernelConfig; [ + (isYes "MODULES") + (isYes "BLK_DEV_INITRD") + ]; + + # nixpkgs kernels are assumed to have all required features + assertions = if config.boot.kernelPackages.kernel ? features then [] else + let cfg = config.boot.kernelPackages.kernel.config; in map (attrs: + { assertion = attrs.assertion cfg; inherit (attrs) message; } + ) config.system.requiredKernelConfig; + + }; } From 9e300052bd830d48f6016d5f90441030fd556f1c Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Wed, 1 Aug 2012 22:32:16 -0400 Subject: [PATCH 02/15] Add test to check that a machine with a minimal kernel but all of the requiredKernelConfig options set boots and shuts down --- modules/system/boot/kernel.nix | 5 +++++ release.nix | 1 + tests/default.nix | 1 + tests/minimal-kernel.nix | 34 ++++++++++++++++++++++++++++++++++ 4 files changed, 41 insertions(+) create mode 100644 tests/minimal-kernel.nix diff --git a/modules/system/boot/kernel.nix b/modules/system/boot/kernel.nix index 5bb479698352..326cf64d6b85 100644 --- a/modules/system/boot/kernel.nix +++ b/modules/system/boot/kernel.nix @@ -195,16 +195,19 @@ let kernel = config.boot.kernelPackages.kernel; in isYes = option: { assertion = config: config.isYes option; message = "CONFIG_${option} is not yes!"; + configLine = "CONFIG_${option}=y"; }; isNo = option: { assertion = config: config.isNo option; message = "CONFIG_${option} is not no!"; + configLine = "CONFIG_${option}=n"; }; isModule = option: { assertion = config: config.isModule option; message = "CONFIG_${option} is not built as a module!"; + configLine = "CONFIG_${option}=m"; }; ### Usually you will just want to use these two @@ -212,12 +215,14 @@ let kernel = config.boot.kernelPackages.kernel; in isEnabled = option: { assertion = config: config.isEnabled option; message = "CONFIG_${option} is not enabled!"; + configLine = "CONFIG_${option}=y"; }; # True if no or omitted isDisabled = option: { assertion = config: config.isDisabled option; message = "CONFIG_${option} is not disabled!"; + configLine = "CONFIG_${option}=n"; }; }; diff --git a/release.nix b/release.nix index 4ccbd2ef754f..9f76ee4a254c 100644 --- a/release.nix +++ b/release.nix @@ -212,6 +212,7 @@ let kde4 = t.kde4.test; login = t.login.test; misc = t.misc.test; + minimal_kernel = t.minimal_kernel.test; mpich = t.mpich.test; mysql = t.mysql.test; mysql_replication = t.mysql_replication.test; diff --git a/tests/default.nix b/tests/default.nix index 4edcbd2f325b..2433826a9d17 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -11,6 +11,7 @@ with import ../lib/testing.nix { inherit system; }; ipv6 = makeTest (import ./ipv6.nix); kde4 = makeTest (import ./kde4.nix); login = makeTest (import ./login.nix); + minimal_kernel = makeTest (import ./minimal-kernel.nix); misc = makeTest (import ./misc.nix); mpich = makeTest (import ./mpich.nix); mysql = makeTest (import ./mysql.nix); diff --git a/tests/minimal-kernel.nix b/tests/minimal-kernel.nix new file mode 100644 index 000000000000..04fe17c261b7 --- /dev/null +++ b/tests/minimal-kernel.nix @@ -0,0 +1,34 @@ +{ pkgs, ... }: + + +{ + machine = { config, pkgs, ... }: + let + configfile = builtins.storePath (builtins.toFile "config" (pkgs.lib.concatStringsSep "\n" + (map (builtins.getAttr "configLine") config.system.requiredKernelConfig))); + + kernel = pkgs.lib.overrideDerivation (pkgs.linuxManualConfig { + inherit (pkgs.linux) src version; + inherit configfile; + allowImportFromDerivation = true; + }) (attrs: { + configurePhase = '' + runHook preConfigure + mkdir ../build + make $makeFlags "''${makeFlagsArray[@]}" mrproper + make $makeFlags "''${makeFlagsArray[@]}" KCONFIG_ALLCONFIG=${configfile} allnoconfig + runHook postConfigure + ''; + }); + + kernelPackages = pkgs.linuxPackagesFor kernel kernelPackages; + in { + boot.kernelPackages = kernelPackages; + }; + + testScript = + '' + startAll; + $machine->shutdown; + ''; +} From 3d20a308afb1cde850f63feab990d7d5b4f8e296 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Wed, 1 Aug 2012 23:36:48 -0400 Subject: [PATCH 03/15] tests/minimal-kernel: Add CIFS timeout patch --- modules/testing/test-instrumentation.nix | 9 ++++++++- tests/minimal-kernel.nix | 9 ++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/modules/testing/test-instrumentation.nix b/modules/testing/test-instrumentation.nix index 830f1744fa04..b18e4263c2db 100644 --- a/modules/testing/test-instrumentation.nix +++ b/modules/testing/test-instrumentation.nix @@ -5,11 +5,18 @@ with pkgs.lib; +let + kernel = config.boot.kernelPackages.kernel; + + hasCIFSTimeout = if kernel ? features then kernel.features ? cifsTimeout + else (filter (p: p.name == "cifs-timeout") kernel.kernelPatches) != []; +in + { config = # Require a patch to the kernel to increase the 15s CIFS timeout. - mkAssert (config.boot.kernelPackages.kernel.features ? cifsTimeout) " + mkAssert hasCIFSTimeout " VM tests require that the kernel has the CIFS timeout patch. " { diff --git a/tests/minimal-kernel.nix b/tests/minimal-kernel.nix index 04fe17c261b7..e27b39d17643 100644 --- a/tests/minimal-kernel.nix +++ b/tests/minimal-kernel.nix @@ -7,11 +7,14 @@ configfile = builtins.storePath (builtins.toFile "config" (pkgs.lib.concatStringsSep "\n" (map (builtins.getAttr "configLine") config.system.requiredKernelConfig))); - kernel = pkgs.lib.overrideDerivation (pkgs.linuxManualConfig { + origKernel = pkgs.linuxManualConfig { inherit (pkgs.linux) src version; inherit configfile; allowImportFromDerivation = true; - }) (attrs: { + kernelPatches = [ pkgs.kernelPatches.cifs_timeout_2_6_38 ]; + }; + + kernel = origKernel //(derivation (origKernel.drvAttrs // { configurePhase = '' runHook preConfigure mkdir ../build @@ -19,7 +22,7 @@ make $makeFlags "''${makeFlagsArray[@]}" KCONFIG_ALLCONFIG=${configfile} allnoconfig runHook postConfigure ''; - }); + })); kernelPackages = pkgs.linuxPackagesFor kernel kernelPackages; in { From feb010a366c857c7320c37d7152759419b88ca8b Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Thu, 2 Aug 2012 00:47:36 -0400 Subject: [PATCH 04/15] NixOS kernels should support ELF executables --- modules/system/boot/kernel.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/system/boot/kernel.nix b/modules/system/boot/kernel.nix index 326cf64d6b85..ab9961960795 100644 --- a/modules/system/boot/kernel.nix +++ b/modules/system/boot/kernel.nix @@ -230,6 +230,7 @@ let kernel = config.boot.kernelPackages.kernel; in system.requiredKernelConfig = with config.lib.kernelConfig; [ (isYes "MODULES") (isYes "BLK_DEV_INITRD") + (isYes "BINFMT_ELF") ]; # nixpkgs kernels are assumed to have all required features From 1b615f460bc40cf2697d7e972bad3091cf87ceaf Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Sat, 4 Aug 2012 09:45:26 -0400 Subject: [PATCH 05/15] Allow overriding all NixOS tests to run with the minimal kernel possible for that test's config(s) (based on requiredKernelConfig) --- lib/build-vms.nix | 4 ++-- lib/testing.nix | 4 ++-- modules/testing/minimal-kernel.nix | 28 ++++++++++++++++++++++ release.nix | 6 ++--- tests/default.nix | 5 ++-- tests/minimal-kernel.nix | 37 ------------------------------ 6 files changed, 37 insertions(+), 47 deletions(-) create mode 100644 modules/testing/minimal-kernel.nix delete mode 100644 tests/minimal-kernel.nix diff --git a/lib/build-vms.nix b/lib/build-vms.nix index e8e5885137d6..aacd0e99cb18 100644 --- a/lib/build-vms.nix +++ b/lib/build-vms.nix @@ -1,4 +1,4 @@ -{ system }: +{ system, minimal ? false }: let pkgs = import { config = {}; inherit system; }; in @@ -27,7 +27,7 @@ rec { [ ../modules/virtualisation/qemu-vm.nix ../modules/testing/test-instrumentation.nix # !!! should only get added for automated test runs { key = "no-manual"; services.nixosManual.enable = false; } - ]; + ] ++ lib.optional minimal ../modules/testing/minimal-kernel.nix; extraArgs = { inherit nodes; }; }; diff --git a/lib/testing.nix b/lib/testing.nix index 6a39df8c865d..a27f4344c6ae 100644 --- a/lib/testing.nix +++ b/lib/testing.nix @@ -1,6 +1,6 @@ -{ system }: +{ system, minimal ? false }: -with import ./build-vms.nix { inherit system; }; +with import ./build-vms.nix { inherit system minimal; }; with pkgs; rec { diff --git a/modules/testing/minimal-kernel.nix b/modules/testing/minimal-kernel.nix new file mode 100644 index 000000000000..0ad20bbf75a2 --- /dev/null +++ b/modules/testing/minimal-kernel.nix @@ -0,0 +1,28 @@ +{ config, pkgs, ... }: + +let + configfile = builtins.storePath (builtins.toFile "config" (pkgs.lib.concatStringsSep "\n" + (map (builtins.getAttr "configLine") config.system.requiredKernelConfig)) + ); + + origKernel = pkgs.linuxManualConfig { + inherit (pkgs.linux) src version; + inherit configfile; + allowImportFromDerivation = true; + kernelPatches = [ pkgs.kernelPatches.cifs_timeout_2_6_38 ]; + }; + + kernel = origKernel // (derivation (origKernel.drvAttrs // { + configurePhase = '' + runHook preConfigure + mkdir ../build + make $makeFlags "''${makeFlagsArray[@]}" mrproper + make $makeFlags "''${makeFlagsArray[@]}" KCONFIG_ALLCONFIG=${configfile} allnoconfig + runHook postConfigure + ''; + })); + + kernelPackages = pkgs.linuxPackagesFor kernel kernelPackages; +in { + boot.kernelPackages = kernelPackages; +} diff --git a/release.nix b/release.nix index 9f76ee4a254c..10cea94881f2 100644 --- a/release.nix +++ b/release.nix @@ -1,5 +1,6 @@ { nixosSrc ? {outPath = ./.; revCount = 1234; shortRev = "abcdef"; } , nixpkgs ? {outPath = ; revCount = 5678; shortRev = "fedcba"; } +, minimal ? false }: let @@ -194,8 +195,8 @@ let tests = let - t = import ./tests { system = "i686-linux"; }; - t_64 = import ./tests { system = "x86_64-linux"; }; + t = import ./tests { system = "i686-linux"; inherit minimal; }; + t_64 = import ./tests { system = "x86_64-linux"; inherit minimal; }; in { avahi = t.avahi.test; bittorrent = t.bittorrent.test; @@ -212,7 +213,6 @@ let kde4 = t.kde4.test; login = t.login.test; misc = t.misc.test; - minimal_kernel = t.minimal_kernel.test; mpich = t.mpich.test; mysql = t.mysql.test; mysql_replication = t.mysql_replication.test; diff --git a/tests/default.nix b/tests/default.nix index 2433826a9d17..0d2c3102a646 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -1,6 +1,6 @@ -{ system ? builtins.currentSystem }: +{ system ? builtins.currentSystem, minimal ? false }: -with import ../lib/testing.nix { inherit system; }; +with import ../lib/testing.nix { inherit system minimal; }; { avahi = makeTest (import ./avahi.nix); @@ -11,7 +11,6 @@ with import ../lib/testing.nix { inherit system; }; ipv6 = makeTest (import ./ipv6.nix); kde4 = makeTest (import ./kde4.nix); login = makeTest (import ./login.nix); - minimal_kernel = makeTest (import ./minimal-kernel.nix); misc = makeTest (import ./misc.nix); mpich = makeTest (import ./mpich.nix); mysql = makeTest (import ./mysql.nix); diff --git a/tests/minimal-kernel.nix b/tests/minimal-kernel.nix deleted file mode 100644 index e27b39d17643..000000000000 --- a/tests/minimal-kernel.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ pkgs, ... }: - - -{ - machine = { config, pkgs, ... }: - let - configfile = builtins.storePath (builtins.toFile "config" (pkgs.lib.concatStringsSep "\n" - (map (builtins.getAttr "configLine") config.system.requiredKernelConfig))); - - origKernel = pkgs.linuxManualConfig { - inherit (pkgs.linux) src version; - inherit configfile; - allowImportFromDerivation = true; - kernelPatches = [ pkgs.kernelPatches.cifs_timeout_2_6_38 ]; - }; - - kernel = origKernel //(derivation (origKernel.drvAttrs // { - configurePhase = '' - runHook preConfigure - mkdir ../build - make $makeFlags "''${makeFlagsArray[@]}" mrproper - make $makeFlags "''${makeFlagsArray[@]}" KCONFIG_ALLCONFIG=${configfile} allnoconfig - runHook postConfigure - ''; - })); - - kernelPackages = pkgs.linuxPackagesFor kernel kernelPackages; - in { - boot.kernelPackages = kernelPackages; - }; - - testScript = - '' - startAll; - $machine->shutdown; - ''; -} From e66bcbd58a1a4691023c0d3c466d3ad4bd28255f Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Mon, 6 Aug 2012 08:13:06 -0400 Subject: [PATCH 06/15] The kernel needs SERIAL_8250_CONSOLE when using a real serial port as a console --- modules/testing/test-instrumentation.nix | 4 ++++ modules/virtualisation/qemu-vm.nix | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/modules/testing/test-instrumentation.nix b/modules/testing/test-instrumentation.nix index b18e4263c2db..6a7f559c3795 100644 --- a/modules/testing/test-instrumentation.nix +++ b/modules/testing/test-instrumentation.nix @@ -94,6 +94,10 @@ in system.upstartEnvironment.GCOV_PREFIX = "/tmp/xchg/coverage-data"; + system.requiredKernelConfig = with config.lib.kernelConfig; [ + (isYes "SERIAL_8250_CONSOLE") + (isYes "SERIAL_8250") + ]; }; } diff --git a/modules/virtualisation/qemu-vm.nix b/modules/virtualisation/qemu-vm.nix index dd8b457d43c7..0e9804751bec 100644 --- a/modules/virtualisation/qemu-vm.nix +++ b/modules/virtualisation/qemu-vm.nix @@ -385,4 +385,9 @@ in # Wireless won't work in the VM. networking.wireless.enable = mkOverride 50 false; + + system.requiredKernelConfig = optional (!cfg.graphics) (with config.lib.kernelConfig; [ + (isYes "SERIAL_8250_CONSOLE") + (isYes "SERIAL_8250") + ]); } From 64d0069be30f0a8358a1dc178cd15d0d9892ee35 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Mon, 6 Aug 2012 17:02:35 -0400 Subject: [PATCH 07/15] udev requires unix sockets and inotify --- modules/services/hardware/udev.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/services/hardware/udev.nix b/modules/services/hardware/udev.nix index 3bbf24bb3791..174d31c6c008 100644 --- a/modules/services/hardware/udev.nix +++ b/modules/services/hardware/udev.nix @@ -263,6 +263,11 @@ in ''; }; + system.requiredKernelConfig = with config.lib.kernelConfig; [ + (isEnabled "UNIX") + (isYes "INOTIFY_USER") + (isYes "NET") + ]; }; } From 11e5207a2d20d4eb557bc60339e193283141d0d9 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Mon, 6 Aug 2012 17:10:54 -0400 Subject: [PATCH 08/15] qemu requires VIRTIO_BLK (and dependencies) for virtio drives --- modules/virtualisation/qemu-vm.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/virtualisation/qemu-vm.nix b/modules/virtualisation/qemu-vm.nix index 0e9804751bec..e0561d479cf0 100644 --- a/modules/virtualisation/qemu-vm.nix +++ b/modules/virtualisation/qemu-vm.nix @@ -386,8 +386,14 @@ in # Wireless won't work in the VM. networking.wireless.enable = mkOverride 50 false; - system.requiredKernelConfig = optional (!cfg.graphics) (with config.lib.kernelConfig; [ + system.requiredKernelConfig = with config.lib.kernelConfig; [ + (isEnabled "VIRTIO_BLK") + (isEnabled "VIRTIO_PCI") + (isYes "BLK_DEV") + (isYes "PCI") + (isYes "EXPERIMENTAL") + ] ++ optional (!cfg.graphics) [ (isYes "SERIAL_8250_CONSOLE") (isYes "SERIAL_8250") - ]); + ]; } From 0ea2643c630640a274c1bd720e8f3138d74717db Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Tue, 7 Aug 2012 06:57:01 -0400 Subject: [PATCH 09/15] The initrd mounts some tmpfses --- modules/system/boot/stage-1.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/system/boot/stage-1.nix b/modules/system/boot/stage-1.nix index 02a75ae21c46..aa86f14066da 100644 --- a/modules/system/boot/stage-1.nix +++ b/modules/system/boot/stage-1.nix @@ -321,4 +321,7 @@ in { system.build.initialRamdisk = initialRamdisk; system.build.extraUtils = extraUtils; + system.requiredKernelConfig = with config.lib.kernelConfig; [ + (isYes "TMPFS") + ]; } From 805d37db481431ec2a1a007a4c82dcca554f1092 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Tue, 7 Aug 2012 07:02:08 -0400 Subject: [PATCH 10/15] qemu-vm creates an ext3 filesystem --- modules/virtualisation/qemu-vm.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/virtualisation/qemu-vm.nix b/modules/virtualisation/qemu-vm.nix index e0561d479cf0..3d71a5356c63 100644 --- a/modules/virtualisation/qemu-vm.nix +++ b/modules/virtualisation/qemu-vm.nix @@ -389,6 +389,7 @@ in system.requiredKernelConfig = with config.lib.kernelConfig; [ (isEnabled "VIRTIO_BLK") (isEnabled "VIRTIO_PCI") + (isEnabled "EXT3_FS") (isYes "BLK_DEV") (isYes "PCI") (isYes "EXPERIMENTAL") From 13d8856a4f431be07b9e6335583ab1e82276f9b7 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Tue, 7 Aug 2012 16:25:11 -0400 Subject: [PATCH 11/15] qemu requires VIRTIO_NET (and dependencies) for virtio networking --- modules/virtualisation/qemu-vm.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/virtualisation/qemu-vm.nix b/modules/virtualisation/qemu-vm.nix index 3d71a5356c63..d04b39763416 100644 --- a/modules/virtualisation/qemu-vm.nix +++ b/modules/virtualisation/qemu-vm.nix @@ -389,10 +389,13 @@ in system.requiredKernelConfig = with config.lib.kernelConfig; [ (isEnabled "VIRTIO_BLK") (isEnabled "VIRTIO_PCI") + (isEnabled "VIRTIO_NET") (isEnabled "EXT3_FS") (isYes "BLK_DEV") (isYes "PCI") (isYes "EXPERIMENTAL") + (isYes "NETDEVICES") + (isYes "NET_CORE") ] ++ optional (!cfg.graphics) [ (isYes "SERIAL_8250_CONSOLE") (isYes "SERIAL_8250") From 9d8ddd90f9e98b82b56655705b35aecf6181ee14 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Tue, 7 Aug 2012 16:44:15 -0400 Subject: [PATCH 12/15] qemu mounts /nix/store via CIFS --- modules/virtualisation/qemu-vm.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/virtualisation/qemu-vm.nix b/modules/virtualisation/qemu-vm.nix index d04b39763416..17f19537115e 100644 --- a/modules/virtualisation/qemu-vm.nix +++ b/modules/virtualisation/qemu-vm.nix @@ -391,11 +391,14 @@ in (isEnabled "VIRTIO_PCI") (isEnabled "VIRTIO_NET") (isEnabled "EXT3_FS") + (isEnabled "CIFS") (isYes "BLK_DEV") (isYes "PCI") (isYes "EXPERIMENTAL") (isYes "NETDEVICES") (isYes "NET_CORE") + (isYes "INET") + (isYes "NETWORK_FILESYSTEMS") ] ++ optional (!cfg.graphics) [ (isYes "SERIAL_8250_CONSOLE") (isYes "SERIAL_8250") From d28876ea70ff939b4555deca5dad6e532d420825 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Tue, 7 Aug 2012 17:04:00 -0400 Subject: [PATCH 13/15] qemu tests use the virtio console to run commands --- modules/testing/test-instrumentation.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/testing/test-instrumentation.nix b/modules/testing/test-instrumentation.nix index 6a7f559c3795..9d36538ea088 100644 --- a/modules/testing/test-instrumentation.nix +++ b/modules/testing/test-instrumentation.nix @@ -97,6 +97,7 @@ in system.requiredKernelConfig = with config.lib.kernelConfig; [ (isYes "SERIAL_8250_CONSOLE") (isYes "SERIAL_8250") + (isEnabled "VIRTIO_CONSOLE") ]; }; From d9c03b64479cc04d3f78b3c43b6ddecd52c17add Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Tue, 7 Aug 2012 17:34:10 -0400 Subject: [PATCH 14/15] The kernel needs swap support if swapDevices are enabled --- modules/config/swap.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/config/swap.nix b/modules/config/swap.nix index 163de568d0f7..5b20f657e129 100644 --- a/modules/config/swap.nix +++ b/modules/config/swap.nix @@ -73,4 +73,10 @@ with pkgs.lib; }; + config = mkIf ((length config.swapDevices) != 0) { + system.requiredKernelConfig = with config.lib.kernelConfig; [ + (isYes "SWAP") + ]; + }; + } From c39f493ebb4b619e2b6d2cfd4e12c531861213c8 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Tue, 7 Aug 2012 18:09:08 -0400 Subject: [PATCH 15/15] Minor reorganization --- modules/system/boot/kernel.nix | 2 +- modules/system/boot/stage-1.nix | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/system/boot/kernel.nix b/modules/system/boot/kernel.nix index ab9961960795..62b68c560d13 100644 --- a/modules/system/boot/kernel.nix +++ b/modules/system/boot/kernel.nix @@ -228,8 +228,8 @@ let kernel = config.boot.kernelPackages.kernel; in # The config options that all modules can depend upon system.requiredKernelConfig = with config.lib.kernelConfig; [ + # !!! Should this really be needed? (isYes "MODULES") - (isYes "BLK_DEV_INITRD") (isYes "BINFMT_ELF") ]; diff --git a/modules/system/boot/stage-1.nix b/modules/system/boot/stage-1.nix index aa86f14066da..01ecd839f556 100644 --- a/modules/system/boot/stage-1.nix +++ b/modules/system/boot/stage-1.nix @@ -323,5 +323,6 @@ in { system.requiredKernelConfig = with config.lib.kernelConfig; [ (isYes "TMPFS") + (isYes "BLK_DEV_INITRD") ]; }