3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/modules/installer/grub/memtest.nix
Lluís Batlle i Rossell 918edf8612 I think this makes the memtest module work on grub1.
But I can't test it because grub-install fails for me for grub1.

I tested it works for grub2.


svn path=/nixos/trunk/; revision=33739
2012-04-10 22:20:20 +00:00

39 lines
811 B
Nix

# This module allows getting memtest86 in grub menus.
{config, pkgs, ...}:
with pkgs.lib;
let
isEnabled = config.boot.loader.grub.memtest86;
memtest86 = pkgs.memtest86;
in
{
options = {
boot.loader.grub.memtest86 = mkOption {
default = false;
type = types.bool;
description = ''
Add a menu entry in grub for memtest86+
'';
};
};
config.boot.loader.grub = mkIf isEnabled {
extraEntries = if config.boot.loader.grub.version == 2 then
''
menuentry "${memtest86.name}" {
linux16 $bootRoot/memtest.bin
}
''
else
''
menuentry "${memtest86.name}"
linux16 $bootRoot/memtest.bin
'';
extraPrepareConfig =
''
cp ${memtest86}/memtest.bin /boot/memtest.bin;
'';
};
}