Merge branch 'install-bootloader-flag'

Changed files
+21 -10
nixos
doc
modules
installer
system
boot
loader
+5 -6
nixos/doc/manual/man-nixos-rebuild.xml
···
</group>
<sbr />
<arg><option>--upgrade</option></arg>
-
<arg><option>--install-grub</option></arg>
+
<arg><option>--install-bootloader</option></arg>
<arg><option>--no-build-nix</option></arg>
<arg><option>--fast</option></arg>
<arg><option>--rollback</option></arg>
···
</varlistentry>
<varlistentry>
-
<term><option>--install-grub</option></term>
+
<term><option>--install-bootloader</option></term>
<listitem>
-
<para>Causes the GRUB boot loader to be (re)installed on the
-
device specified by the
-
<varname>boot.loader.grub.device</varname> configuration
-
option.</para>
+
<para>Causes the boot loader to be (re)installed on the
+
device specified by the relevant configuration options.
+
</para>
</listitem>
</varlistentry>
+1 -1
nixos/modules/installer/tools/nixos-install.sh
···
# configuration.
echo "finalising the installation..."
if [ -z "$noBootLoader" ]; then
-
NIXOS_INSTALL_GRUB=1 chroot $mountPoint \
+
NIXOS_INSTALL_BOOTLOADER=1 chroot $mountPoint \
/nix/var/nix/profiles/system/bin/switch-to-configuration boot
fi
+5 -1
nixos/modules/installer/tools/nixos-rebuild.sh
···
action="$i"
;;
--install-grub)
-
export NIXOS_INSTALL_GRUB=1
+
echo "$0: --install-grub deprecated, use --install-bootloader instead" >&2
+
export NIXOS_INSTALL_BOOTLOADER=1
+
;;
+
--install-bootloader)
+
export NIXOS_INSTALL_BOOTLOADER=1
;;
--no-build-nix)
buildNix=
+5 -1
nixos/modules/system/boot/loader/grub/install-grub.pl
···
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";
+5 -1
nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py
···
import glob
import tempfile
import errno
+
import warnings
def copy_if_not_exists(source, dest):
if not os.path.exists(dest):
···
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: