Merge branch 'install-bootloader-flag'

+21 -10
+5 -6
nixos/doc/manual/man-nixos-rebuild.xml
··· 29 29 </group> 30 30 <sbr /> 31 31 <arg><option>--upgrade</option></arg> 32 - <arg><option>--install-grub</option></arg> 32 + <arg><option>--install-bootloader</option></arg> 33 33 <arg><option>--no-build-nix</option></arg> 34 34 <arg><option>--fast</option></arg> 35 35 <arg><option>--rollback</option></arg> ··· 212 212 </varlistentry> 213 213 214 214 <varlistentry> 215 - <term><option>--install-grub</option></term> 215 + <term><option>--install-bootloader</option></term> 216 216 <listitem> 217 - <para>Causes the GRUB boot loader to be (re)installed on the 218 - device specified by the 219 - <varname>boot.loader.grub.device</varname> configuration 220 - option.</para> 217 + <para>Causes the boot loader to be (re)installed on the 218 + device specified by the relevant configuration options. 219 + </para> 221 220 </listitem> 222 221 </varlistentry> 223 222
+1 -1
nixos/modules/installer/tools/nixos-install.sh
··· 260 260 # configuration. 261 261 echo "finalising the installation..." 262 262 if [ -z "$noBootLoader" ]; then 263 - NIXOS_INSTALL_GRUB=1 chroot $mountPoint \ 263 + NIXOS_INSTALL_BOOTLOADER=1 chroot $mountPoint \ 264 264 /nix/var/nix/profiles/system/bin/switch-to-configuration boot 265 265 fi 266 266
+5 -1
nixos/modules/installer/tools/nixos-rebuild.sh
··· 33 33 action="$i" 34 34 ;; 35 35 --install-grub) 36 - export NIXOS_INSTALL_GRUB=1 36 + echo "$0: --install-grub deprecated, use --install-bootloader instead" >&2 37 + export NIXOS_INSTALL_BOOTLOADER=1 38 + ;; 39 + --install-bootloader) 40 + export NIXOS_INSTALL_BOOTLOADER=1 37 41 ;; 38 42 --no-build-nix) 39 43 buildNix=
+5 -1
nixos/modules/system/boot/loader/grub/install-grub.pl
··· 508 508 my $versionDiffer = get("fullVersion") ne $prevGrubState->version; 509 509 my $efiDiffer = $efiTarget ne $prevGrubState->efi; 510 510 my $efiMountPointDiffer = $efiSysMountPoint ne $prevGrubState->efiMountPoint; 511 - my $requireNewInstall = $devicesDiffer || $nameDiffer || $versionDiffer || $efiDiffer || $efiMountPointDiffer || (($ENV{'NIXOS_INSTALL_GRUB'} // "") eq "1"); 511 + if (($ENV{'NIXOS_INSTALL_GRUB'} // "") eq "1") { 512 + warn "NIXOS_INSTALL_GRUB env var deprecated, use NIXOS_INSTALL_BOOTLOADER"; 513 + $ENV{'NIXOS_INSTALL_BOOTLOADER'} = "1"; 514 + } 515 + my $requireNewInstall = $devicesDiffer || $nameDiffer || $versionDiffer || $efiDiffer || $efiMountPointDiffer || (($ENV{'NIXOS_INSTALL_BOOTLOADER'} // "") eq "1"); 512 516 513 517 # install a symlink so that grub can detect the boot drive 514 518 my $tmpDir = File::Temp::tempdir(CLEANUP => 1) or die "Failed to create temporary space";
+5 -1
nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py
··· 7 7 import glob 8 8 import tempfile 9 9 import errno 10 + import warnings 10 11 11 12 def copy_if_not_exists(source, dest): 12 13 if not os.path.exists(dest): ··· 92 93 parser.add_argument('default_config', metavar='DEFAULT-CONFIG', help='The default NixOS config to boot') 93 94 args = parser.parse_args() 94 95 95 - # We deserve our own env var! 96 96 if os.getenv("NIXOS_INSTALL_GRUB") == "1": 97 + warnings.warn("NIXOS_INSTALL_GRUB env var deprecated, use NIXOS_INSTALL_BOOTLOADER", DeprecationWarning) 98 + os.environ["NIXOS_INSTALL_BOOTLOADER"] = "1" 99 + 100 + if os.getenv("NIXOS_INSTALL_BOOTLOADER") == "1": 97 101 if "@canTouchEfiVariables@" == "1": 98 102 subprocess.check_call(["@systemd@/bin/bootctl", "--path=@efiSysMountPoint@", "install"]) 99 103 else: