From 189a608cf5056df9228a7a7b4557eb5d4718e1ff Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Sun, 16 Dec 2007 18:56:36 +0000 Subject: [PATCH] Now copyKernels allows both /nix/store and /boot be on separate partitions (you need to specify where /boot is for this). svn path=/nixos/trunk/; revision=9949 --- installer/grub-menu-builder.sh | 5 +++++ system/options.nix | 11 +++++++++++ system/system.nix | 1 + 3 files changed, 17 insertions(+) diff --git a/installer/grub-menu-builder.sh b/installer/grub-menu-builder.sh index 7e1e6b4cad1..be4e5d26a5e 100644 --- a/installer/grub-menu-builder.sh +++ b/installer/grub-menu-builder.sh @@ -45,6 +45,11 @@ addEntry() { cp $initrd $initrd2 fi initrd=$initrd2 + + if test -n "@bootMount@"; then + kernel=$(echo $kernel2 | sed -e 's^/boot^@bootMount@^') + initrd=$(echo $initrd2 | sed -e 's^/boot^@bootMount@^') + fi fi local confName=$(if test -e $path/configuration-name; then diff --git a/system/options.nix b/system/options.nix index 75459045c48..fc0484bd239 100644 --- a/system/options.nix +++ b/system/options.nix @@ -53,6 +53,17 @@ "; }; + bootMount = mkOption { + default = ""; + example = "(hd0,0)"; + description = " + If the system partition may be wiped on reinstall, it is better + to have /boot on a small partition. To do it, we need to explain + to GRUB where the kernels live. Specify the partition here (in + GRUB notation. + "; + }; + kernel = mkOption { default = pkgs: pkgs.kernel; description = " diff --git a/system/system.nix b/system/system.nix index 311ddaf0a1e..922e14476d5 100644 --- a/system/system.nix +++ b/system/system.nix @@ -322,6 +322,7 @@ rec { path = [pkgs.coreutils pkgs.gnused pkgs.gnugrep]; copyKernels = config.boot.copyKernels; extraGrubEntries = config.boot.extraGrubEntries; + bootMount = config.boot.bootMount; };