Making modular my previous changes for armv5tel. I updated the way to use
grub. Its options are no more inside 'boot', but inside 'boot.loader.grub'.
I added a new bootloader configuration for nixos, generationsDir. It creates
/boot/default/{init,initrd,kernel,system} symlinks, and the same for the generations
in /boot/system-$gen/{init,initrd,kernel,system}.
I can program the u-boot loader to load /boot/default files always, and have
a minimal nixos boot loader installer functionality. Additionally, I can refer
to the other system generations easily, with a simple 'ls' in /boot.
svn path=/nixos/trunk/; revision=17460
2009-09-27 23:51:37 +02:00
|
|
|
{pkgs, config, ...}:
|
|
|
|
|
|
|
|
###### interface
|
|
|
|
let
|
|
|
|
inherit (pkgs.lib) mkOption mkIf;
|
|
|
|
|
|
|
|
options = {
|
|
|
|
boot = {
|
|
|
|
loader = {
|
|
|
|
generationsDir = {
|
|
|
|
|
|
|
|
enable = mkOption {
|
|
|
|
default = false;
|
|
|
|
description = ''
|
2011-01-30 00:07:02 +01:00
|
|
|
Whether to create symlinks to the system generations under
|
|
|
|
<literal>/boot</literal>. When enabled,
|
|
|
|
<literal>/boot/default/kernel</literal>,
|
|
|
|
<literal>/boot/default/initrd</literal>, etc., are updated to
|
|
|
|
point to the current generation's kernel image, initial RAM
|
|
|
|
disk, and other bootstrap files.
|
|
|
|
|
|
|
|
This optional is not necessary with bootloads such as GNU GRUB
|
|
|
|
for which the menu is updated to point to the latest bootstrap
|
|
|
|
files. However, it is needed for U-Boot on platforms where the
|
|
|
|
boot command line is stored in flash memory rather than in a
|
|
|
|
menu file.
|
Making modular my previous changes for armv5tel. I updated the way to use
grub. Its options are no more inside 'boot', but inside 'boot.loader.grub'.
I added a new bootloader configuration for nixos, generationsDir. It creates
/boot/default/{init,initrd,kernel,system} symlinks, and the same for the generations
in /boot/system-$gen/{init,initrd,kernel,system}.
I can program the u-boot loader to load /boot/default files always, and have
a minimal nixos boot loader installer functionality. Additionally, I can refer
to the other system generations easily, with a simple 'ls' in /boot.
svn path=/nixos/trunk/; revision=17460
2009-09-27 23:51:37 +02:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
copyKernels = mkOption {
|
|
|
|
default = false;
|
|
|
|
description = "
|
|
|
|
Whether copy the necessary boot files into /boot, so
|
2011-10-30 16:19:58 +01:00
|
|
|
/nix/store is not needed by the boot loadear.
|
Making modular my previous changes for armv5tel. I updated the way to use
grub. Its options are no more inside 'boot', but inside 'boot.loader.grub'.
I added a new bootloader configuration for nixos, generationsDir. It creates
/boot/default/{init,initrd,kernel,system} symlinks, and the same for the generations
in /boot/system-$gen/{init,initrd,kernel,system}.
I can program the u-boot loader to load /boot/default files always, and have
a minimal nixos boot loader installer functionality. Additionally, I can refer
to the other system generations easily, with a simple 'ls' in /boot.
svn path=/nixos/trunk/; revision=17460
2009-09-27 23:51:37 +02:00
|
|
|
";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
###### implementation
|
|
|
|
let
|
|
|
|
generationsDirBuilder = pkgs.substituteAll {
|
|
|
|
src = ./generations-dir-builder.sh;
|
|
|
|
isExecutable = true;
|
|
|
|
inherit (pkgs) bash;
|
|
|
|
path = [pkgs.coreutils pkgs.gnused pkgs.gnugrep];
|
|
|
|
inherit (config.boot.loader.generationsDir) copyKernels;
|
|
|
|
};
|
|
|
|
|
2009-11-08 18:38:35 +01:00
|
|
|
# Temporary check, for nixos to cope both with nixpkgs stdenv-updates and trunk
|
2010-02-27 23:17:10 +01:00
|
|
|
platform = pkgs.stdenv.platform;
|
Making modular my previous changes for armv5tel. I updated the way to use
grub. Its options are no more inside 'boot', but inside 'boot.loader.grub'.
I added a new bootloader configuration for nixos, generationsDir. It creates
/boot/default/{init,initrd,kernel,system} symlinks, and the same for the generations
in /boot/system-$gen/{init,initrd,kernel,system}.
I can program the u-boot loader to load /boot/default files always, and have
a minimal nixos boot loader installer functionality. Additionally, I can refer
to the other system generations easily, with a simple 'ls' in /boot.
svn path=/nixos/trunk/; revision=17460
2009-09-27 23:51:37 +02:00
|
|
|
in
|
|
|
|
{
|
|
|
|
require = [
|
|
|
|
options
|
|
|
|
|
|
|
|
# config.system.build
|
|
|
|
# ../system/system-options.nix
|
|
|
|
];
|
|
|
|
|
|
|
|
system = mkIf config.boot.loader.generationsDir.enable {
|
|
|
|
build = {
|
|
|
|
menuBuilder = generationsDirBuilder;
|
|
|
|
};
|
|
|
|
boot.loader.id = "generationsDir";
|
2010-02-27 23:17:10 +01:00
|
|
|
boot.loader.kernelFile = platform.kernelTarget;
|
Making modular my previous changes for armv5tel. I updated the way to use
grub. Its options are no more inside 'boot', but inside 'boot.loader.grub'.
I added a new bootloader configuration for nixos, generationsDir. It creates
/boot/default/{init,initrd,kernel,system} symlinks, and the same for the generations
in /boot/system-$gen/{init,initrd,kernel,system}.
I can program the u-boot loader to load /boot/default files always, and have
a minimal nixos boot loader installer functionality. Additionally, I can refer
to the other system generations easily, with a simple 'ls' in /boot.
svn path=/nixos/trunk/; revision=17460
2009-09-27 23:51:37 +02:00
|
|
|
};
|
|
|
|
}
|