diff options
author | Shea Levy <shea@shealevy.com> | 2016-08-17 21:16:29 -0400 |
---|---|---|
committer | Shea Levy <shea@shealevy.com> | 2016-08-17 21:16:29 -0400 |
commit | 2942895d552c30033d902553566a06334264d3e2 (patch) | |
tree | 36a5ce192cdbae329a75d5909f9ead1ccd25ab38 /nixos/modules/system | |
parent | 3367c211c684c7399609de9f1605ca8a7037bcee (diff) | |
parent | b4954a8f3802ba545933905428a4288622f28294 (diff) | |
download | nixlib-2942895d552c30033d902553566a06334264d3e2.tar nixlib-2942895d552c30033d902553566a06334264d3e2.tar.gz nixlib-2942895d552c30033d902553566a06334264d3e2.tar.bz2 nixlib-2942895d552c30033d902553566a06334264d3e2.tar.lz nixlib-2942895d552c30033d902553566a06334264d3e2.tar.xz nixlib-2942895d552c30033d902553566a06334264d3e2.tar.zst nixlib-2942895d552c30033d902553566a06334264d3e2.zip |
Merge branch 'install-bootloader-flag'
Diffstat (limited to 'nixos/modules/system')
-rw-r--r-- | nixos/modules/system/boot/loader/grub/install-grub.pl | 6 | ||||
-rw-r--r-- | nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/nixos/modules/system/boot/loader/grub/install-grub.pl b/nixos/modules/system/boot/loader/grub/install-grub.pl index 94d87b436065..4fa157641a4a 100644 --- a/nixos/modules/system/boot/loader/grub/install-grub.pl +++ b/nixos/modules/system/boot/loader/grub/install-grub.pl @@ -508,7 +508,11 @@ my $nameDiffer = get("fullName") ne $prevGrubState->name; my $versionDiffer = get("fullVersion") ne $prevGrubState->version; my $efiDiffer = $efiTarget ne $prevGrubState->efi; my $efiMountPointDiffer = $efiSysMountPoint ne $prevGrubState->efiMountPoint; -my $requireNewInstall = $devicesDiffer || $nameDiffer || $versionDiffer || $efiDiffer || $efiMountPointDiffer || (($ENV{'NIXOS_INSTALL_GRUB'} // "") eq "1"); +if (($ENV{'NIXOS_INSTALL_GRUB'} // "") eq "1") { + warn "NIXOS_INSTALL_GRUB env var deprecated, use NIXOS_INSTALL_BOOTLOADER"; + $ENV{'NIXOS_INSTALL_BOOTLOADER'} = "1"; +} +my $requireNewInstall = $devicesDiffer || $nameDiffer || $versionDiffer || $efiDiffer || $efiMountPointDiffer || (($ENV{'NIXOS_INSTALL_BOOTLOADER'} // "") eq "1"); # install a symlink so that grub can detect the boot drive my $tmpDir = File::Temp::tempdir(CLEANUP => 1) or die "Failed to create temporary space"; diff --git a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py index c38af1b67f17..c703a3e083ba 100644 --- a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py +++ b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py @@ -7,6 +7,7 @@ import subprocess import glob import tempfile import errno +import warnings def copy_if_not_exists(source, dest): if not os.path.exists(dest): @@ -92,8 +93,11 @@ parser = argparse.ArgumentParser(description='Update NixOS-related systemd-boot parser.add_argument('default_config', metavar='DEFAULT-CONFIG', help='The default NixOS config to boot') args = parser.parse_args() -# We deserve our own env var! if os.getenv("NIXOS_INSTALL_GRUB") == "1": + warnings.warn("NIXOS_INSTALL_GRUB env var deprecated, use NIXOS_INSTALL_BOOTLOADER", DeprecationWarning) + os.environ["NIXOS_INSTALL_BOOTLOADER"] = "1" + +if os.getenv("NIXOS_INSTALL_BOOTLOADER") == "1": if "@canTouchEfiVariables@" == "1": subprocess.check_call(["@systemd@/bin/bootctl", "--path=@efiSysMountPoint@", "install"]) else: |