lol
fork

Configure Feed

Select the types of activity you want to include in your feed.

systemd-boot-builder: add missing fsync in atomic writes

write(2) and close(2) doesn't ensure the file content actually got synched, so let's also fsync before doing the rename

authored by

Jörg Thalheim and committed by
Jörg Thalheim
b7057368 83350226

+4
+4
nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py
··· 66 66 if not @editor@: 67 67 f.write("editor 0\n") 68 68 f.write("console-mode @consoleMode@\n") 69 + f.flush() 70 + os.fsync(f.fileno()) 69 71 os.rename("@efiSysMountPoint@/loader/loader.conf.tmp", "@efiSysMountPoint@/loader/loader.conf") 70 72 71 73 ··· 143 145 description=describe_generation(profile, generation, specialisation))) 144 146 if machine_id is not None: 145 147 f.write("machine-id %s\n" % machine_id) 148 + f.flush() 149 + os.fsync(f.fileno()) 146 150 os.rename(tmp_path, entry_file) 147 151 148 152