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