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

View File

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

View File

@ -13,7 +13,7 @@ let
inherit (pkgs) bash; inherit (pkgs) bash;
path = [pkgs.coreutils pkgs.gnused pkgs.gnugrep]; path = [pkgs.coreutils pkgs.gnused pkgs.gnugrep];
inherit (config.boot.loader.grub) copyKernels extraEntries extraEntriesBeforeNixOS inherit (config.boot.loader.grub) copyKernels extraEntries extraEntriesBeforeNixOS
splashImage bootDevice configurationLimit version; splashImage bootDevice configurationLimit version default timeout;
}; };
in 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
'';
};
}; };
}; };