From a65b5ec81c699b21fc635ce909332dcda4346027 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 16 Jun 2010 22:18:26 +0000 Subject: [PATCH] * Added an option boot.loader.grub.extraConfig to add commands to grub.cfg before the menu entries. (This could also be done using `extraEntriesBeforeNixOS', but then you can't have entries *after* the main entry anymore.) * In the installer test, redirect GRUB output to the serial port. svn path=/nixos/branches/boot-order/; revision=22300 --- modules/installer/grub/grub-menu-builder.sh | 4 ++++ modules/installer/grub/grub.nix | 12 +++++++++++- tests/installer.nix | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/modules/installer/grub/grub-menu-builder.sh b/modules/installer/grub/grub-menu-builder.sh index cf2041002e74..ecb69ceb263f 100644 --- a/modules/installer/grub/grub-menu-builder.sh +++ b/modules/installer/grub/grub-menu-builder.sh @@ -216,6 +216,10 @@ extraEntries=`cat <> $tmp <> $tmp fi diff --git a/modules/installer/grub/grub.nix b/modules/installer/grub/grub.nix index 4217e0d481c4..40c2ca606751 100644 --- a/modules/installer/grub/grub.nix +++ b/modules/installer/grub/grub.nix @@ -12,7 +12,8 @@ let inherit grub; inherit (pkgs) bash; path = [pkgs.coreutils pkgs.gnused pkgs.gnugrep]; - inherit (config.boot.loader.grub) copyKernels extraEntries extraEntriesBeforeNixOS + inherit (config.boot.loader.grub) copyKernels + extraConfig extraEntries extraEntriesBeforeNixOS splashImage configurationLimit version default timeout; }; @@ -67,6 +68,15 @@ in ''; }; + extraConfig = mkOption { + default = ""; + example = "serial; terminal_output.serial"; + description = '' + Additional GRUB commands inserted in the configuration file + just before the menu entries. + ''; + }; + extraEntries = mkOption { default = ""; example = '' diff --git a/tests/installer.nix b/tests/installer.nix index a15b5587511b..1f9ada808b26 100644 --- a/tests/installer.nix +++ b/tests/installer.nix @@ -40,6 +40,7 @@ let boot.loader.grub.version = 2; boot.loader.grub.device = "/dev/vda"; + boot.loader.grub.extraConfig = "serial; terminal_output.serial"; boot.initrd.kernelModules = [ "ext3" ]; fileSystems = [ ${fileSystems} ];