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 22:51:37 +01:00
|
|
|
{pkgs, config, ...}:
|
|
|
|
|
|
|
|
###### interface
|
|
|
|
let
|
|
|
|
inherit (pkgs.lib) mkOption mkIf;
|
|
|
|
|
|
|
|
options = {
|
|
|
|
boot = {
|
|
|
|
loader = {
|
|
|
|
generationsDir = {
|
|
|
|
|
|
|
|
enable = mkOption {
|
|
|
|
default = false;
|
|
|
|
description = ''
|
2011-01-29 23:07:02 +00: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.
|
|
|
|
|
2012-07-25 15:59:03 +01:00
|
|
|
This optional is not necessary with boot loaders such as GNU GRUB
|
2011-01-29 23:07:02 +00:00
|
|
|
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 22:51:37 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
copyKernels = mkOption {
|
|
|
|
default = false;
|
|
|
|
description = "
|
|
|
|
Whether copy the necessary boot files into /boot, so
|
2011-10-30 15:19:58 +00: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 22:51:37 +01: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 17:38:35 +00:00
|
|
|
# Temporary check, for nixos to cope both with nixpkgs stdenv-updates and trunk
|
2010-02-27 22:17:10 +00: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 22:51:37 +01:00
|
|
|
in
|
|
|
|
{
|
|
|
|
require = [
|
|
|
|
options
|
|
|
|
|
|
|
|
# config.system.build
|
|
|
|
# ../system/system-options.nix
|
|
|
|
];
|
|
|
|
|
|
|
|
system = mkIf config.boot.loader.generationsDir.enable {
|
2012-07-25 15:47:32 +01:00
|
|
|
build.installBootLoader = generationsDirBuilder;
|
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 22:51:37 +01:00
|
|
|
boot.loader.id = "generationsDir";
|
2010-02-27 22:17:10 +00: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 22:51:37 +01:00
|
|
|
};
|
|
|
|
}
|