nixos/memtest: Allow user to specify memtest86 boot parameters
This commit is contained in:
parent
c3df9e21c0
commit
cba2444d11
@ -36,7 +36,7 @@ with pkgs.lib;
|
|||||||
isoImage.makeEfiBootable = true;
|
isoImage.makeEfiBootable = true;
|
||||||
|
|
||||||
# Add Memtest86+ to the CD.
|
# Add Memtest86+ to the CD.
|
||||||
boot.loader.grub.memtest86 = true;
|
boot.loader.grub.memtest86.enable = true;
|
||||||
|
|
||||||
# Get a console as soon as the initrd loads fbcon on EFI boot
|
# Get a console as soon as the initrd loads fbcon on EFI boot
|
||||||
boot.initrd.kernelModules = [ "fbcon" ];
|
boot.initrd.kernelModules = [ "fbcon" ];
|
||||||
|
@ -6,12 +6,16 @@ with pkgs.lib;
|
|||||||
|
|
||||||
let
|
let
|
||||||
memtest86 = pkgs.memtest86plus;
|
memtest86 = pkgs.memtest86plus;
|
||||||
|
cfg = config.boot.loader.grub.memtest86;
|
||||||
|
params = concatStringsSep " " cfg.params;
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
|
|
||||||
boot.loader.grub.memtest86 = mkOption {
|
boot.loader.grub.memtest86 = {
|
||||||
|
|
||||||
|
enable = mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
description = ''
|
description = ''
|
||||||
@ -19,15 +23,34 @@ in
|
|||||||
GRUB boot menu.
|
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 =
|
boot.loader.grub.extraEntries =
|
||||||
if config.boot.loader.grub.version == 2 then
|
if config.boot.loader.grub.version == 2 then
|
||||||
''
|
''
|
||||||
menuentry "Memtest86+" {
|
menuentry "Memtest86+" {
|
||||||
linux16 @bootRoot@/memtest.bin
|
linux16 @bootRoot@/memtest.bin ${params}
|
||||||
}
|
}
|
||||||
''
|
''
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user