0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-14 06:00:33 +03:00

Use systemd-boot instead of gummiboot

Gummiboot is part of systemd now so we may as well use it.
This commit is contained in:
Eelco Dolstra 2016-05-31 16:52:40 +02:00
parent 66d5ca6f42
commit f222689aba
5 changed files with 10 additions and 12 deletions

View file

@ -4,19 +4,16 @@ with lib;
{ {
options.boot.loader.efi = { options.boot.loader.efi = {
canTouchEfiVariables = mkOption { canTouchEfiVariables = mkOption {
default = false; default = false;
type = types.bool; type = types.bool;
description = "Whether the installation process is allowed to modify EFI boot variables.";
description = "Whether or not the installation process should modify efi boot variables.";
}; };
efiSysMountPoint = mkOption { efiSysMountPoint = mkOption {
default = "/boot"; default = "/boot";
type = types.str; type = types.str;
description = "Where the EFI System Partition is mounted."; description = "Where the EFI System Partition is mounted.";
}; };
}; };

View file

@ -488,7 +488,7 @@ in
} }
{ {
assertion = if args.efiSysMountPoint == null then true else hasPrefix "/" args.efiSysMountPoint; assertion = if args.efiSysMountPoint == null then true else hasPrefix "/" args.efiSysMountPoint;
message = "Efi paths must be absolute, not ${args.efiSysMountPoint}"; message = "EFI paths must be absolute, not ${args.efiSysMountPoint}";
} }
] ++ flip map args.devices (device: { ] ++ flip map args.devices (device: {
assertion = device == "nodev" || hasPrefix "/" device; assertion = device == "nodev" || hasPrefix "/" device;

View file

@ -88,16 +88,16 @@ def remove_old_entries(gens):
if not path in known_paths: if not path in known_paths:
os.unlink(path) os.unlink(path)
parser = argparse.ArgumentParser(description='Update NixOS-related gummiboot files') parser = argparse.ArgumentParser(description='Update NixOS-related systemd-boot files')
parser.add_argument('default_config', metavar='DEFAULT-CONFIG', help='The default NixOS config to boot') parser.add_argument('default_config', metavar='DEFAULT-CONFIG', help='The default NixOS config to boot')
args = parser.parse_args() args = parser.parse_args()
# We deserve our own env var! # We deserve our own env var!
if os.getenv("NIXOS_INSTALL_GRUB") == "1": if os.getenv("NIXOS_INSTALL_GRUB") == "1":
if "@canTouchEfiVariables@" == "1": if "@canTouchEfiVariables@" == "1":
subprocess.check_call(["@gummiboot@/bin/gummiboot", "--path=@efiSysMountPoint@", "install"]) subprocess.check_call(["@systemd@/bin/bootctl", "--path=@efiSysMountPoint@", "install"])
else: else:
subprocess.check_call(["@gummiboot@/bin/gummiboot", "--path=@efiSysMountPoint@", "--no-variables", "install"]) subprocess.check_call(["@systemd@/bin/bootctl", "--path=@efiSysMountPoint@", "--no-variables", "install"])
mkdir_p("@efiSysMountPoint@/efi/nixos") mkdir_p("@efiSysMountPoint@/efi/nixos")
mkdir_p("@efiSysMountPoint@/loader/entries") mkdir_p("@efiSysMountPoint@/loader/entries")

View file

@ -12,7 +12,9 @@ let
isExecutable = true; isExecutable = true;
inherit (pkgs) python gummiboot; inherit (pkgs) python;
systemd = config.systemd.package;
nix = config.nix.package.out; nix = config.nix.package.out;
@ -27,7 +29,7 @@ in {
type = types.bool; type = types.bool;
description = "Whether to enable the gummiboot UEFI boot manager"; description = "Whether to enable the systemd-boot (formerly gummiboot) EFI boot manager";
}; };
}; };

View file

@ -208,7 +208,6 @@ let
pkgs.unionfs-fuse pkgs.unionfs-fuse
pkgs.ntp pkgs.ntp
pkgs.nixos-artwork pkgs.nixos-artwork
pkgs.gummiboot
pkgs.perlPackages.XMLLibXML pkgs.perlPackages.XMLLibXML
pkgs.perlPackages.ListCompare pkgs.perlPackages.ListCompare
] ]