From ee24f8a4a9d0466ba6ef60a14ed26633abce7e8c Mon Sep 17 00:00:00 2001 From: ahtlon Date: Sat, 15 Nov 2025 15:43:34 +0100 Subject: [PATCH] change script to first import storage before unlocking root --- scripts/unlock-boot.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/unlock-boot.sh b/scripts/unlock-boot.sh index e9b4279..c6aa0d6 100644 --- a/scripts/unlock-boot.sh +++ b/scripts/unlock-boot.sh @@ -24,14 +24,16 @@ diskkey=$(sops -d machines/$hostname/secrets/disk.key) echo if [ $# = 1 ] then - echo "$diskkey" | ssh $sshoptions root@$hostname-initrd "systemd-tty-ask-password-agent" #root + ssh $sshoptions root@$hostname-initrd "zpool import -a" + echo "$diskkey" | ssh $sshoptions root@$hostname-initrd "zfs load-key storage/encrypted" #root echo "$diskkey" | ssh $sshoptions root@$hostname-initrd "systemd-tty-ask-password-agent" #data elif [ $# = 2 ] then ip=$2 - echo "$diskkey" | ssh $sshoptions root@$ip "systemd-tty-ask-password-agent" #root - echo "$diskkey" | ssh $sshoptions root@$ip "systemd-tty-ask-password-agent" #data + ssh $sshoptions root@$ip "zpool import -a" + echo "$diskkey" | ssh $sshoptions root@$ip "zfs load-key storage/encrypted" + echo "$diskkey" | ssh $sshoptions root@$ip "systemd-tty-ask-password-agent" else echo