Merge branch 'install-bootloader-flag'
This commit is contained in:
commit
2942895d55
5 changed files with 21 additions and 10 deletions
|
@ -29,7 +29,7 @@
|
|||
</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>
|
||||
|
@ -212,12 +212,11 @@ $ ./result/bin/run-*-vm
|
|||
</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>
|
||||
|
||||
|
|
|
@ -260,7 +260,7 @@ touch $mountPoint/etc/NIXOS
|
|||
# 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
|
||||
|
||||
|
|
|
@ -33,7 +33,11 @@ while [ "$#" -gt 0 ]; do
|
|||
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=
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue