From e09fb63ffc96b5f600c400366ffbb5db562da5c7 Mon Sep 17 00:00:00 2001 From: Hugo Lageneste Date: Mon, 8 Mar 2021 21:17:42 +0100 Subject: [PATCH] nixos/luksroot: sync the crypt-storage Add a sync command just after writing to the /crypt-storage file in order to reduce the possibilities of corruption errors. --- nixos/modules/system/boot/luksroot.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/modules/system/boot/luksroot.nix b/nixos/modules/system/boot/luksroot.nix index fb5269e43d08..f0d3170dc5ac 100644 --- a/nixos/modules/system/boot/luksroot.nix +++ b/nixos/modules/system/boot/luksroot.nix @@ -332,6 +332,7 @@ let if [ $? == 0 ]; then echo -ne "$new_salt\n$new_iterations" > /crypt-storage${dev.yubikey.storage.path} + sync /crypt-storage${dev.yubikey.storage.path} else echo "Warning: Could not update LUKS key, current challenge persists!" fi