Skip to content

Commit

Permalink
fix(sztp): add generate script for config
Browse files Browse the repository at this point in the history
Signed-off-by: Boris Glimcher <36732377+glimchb@users.noreply.github.com>
  • Loading branch information
glimchb authored Jun 6, 2024
1 parent 34e864b commit 6fae0a9
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions sztp/generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/bash

set -euxo pipefail

NVIDIA_BOOT_IMG_HASH_VAL=`openssl dgst -sha256 -c nvidia-boot-image.img | awk '{print $2}'` \
NVIDIA_PRE_SCRIPT_B64=`openssl enc -base64 -A -in nvidia-pre-configuration-script.sh` \
NVIDIA_POST_SCRIPT_B64=`openssl enc -base64 -A -in nvidia-post-configuration-script.sh` \
NVIDIA_CONFIG_B64=`openssl enc -base64 -A -in nvidia-configuration.xml` \
INTEL_BOOT_IMG_HASH_VAL=`openssl dgst -sha256 -c intel-boot-image.img | awk '{print $2}'` \
INTEL_PRE_SCRIPT_B64=`openssl enc -base64 -A -in intel-pre-configuration-script.sh` \
INTEL_POST_SCRIPT_B64=`openssl enc -base64 -A -in intel-post-configuration-script.sh` \
INTEL_CONFIG_B64=`openssl enc -base64 -A -in intel-configuration.xml` \
MARVELL_BOOT_IMG_HASH_VAL=`openssl dgst -sha256 -c marvell-boot-image.img | awk '{print $2}'` \
MARVELL_PRE_SCRIPT_B64=`openssl enc -base64 -A -in marvell-pre-configuration-script.sh` \
MARVELL_POST_SCRIPT_B64=`openssl enc -base64 -A -in marvell-post-configuration-script.sh` \
MARVELL_CONFIG_B64=`openssl enc -base64 -A -in marvell-configuration.xml` \
SBI_PRI_KEY_B64=`openssl enc -base64 -A -in private_key.der` \
SBI_PUB_KEY_B64=`openssl enc -base64 -A -in public_key.der` \
SBI_EE_CERT_B64=`openssl enc -base64 -A -in cert_chain.cms` \
CLIENT_CERT_TA_B64=`openssl enc -base64 -A -in ta_cert_chain.cms` \
envsubst '$NVIDIA_BOOT_IMG_HASH_VAL,$NVIDIA_PRE_SCRIPT_B64,$NVIDIA_POST_SCRIPT_B64,$NVIDIA_CONFIG_B64,$INTEL_BOOT_IMG_HASH_VAL,$INTEL_PRE_SCRIPT_B64,$INTEL_POST_SCRIPT_B64,$INTEL_CONFIG_B64,$MARVELL_BOOT_IMG_HASH_VAL,$MARVELL_PRE_SCRIPT_B64,$MARVELL_POST_SCRIPT_B64,$MARVELL_CONFIG_B64,$CLIENT_CERT_TA_B64,$SBI_PRI_KEY_B64,$SBI_PUB_KEY_B64,$SBI_EE_CERT_B64' < template.json > config.json

diff template.json config.json

0 comments on commit 6fae0a9

Please sign in to comment.