diff options
author | Ricardo M. Correia <rcorreia@wizy.org> | 2014-01-21 17:25:49 +0100 |
---|---|---|
committer | Bjørn Forsman <bjorn.forsman@gmail.com> | 2014-02-09 13:55:37 +0100 |
commit | cba2444d11ca4d2a8a335a752568c5fe09a90390 (patch) | |
tree | 1afbcca5ec4d3ff059d9d2f0a944a3794a8115c6 /nixos/modules/system/boot/loader/grub/memtest.nix | |
parent | c3df9e21c0116eddaeff0f446d9ae005321afa44 (diff) | |
download | nixlib-cba2444d11ca4d2a8a335a752568c5fe09a90390.tar nixlib-cba2444d11ca4d2a8a335a752568c5fe09a90390.tar.gz nixlib-cba2444d11ca4d2a8a335a752568c5fe09a90390.tar.bz2 nixlib-cba2444d11ca4d2a8a335a752568c5fe09a90390.tar.lz nixlib-cba2444d11ca4d2a8a335a752568c5fe09a90390.tar.xz nixlib-cba2444d11ca4d2a8a335a752568c5fe09a90390.tar.zst nixlib-cba2444d11ca4d2a8a335a752568c5fe09a90390.zip |
nixos/memtest: Allow user to specify memtest86 boot parameters
Diffstat (limited to 'nixos/modules/system/boot/loader/grub/memtest.nix')
-rw-r--r-- | nixos/modules/system/boot/loader/grub/memtest.nix | 41 |
1 files changed, 32 insertions, 9 deletions
diff --git a/nixos/modules/system/boot/loader/grub/memtest.nix b/nixos/modules/system/boot/loader/grub/memtest.nix index 80c1a160cfde..3745b4057126 100644 --- a/nixos/modules/system/boot/loader/grub/memtest.nix +++ b/nixos/modules/system/boot/loader/grub/memtest.nix @@ -6,28 +6,51 @@ with pkgs.lib; let memtest86 = pkgs.memtest86plus; + cfg = config.boot.loader.grub.memtest86; + params = concatStringsSep " " cfg.params; in { options = { - boot.loader.grub.memtest86 = mkOption { - default = false; - type = types.bool; - description = '' - Make Memtest86+, a memory testing program, available from the - GRUB boot menu. - ''; + boot.loader.grub.memtest86 = { + + enable = mkOption { + default = false; + type = types.bool; + description = '' + Make Memtest86+, a memory testing program, available from the + GRUB boot menu. + ''; + }; + + params = mkOption { + default = []; + example = [ "console=ttyS0,115200" ]; + type = types.listOf types.str; + description = '' + Parameters added to the Memtest86+ command line. As of memtest86+ 5.01 + the following list of (apparently undocumented) parameters are + accepted: + console=... -- set up a serial console. + btrace -- enable boot trace. + maxcpus=... -- limit number of CPUs. + onepass -- run one pass and exit if there are no errors. + tstlist=... -- list of tests to run. + cpumask=... -- set a CPU mask, to select CPUs to use for testing. + ''; + }; + }; }; - config = mkIf config.boot.loader.grub.memtest86 { + config = mkIf cfg.enable { boot.loader.grub.extraEntries = if config.boot.loader.grub.version == 2 then '' menuentry "Memtest86+" { - linux16 @bootRoot@/memtest.bin + linux16 @bootRoot@/memtest.bin ${params} } '' else |