This commit is contained in:
Cindy Deng 2021-05-12 23:58:38 -07:00
Родитель f2ea75661f
Коммит 01514a0641
2 изменённых файлов: 22 добавлений и 14 удалений

Просмотреть файл

@ -46,7 +46,7 @@ echo ""
# run scripts in order, can take parsed input from above
./validate-tier1-os.sh
./install-container-management.sh
./install-edge-runtime.sh
./install-edge-runtime.sh ${parsed_cmds[SCOPE_ID]} ${parsed_cmds[REGISTRATION_ID]} ${parsed_cmds[SYMMETRIC_KEY]}
./validate-post-install.sh
cd ..

Просмотреть файл

@ -1,26 +1,34 @@
#script to install edge runtime 1.2
# update
# sudo apt-get update
sudo apt-get update
# install Azure IoT Edge Runtime 1.2
# sudo apt-get install aziot-edge -y
sudo apt-get install aziot-edge -y
# create .toml from template
# sudo cp /etc/aziot/config.toml.edge.template /etc/aziot/config.toml
sudo cp /etc/aziot/config.toml.edge.template /etc/aziot/config.toml
CONNECTION_STRING=$1
SCOPE_ID=$1
REGISTRATION_ID=$2
SYMMETRIC_KEY=$3
# replace with connection string
sed -i '/## Manual provisioning with connection string/,/## Manual provisioning with symmetric key/c\
## Manual provisioning with connection string\
\
sed -i '/## DPS provisioning with symmetric key/,/## DPS provisioning with X.509 certificate/c\
## DPS provisioning with symmetric key\
[provisioning]\
source = "manual"\
connection_string = \"'$CONNECTION_STRING'\" \
source = "dps"\
global_endpoint = "https://global.azure-devices-provisioning.net"\
id_scope = \"'$SCOPE_ID'\"\
\
# [provisioning.attestation]\
method = "symmetric_key"\
registration_id = \"'$REGISTRATION_ID'\"\
\
## Manual provisioning with symmetric key\
' sample.toml
symmetric_key = { value = \"'$SYMMETRIC_KEY'\" } # inline key (base64), or...\
# symmetric_key = { uri = "file:///var/secrets/device-id.key" } # file URI, or...\
# symmetric_key = { uri = "pkcs11:slot-id=0;object=device%20id?pin-value=1234" } # PKCS#11 URI\
\
## DPS provisioning with X.509 certificate\
' /etc/aziot/config.toml
# sudo iotedge config apply
sudo iotedge config apply