2023-04-18 08:38:36 +00:00
|
|
|
# This module adds Memtest86+ to the GRUB boot menu.
|
2014-04-14 16:26:48 +02:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
2012-04-02 17:19:21 +00:00
|
|
|
|
2014-04-14 16:26:48 +02:00
|
|
|
with lib;
|
2013-10-02 12:29:07 +02:00
|
|
|
|
2012-04-02 17:19:21 +00:00
|
|
|
let
|
2013-01-09 22:44:50 +01:00
|
|
|
memtest86 = pkgs.memtest86plus;
|
2014-01-21 17:25:49 +01:00
|
|
|
cfg = config.boot.loader.grub.memtest86;
|
2012-04-02 17:19:21 +00:00
|
|
|
in
|
2013-10-02 12:29:07 +02:00
|
|
|
|
2012-04-02 17:19:21 +00:00
|
|
|
{
|
|
|
|
options = {
|
2013-10-02 12:29:07 +02:00
|
|
|
|
2014-01-21 17:25:49 +01:00
|
|
|
boot.loader.grub.memtest86 = {
|
|
|
|
|
|
|
|
enable = mkOption {
|
|
|
|
default = false;
|
|
|
|
type = types.bool;
|
|
|
|
description = ''
|
2023-04-18 08:38:36 +00:00
|
|
|
Make Memtest86+, a memory testing program, available from the GRUB
|
|
|
|
boot menu.
|
2014-01-21 17:25:49 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
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:
|
2014-02-09 13:43:12 +01:00
|
|
|
|
|
|
|
- `console=...`, set up a serial console.
|
|
|
|
Examples:
|
|
|
|
`console=ttyS0`,
|
|
|
|
`console=ttyS0,9600` or
|
|
|
|
`console=ttyS0,115200n8`.
|
|
|
|
|
|
|
|
- `btrace`, enable boot trace.
|
|
|
|
|
|
|
|
- `maxcpus=N`, limit number of CPUs.
|
|
|
|
|
|
|
|
- `onepass`, run one pass and exit if there
|
|
|
|
are no errors.
|
|
|
|
|
|
|
|
- `tstlist=...`, list of tests to run.
|
|
|
|
Example: `0,1,2`.
|
|
|
|
|
|
|
|
- `cpumask=...`, set a CPU mask, to select CPUs
|
|
|
|
to use for testing.
|
|
|
|
|
|
|
|
This list of command line options was obtained by reading the
|
|
|
|
Memtest86+ source code.
|
2014-01-21 17:25:49 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2012-04-02 17:19:21 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-04-18 08:38:36 +00:00
|
|
|
config = mkIf cfg.enable {
|
|
|
|
boot.loader.grub.extraEntries = ''
|
|
|
|
menuentry "Memtest86+" {
|
|
|
|
linux @bootRoot@/memtest.bin ${toString cfg.params}
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
boot.loader.grub.extraFiles."memtest.bin" = "${memtest86}/memtest.bin";
|
|
|
|
};
|
2012-04-02 17:19:21 +00:00
|
|
|
}
|