about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2017-05-10 09:05:09 +0100
committerGitHub <noreply@github.com>2017-05-10 09:05:09 +0100
commit98ff062ed4bf7b01ac07b22890694ebf05ec4ef5 (patch)
treeb976a97972b4d138cdf52ca4317b659637d71e11 /nixos
parentcb133234d7333868017ca9dc216b16556133e16d (diff)
parente3beb0710836deab2f4e366b4681e5a04c1107a8 (diff)
downloadnixlib-98ff062ed4bf7b01ac07b22890694ebf05ec4ef5.tar
nixlib-98ff062ed4bf7b01ac07b22890694ebf05ec4ef5.tar.gz
nixlib-98ff062ed4bf7b01ac07b22890694ebf05ec4ef5.tar.bz2
nixlib-98ff062ed4bf7b01ac07b22890694ebf05ec4ef5.tar.lz
nixlib-98ff062ed4bf7b01ac07b22890694ebf05ec4ef5.tar.xz
nixlib-98ff062ed4bf7b01ac07b22890694ebf05ec4ef5.tar.zst
nixlib-98ff062ed4bf7b01ac07b22890694ebf05ec4ef5.zip
Merge pull request #25650 from Mic92/systemd-boot
systemd-boot: sync efi filesystem after update
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py7
1 files changed, 7 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 704c574b822e..804b710f3759 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
@@ -2,12 +2,15 @@
 import argparse
 import shutil
 import os
+import sys
 import errno
 import subprocess
 import glob
 import tempfile
 import errno
 import warnings
+import ctypes
+libc = ctypes.CDLL("libc.so.6")
 
 def copy_if_not_exists(source, dest):
     if not os.path.exists(dest):
@@ -145,5 +148,9 @@ def main():
         if os.readlink(system_dir(gen)) == args.default_config:
             write_loader_conf(gen)
 
+    rc = libc.syncfs(os.open("@efiSysMountPoint@", os.O_RDONLY))
+    if rc != 0:
+        print("could not sync @efiSysMountPoint@: {}".format(os.strerror(rc)), file=sys.stderr)
+
 if __name__ == '__main__':
     main()