nixpkgs/nixos/modules/system/boot
aszlig dc31a1ea29
systemd-boot: Unlink loader.conf if it exists
Since systemd version 232 the install subcommand of bootctl opens the
loader.conf with fopen() modes "wxe", where the "e" stands for
exclusive, so the call will fail if the file exists.

For installing the boot loader just once this is fine, but if we're
using NIXOS_INSTALL_BOOTLOADER on a systemd where the bootloader is
already present this will fail.

Exactly this is done within the simpleUefiGummiboot installer test,
where nixos-install is called twice and thus the bootloader is also
installed twice, resulting in an error during the fopen call:

Failed to open loader.conf for writing: File exists

Removing the file prior to calling bootctl should fix this.

I've tested this using the installer.simpleUefiGummiboot test and it now
succeeds.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Cc: @edolstra, @shlevy, @mic92
Fixes: #22925
2017-02-20 14:54:48 +01:00
..
loader systemd-boot: Unlink loader.conf if it exists 2017-02-20 14:54:48 +01:00
coredump.nix systemd-coredump: Add systemd service and fix sysctl pattern. 2016-07-10 18:07:37 +10:00
emergency-mode.nix nixos: tmp on tmpfs option 2014-07-30 16:19:26 +02:00
initrd-network.nix initrd-network: call postCommands only if network is up 2016-02-03 16:35:21 +03:00
initrd-ssh.nix initrd-ssh: fix authorized_key generation with multiple keys 2016-11-16 14:47:37 +00:00
kernel.nix fix comments about nixos-hardware-scan 2017-02-18 13:29:47 +01:00
kexec.nix Move all of NixOS to nixos/ in preparation of the repository merge 2013-10-10 13:28:20 +02:00
luksroot.nix luksroot module: optionSet -> submodule 2016-09-13 12:53:13 +09:00
modprobe.nix nixos treewide: don't set MODULE_DIR 2016-08-19 17:56:54 +03:00
networkd.nix networking.networkd: adjust autmatic mapping of bonds 2017-02-16 21:24:40 +01:00
pbkdf2-sha512.c Update to the Yubikey PBA 2014-02-08 14:59:52 +01:00
plymouth.nix nixos/modules: use defaultText where applicable 2016-11-21 16:35:15 +01:00
readonly-mountpoint.c Move all of NixOS to nixos/ in preparation of the repository merge 2013-10-10 13:28:20 +02:00
resolved.nix systemd: 231 -> 232 2017-01-26 17:52:52 +01:00
shutdown.nix Don't run hwclock if /dev/rtc doesn't exist 2014-05-05 16:47:51 +02:00
stage-1-init.sh Fix using ephemeral disks for /tmp etc. in EC2 instances 2017-01-03 17:32:42 +01:00
stage-1.nix runCommand: Use stdenvNoCC 2016-09-29 13:06:43 +02:00
stage-2-init.sh Revert "nixos/stage2: Check for each special mount individually and mount missing ones. (#21370)" 2017-01-10 17:35:38 +01:00
stage-2.nix nixos filesystems: unify early filesystems handling 2016-08-27 13:38:20 +03:00
systemd-lib.nix systemd service: add aliases option 2017-02-02 00:52:54 +03:00
systemd-nspawn.nix nspawn module: optionSet -> submodule 2016-10-21 01:31:54 +09:00
systemd-unit-options.nix systemd service: add aliases option 2017-02-02 00:52:54 +03:00
systemd.nix systemd service: don't install systemd-hwdb-update 2017-02-08 21:42:07 +03:00
timesyncd.nix ntp: make timesyncd the new default 2016-12-17 00:00:45 +01:00
tmp.nix nixos: tmp on tmpfs option 2014-07-30 16:19:26 +02:00