tpm2_ptool shell 脚本:如果 primary 不存在则创建
以下 shell 脚本检查 TPM 中是否存在 primary 对象。如果不存在,则使用 tpm2_ptool init 初始化 TPM。如果 primary 已存在,则仅输出一条消息表示已存在。
一个或多个 primary 是否存在并不重要;脚本只在没有找到任何 primary 时才进行初始化。
ensure_tpm_primary.sh
if [ -z "$(tpm2_ptool listprimaries)" ]; then
tpm2_ptool init
else
echo "Primary already exists"
fiCheck out similar posts by category:
Cryptography
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow