nixpkgs/nixos/modules/system/boot/loader
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
..
generations-dir fix indentation in several nixos option descriptions 2016-12-16 18:29:25 +01:00
generic-extlinux-compatible extlinux-conf-builder: Choose whether to use DTBs on per-generation basis 2016-07-10 03:03:51 +03:00
grub grub module: add extraInitrd option 2017-02-19 10:50:22 +01:00
init-script init-script-builder: handle containers without a kernel 2016-02-10 23:27:28 +00:00
raspberrypi raspberryPi boot loader: don't remove xx-initrd files 2017-02-12 02:48:57 +02:00
systemd-boot systemd-boot: Unlink loader.conf if it exists 2017-02-20 14:54:48 +01:00
efi.nix Use systemd-boot instead of gummiboot 2016-05-31 17:02:47 +02:00
loader.nix nixos: loader: added generic config.boot.loader.timeout option 2015-01-30 09:53:44 +01:00