forked from mirrors/nixpkgs
Adding a module for memtest86+, so if enabled, will appear in the grub menu.
To enable it: boot.loader.grub.memtest86 = true; svn path=/nixos/trunk/; revision=33539
This commit is contained in:
parent
9a13952494
commit
9a6f2231b2
|
@ -240,6 +240,7 @@ if test -n "$copyKernels"; then
|
|||
mkdir -p /boot/kernels
|
||||
fi
|
||||
|
||||
@extraPrepareConfig@
|
||||
|
||||
# Additional entries specified verbatim by the configuration.
|
||||
extraEntries=`cat <<EOF
|
||||
|
|
|
@ -12,7 +12,7 @@ let
|
|||
inherit grub;
|
||||
inherit (pkgs) bash;
|
||||
path = [pkgs.coreutils pkgs.gnused pkgs.gnugrep];
|
||||
inherit (config.boot.loader.grub) copyKernels
|
||||
inherit (config.boot.loader.grub) copyKernels extraPrepareConfig
|
||||
extraConfig extraEntries extraEntriesBeforeNixOS extraPerEntryConfig
|
||||
splashImage configurationLimit version default timeout;
|
||||
};
|
||||
|
@ -85,6 +85,14 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
extraPrepareConfig = mkOption {
|
||||
default = "";
|
||||
description = ''
|
||||
Additional bash commands to be run at the script that
|
||||
prepares the grub menu entries.
|
||||
'';
|
||||
};
|
||||
|
||||
extraConfig = mkOption {
|
||||
default = "";
|
||||
example = "serial; terminal_output.serial";
|
||||
|
|
33
modules/installer/grub/memtest.nix
Normal file
33
modules/installer/grub/memtest.nix
Normal file
|
@ -0,0 +1,33 @@
|
|||
# This module adds Memtest86 to the Grub boot menu on the CD. !!! It
|
||||
# would be nice if this also worked for normal configurations.
|
||||
|
||||
{config, pkgs, ...}:
|
||||
|
||||
with pkgs.lib;
|
||||
let
|
||||
isEnabled = config.boot.loader.grub.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 =
|
||||
''
|
||||
menuentry "Memtest86+" {
|
||||
linux16 $bootRoot/memtest.bin
|
||||
}
|
||||
'';
|
||||
extraPrepareConfig =
|
||||
''
|
||||
cp ${pkgs.memtest86}/memtest.bin /boot/memtest.bin;
|
||||
'';
|
||||
};
|
||||
}
|
|
@ -25,6 +25,7 @@
|
|||
./installer/efi-boot-stub/efi-boot-stub.nix
|
||||
./installer/generations-dir/generations-dir.nix
|
||||
./installer/grub/grub.nix
|
||||
./installer/grub/memtest.nix
|
||||
./installer/init-script/init-script.nix
|
||||
./installer/tools/nixos-checkout.nix
|
||||
./installer/tools/tools.nix
|
||||
|
|
Loading…
Reference in a new issue