2020-07-21 02:59:18 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
case "${1}" in
|
|
|
|
start)
|
|
|
|
printf 'Loading firmware signing key from Coreboot CBFS: '
|
|
|
|
mkdir -p /.gnupg
|
|
|
|
cbfs -r heads/initrd/.gnupg/pubring.kbx > /.gnupg/pubring.kbx
|
|
|
|
cbfs -r heads/initrd/.gnupg/trustdb.gpg > /.gnupg/trustdb.gpg
|
2020-08-12 03:23:25 +00:00
|
|
|
fingerprint=$( \
|
|
|
|
gpg \
|
|
|
|
--list-keys \
|
|
|
|
--list-options no-show-unusable-uids \
|
|
|
|
--with-colons \
|
|
|
|
| awk -F: '$1 == "fpr" {print $10;}' \
|
|
|
|
| head -n1 \
|
|
|
|
)
|
|
|
|
echo "export HEADS_KEY=${fingerprint}" >> /etc/environment
|
2020-07-21 02:59:18 +00:00
|
|
|
if [ $? -eq 0 ]; then
|
|
|
|
echo "OK"
|
|
|
|
else
|
|
|
|
echo "FAIL"
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Usage: ${0} {start}"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|