File tree Expand file tree Collapse file tree 1 file changed +6
-15
lines changed
Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Original file line number Diff line number Diff line change 7171 echo "Device is unlocked. Skipping..."
7272 exit 0
7373 fi
74- echo "Device is encrypted but NOT unlocked. Attempting recovery ..."
74+ echo "Device is encrypted but NOT unlocked. Handing off unlock to systemd-cryptsetup ..."
7575
7676 # Ensure marker exists
7777 mkdir -p /run
7878 touch /run/cryptsetup-pre-checked
7979
80- # Try to start the service
81- echo "Starting systemd-cryptsetup@crypted..."
82- systemctl start systemd-cryptsetup@crypted || true
83-
84- # Wait for it
85- for _ in {1..10}; do
86- if [ -e "/dev/mapper/crypted" ]; then
87- echo "Device unlocked successfully."
88- exit 0
89- fi
90- sleep 1
91- done
92- echo "Failed to unlock device automatically."
93- exit 1
80+ # Start unlock asynchronously and return immediately.
81+ # This avoids keeping tty-force attached while TPM2 PIN is requested.
82+ echo "Starting systemd-cryptsetup@crypted (non-blocking)..."
83+ systemctl start --no-block systemd-cryptsetup@crypted || true
84+ exit 0
9485 fi
9586
9687 # Check for installer/completion markers on the ESP partition.
You can’t perform that action at this time.
0 commit comments