2013-10-02 12:29:07 +02:00
|
|
|
# This module adds Memtest86+ to the GRUB boot menu.
|
2012-04-02 19:19:21 +02:00
|
|
|
|
2013-10-02 12:29:07 +02:00
|
|
|
{ config, pkgs, ... }:
|
2012-04-02 19:19:21 +02:00
|
|
|
|
|
|
|
with pkgs.lib;
|
2013-10-02 12:29:07 +02:00
|
|
|
|
2012-04-02 19:19:21 +02:00
|
|
|
let
|
2013-01-09 22:44:50 +01:00
|
|
|
memtest86 = pkgs.memtest86plus;
|
2012-04-02 19:19:21 +02:00
|
|
|
in
|
2013-10-02 12:29:07 +02:00
|
|
|
|
2012-04-02 19:19:21 +02:00
|
|
|
{
|
|
|
|
options = {
|
2013-10-02 12:29:07 +02:00
|
|
|
|
2012-04-02 19:19:21 +02:00
|
|
|
boot.loader.grub.memtest86 = mkOption {
|
|
|
|
default = false;
|
|
|
|
type = types.bool;
|
|
|
|
description = ''
|
2013-01-22 19:25:14 +01:00
|
|
|
Make Memtest86+, a memory testing program, available from the
|
2013-10-02 12:29:07 +02:00
|
|
|
GRUB boot menu.
|
2012-04-02 19:19:21 +02:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2013-10-02 12:29:07 +02:00
|
|
|
config = mkIf config.boot.loader.grub.memtest86 {
|
|
|
|
|
2013-10-07 11:32:28 +02:00
|
|
|
boot.loader.grub.extraEntries = mkFixStrictness (
|
2013-10-02 12:29:07 +02:00
|
|
|
if config.boot.loader.grub.version == 2 then
|
|
|
|
''
|
|
|
|
menuentry "Memtest86+" {
|
|
|
|
linux16 @bootRoot@/memtest.bin
|
|
|
|
}
|
|
|
|
''
|
2012-04-11 00:20:20 +02:00
|
|
|
else
|
2013-10-07 11:32:28 +02:00
|
|
|
throw "Memtest86+ is not supported with GRUB 1.");
|
2013-10-02 12:29:07 +02:00
|
|
|
|
|
|
|
boot.loader.grub.extraFiles."memtest.bin" = "${memtest86}/memtest.bin";
|
|
|
|
|
2012-04-02 19:19:21 +02:00
|
|
|
};
|
|
|
|
}
|