summary refs log tree commit diff
path: root/nixos/modules/system/boot/luksroot.nix
diff options
context:
space:
mode:
authorHugo Lageneste <hugo.lageneste@pm.me>2021-03-08 21:17:42 +0100
committerArtturin <Artturin@artturin.com>2021-10-20 03:46:19 +0300
commite09fb63ffc96b5f600c400366ffbb5db562da5c7 (patch)
treebe3c738fc49e0cd034242aee9178b2208052d391 /nixos/modules/system/boot/luksroot.nix
parent37a9affe1bae825ab230e8ed197d0f4af0f11fb1 (diff)
downloadnixpkgs-e09fb63ffc96b5f600c400366ffbb5db562da5c7.tar
nixpkgs-e09fb63ffc96b5f600c400366ffbb5db562da5c7.tar.gz
nixpkgs-e09fb63ffc96b5f600c400366ffbb5db562da5c7.tar.bz2
nixpkgs-e09fb63ffc96b5f600c400366ffbb5db562da5c7.tar.lz
nixpkgs-e09fb63ffc96b5f600c400366ffbb5db562da5c7.tar.xz
nixpkgs-e09fb63ffc96b5f600c400366ffbb5db562da5c7.tar.zst
nixpkgs-e09fb63ffc96b5f600c400366ffbb5db562da5c7.zip
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.
Diffstat (limited to 'nixos/modules/system/boot/luksroot.nix')
-rw-r--r--nixos/modules/system/boot/luksroot.nix1
1 files changed, 1 insertions, 0 deletions
diff --git a/nixos/modules/system/boot/luksroot.nix b/nixos/modules/system/boot/luksroot.nix
index fb5269e43d0..f0d3170dc5a 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