git.iko.soy/typeable/nixpkgs
on master help sign in
Merge branch 'install-bootloader-flag'
commit2942895d552c30033d902553566a06334264d3e2 authorShea Levy <shea@shealevy.com> dateWed 17 Aug 2016, 21:16 (10 years ago) parent3367c21b4954a8
5 files changed+21−10
nixos/doc/manual/man-nixos-rebuild.xml+5−6 nixos/modules/installer/tools/nixos-install.sh+1−1 nixos/modules/installer/tools/nixos-rebuild.sh+5−1 nixos/modules/system/boot/loader/grub/install-grub.pl+5−1 nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py+5−1
nixos/doc/manual/man-nixos-rebuild.xml+5−6
@@ -29,7 +29,7 @@
2929 </group>
3030 <sbr />
3131 <arg><option>--upgrade</option></arg>
32− <arg><option>--install-grub</option></arg>
32+ <arg><option>--install-bootloader</option></arg>
3333 <arg><option>--no-build-nix</option></arg>
3434 <arg><option>--fast</option></arg>
3535 <arg><option>--rollback</option></arg>
@@ -212,12 +212,11 @@ $ ./result/bin/run-*-vm
212212 </varlistentry>
213213
214214 <varlistentry>
215− <term><option>--install-grub</option></term>
215+ <term><option>--install-bootloader</option></term>
216216 <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>
221220 </listitem>
222221 </varlistentry>
223222
nixos/modules/installer/tools/nixos-install.sh+1−1
@@ -260,7 +260,7 @@ touch $mountPoint/etc/NIXOS
260260# configuration.
261261echo "finalising the installation..."
262262if [ -z "$noBootLoader" ]; then
263− NIXOS_INSTALL_GRUB=1 chroot $mountPoint \
263+ NIXOS_INSTALL_BOOTLOADER=1 chroot $mountPoint \
264264 /nix/var/nix/profiles/system/bin/switch-to-configuration boot
265265fi
266266
nixos/modules/installer/tools/nixos-rebuild.sh+5−1
@@ -33,7 +33,11 @@ while [ "$#" -gt 0 ]; do
3333 action="$i"
3434 ;;
3535 --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
3741 ;;
3842 --no-build-nix)
3943 buildNix=
nixos/modules/system/boot/loader/grub/install-grub.pl+5−1
@@ -508,7 +508,11 @@ my $nameDiffer = get("fullName") ne $prevGrubState->name;
508508my $versionDiffer = get("fullVersion") ne $prevGrubState->version;
509509my $efiDiffer = $efiTarget ne $prevGrubState->efi;
510510my $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");
512516
513517# install a symlink so that grub can detect the boot drive
514518my $tmpDir = File::Temp::tempdir(CLEANUP => 1) or die "Failed to create temporary space";
nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py+5−1
@@ -7,6 +7,7 @@ import subprocess
77import glob
88import tempfile
99import errno
10+import warnings
1011
1112def copy_if_not_exists(source, dest):
1213 if not os.path.exists(dest):
@@ -92,8 +93,11 @@ parser = argparse.ArgumentParser(description='Update NixOS-related systemd-boot
9293parser.add_argument('default_config', metavar='DEFAULT-CONFIG', help='The default NixOS config to boot')
9394args = parser.parse_args()
9495
95−# We deserve our own env var!
9696if 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":
97101 if "@canTouchEfiVariables@" == "1":
98102 subprocess.check_call(["@systemd@/bin/bootctl", "--path=@efiSysMountPoint@", "install"])
99103 else: