making default and timeout of grub overridable

also updating grub option names to current names

svn path=/nixos/trunk/; revision=18886
This commit is contained in:
Marc Weber 2009-12-11 00:51:07 +00:00
parent 038180bab8
commit 086c3d6328
3 changed files with 22 additions and 7 deletions

View file

@ -68,8 +68,8 @@ let
# The configuration file for Grub.
grubCfg =
''
set default=0
set timeout=10
set default=${builtins.toString config.boot.loader.grub.default}
set timeout=${builtins.toString config.boot.loader.grub.timeout}
if loadfont /boot/grub/unicode.pf2; then
set gfxmode=640x480
@ -189,6 +189,7 @@ in
initrd /boot/initrd
}
'';
boot.loader.grub.timeout = 10;
# Create the ISO image.
system.build.isoImage = import ../../../lib/make-iso9660-image.nix {

View file

@ -41,8 +41,8 @@ prologue() {
1)
cat > "$1" << GRUBEND
# Automatically generated. DO NOT EDIT THIS FILE!
default 0
timeout 5
default @default@
timeout @timeout@
GRUBEND
if test -n "@splashImage@"; then
echo "splashimage $splashLocation" >> "$1"
@ -51,8 +51,8 @@ GRUBEND
2)
cat > "$1" <<EOF
# Automatically generated. DO NOT EDIT THIS FILE!
set default=0
set timeout=5
set default=@default@
set timeout=@timeout@
if loadfont @grub@/share/grub/unicode.pf2 ; then
set gfxmode=640x480
insmod gfxterm

View file

@ -13,7 +13,7 @@ let
inherit (pkgs) bash;
path = [pkgs.coreutils pkgs.gnused pkgs.gnugrep];
inherit (config.boot.loader.grub) copyKernels extraEntries extraEntriesBeforeNixOS
splashImage bootDevice configurationLimit version;
splashImage bootDevice configurationLimit version default timeout;
};
in
@ -126,6 +126,20 @@ in
'';
};
timeout = mkOption {
default = 5;
description = ''
after timeout seconds grub will boot the default menu item.
'';
};
default = mkOption {
default = 1;
description = ''
index of grub menu item which will be booted
'';
};
};
};