summarylogtreecommitdiffstats
path: root/hook
blob: 2d39c27aeec6c25058fb53fe544a93419d4958e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/ash

run_hook() {
    rootkey=$(mktemp)
    chmod 0000 "$rootkey"
   
    export GPG_TTY=/dev/console
    gpg --decrypt -o "$rootkey" --yes /rootkey.gpg

    # send the now decrypted key location to cryptsetup's encrypt hook
    cryptkey="rootfs:$rootkey"

    rm -rf /.gnupg
    /bin/killall gpg-agent scdaemon pcscd &> /dev/null
}
# vim: set ft=sh: