anchor.diff:        ''}
       '';
   
  -    boot.initrd.preLVMCommands = commonFunctions + concatStrings (mapAttrsToList openCommand preLVM);
  -    boot.initrd.postDeviceCommands = commonFunctions + concatStrings (mapAttrsToList openCommand postLVM);
  +    boot.initrd.preFailCommands = postCommands;
  +    boot.initrd.preLVMCommands = commonFunctions + preCommands + concatStrings (mapAttrsToList openCommand preLVM) + postCommands;
  +    boot.initrd.postDeviceCommands = commonFunctions + preCommands + concatStrings (mapAttrsToList openCommand postLVM) + postCommands;
   
       environment.systemPackages = [ pkgs.cryptsetup ];
     };
  
positive.code:     # copy the cryptsetup binary and it's dependencies
      boot.initrd.extraUtilsCommands = ''
        copy_bin_and_libs ${pkgs.cryptsetup}/bin/cryptsetup
  
        cat > $out/bin/cryptsetup-askpass <<EOF
        #!$out/bin/sh -e
        if [ -e /.luksopen_args ]; then
          cryptsetup \$(cat /.luksopen_args)
          killall -q cryptsetup
        else
          echo "Passphrase is not requested now"
          exit 1
        fi
        EOF
        chmod +x $out/bin/cryptsetup-askpass
  
        ${optionalString luks.yubikeySupport ''
          copy_bin_and_libs ${pkgs.yubikey-personalization}/bin/ykchalresp
  
negative.code:         umount ${yubikey.storage.mountPoint}
      }
  
      open_yubikey() {
          if wait_yubikey ${toString yubikey.gracePeriod}; then
              do_open_yubikey
          else
              echo "No yubikey found, falling back to non-yubikey open procedure"
              open_normally
          fi
      }
  
      open_yubikey
      '' else ''
      open_normally
      ''}
    '';
  
    askPass = pkgs.writeScriptBin "cryptsetup-askpass" ''
      #!/bin/sh
  
      ${commonFunctions}
  
      while true; do
          wait_target "luks" /crypt-ramfs/device 10 "LUKS to request a passphrase" || die "Passphrase is not requested now"
          device=$(cat /crypt-ramfs/device)
  
          echo -n "Passphrase for $device: "
          IFS= read -rs passphrase
          echo
  
          rm /crypt-ramfs/device
          echo -n "$passphrase" > /crypt-ramfs/passphrase
      done
    '';
  
    preLVM = filterAttrs (n: v: v.preLVM) luks.devices;
  