summary refs log tree commit diff
path: root/nixos/modules/system/boot/loader/systemd-boot
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2017-05-10 10:31:01 +0100
committerJörg Thalheim <joerg@thalheim.io>2017-05-10 10:32:26 +0100
commite33848568d3321c4f042d8352168a8cf006646e6 (patch)
tree263e96d2ef85c36c033dc3a26f816964199bbb0e /nixos/modules/system/boot/loader/systemd-boot
parent2f6437393b33d6a32a2110d4e63f8420754c7a2f (diff)
downloadnixlib-e33848568d3321c4f042d8352168a8cf006646e6.tar
nixlib-e33848568d3321c4f042d8352168a8cf006646e6.tar.gz
nixlib-e33848568d3321c4f042d8352168a8cf006646e6.tar.bz2
nixlib-e33848568d3321c4f042d8352168a8cf006646e6.tar.lz
nixlib-e33848568d3321c4f042d8352168a8cf006646e6.tar.xz
nixlib-e33848568d3321c4f042d8352168a8cf006646e6.tar.zst
nixlib-e33848568d3321c4f042d8352168a8cf006646e6.zip
systemd-boot: document reasoning behind syncfs(2)
Diffstat (limited to 'nixos/modules/system/boot/loader/systemd-boot')
-rw-r--r--nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py
index 804b710f3759..cb2a17f18f48 100644
--- a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py
+++ b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py
@@ -148,6 +148,10 @@ def main():
         if os.readlink(system_dir(gen)) == args.default_config:
             write_loader_conf(gen)
 
+    # Since fat32 provides little recovery facilities after a crash,
+    # it can leave the system in an unbootable state, when a crash/outage
+    # happens shortly after an update. To decrease the likelihood of this
+    # event sync the efi filesystem after each update.
     rc = libc.syncfs(os.open("@efiSysMountPoint@", os.O_RDONLY))
     if rc != 0:
         print("could not sync @efiSysMountPoint@: {}".format(os.strerror(rc)), file=sys.stderr)