Skip to content

Commit

Permalink
IGSDK R6.1 Release
Browse files Browse the repository at this point in the history
Fixes to OpenJDK installation
Fixes to IG60 firmware update script
Add script to update EdgeIQ runtime
Add script to update OpenJDK runtime components
  • Loading branch information
trowbridgec-laird authored and Don Ferencz committed Jan 16, 2024
1 parent 3fec5bf commit 7d5b3c1
Show file tree
Hide file tree
Showing 8 changed files with 584 additions and 139 deletions.
15 changes: 11 additions & 4 deletions edgeiq/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
# Laird Connectivity IG60 EdgeIQ Support
This folder contains various utilities for supporting the EdgeIQ Device Management service on the Laird Connectivity Sentrius™ IG60.

## Software Update
The script `ig60_update.sh` is used to perform a software update operation via the EdgeIQ cloud:
## Firmware Update
The script `ig60_update.sh` is used to perform a firmware update operation via the EdgeIQ cloud:

1. In the "Software" page in the UI, create a Software Package and attach the update file (.SWU) and the script `ig60_update.sh`.
2. Set the script to be `./ig60_update.sh UPDATE_FILE` where `UPDATE_FILE` is the name of the update .SWU file.
1. In the "Software" page in the UI, create a Software Package and attach the update file (.SWU) and the script `ig60_update.sh`
2. Set the script to be `./ig60_update.sh UPDATE_FILE` where `UPDATE_FILE` is the name of the update .SWU file
3. Apply the update to one or more IG60 devices via the UI

## Edge Update
The script `update_edge.sh` is used to update the Edge agent to the latest version.

1. In the "Software" page in the UI, create a Software Package and attach the script `update_edge.sh`
2. Set the script to be `./update_edge.sh /gg /tmp`
3. Apply the update to one or more IG60 devices via the UI
10 changes: 9 additions & 1 deletion edgeiq/ggv2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,12 @@ The script [`install_ggv2_fleet_provisioning.sh`](install_ggv2_fleet_provisionin

The [`ggv2_fleet_provisioning_template.conf`](ggv2_fleet_provisioning_template.conf) configuration file specifies the parameters passed to the installation script.

For more info, see the Sentrius™ IG60 AWS IoT Greengrass V2 Getting Started Guide.
For more info, see the Sentrius™ IG60 AWS IoT Greengrass V2 Getting Started Guide.

## Update OpenJDK Dependency Components
The script [`ig60_ggv2_update_openjdk_components.sh`](ig60_ggv2_update_openjdk_components.sh) is used to update the OpenJDK dependency components on an IG60 device via the EdgeIQ cloud. These components **must** be kept in sync with the version of OpenJDK utilized in the installed IG60 firmware version.

To perform the update:
1. In the "Software" page in the UI, create a Software Package and attach the OpenJDK dependency components tarball file (.tar.gz) provided by Laird Connectivity and the script `ig60_ggv2_update_openjdk_components.sh`.
2. Set the script to be `./ig60_ggv2_update_openjdk_components.sh OPENJDK_TARBALL_FILE` where `OPENJDK_TARBALL_FILE` is the name of the OpenJDK dependency components tarball file.
3. Apply the update to one or more IG60 devices via the UI
46 changes: 38 additions & 8 deletions edgeiq/ggv2/ggv2_fleet_provisioning_template.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,41 @@
######################################################

# URL to Greengrass V2 Core Nucleus zip file
GGV2_CORE_FILE_URL="https://d2s8p88vqu9w66.cloudfront.net/releases/greengrass-2.5.2.zip"
#
# Information on the latest available release can be found on the AWS Greengrass GitHub page:
# https://github.com/aws-greengrass/aws-greengrass-nucleus/releases
#
# The latest version can be downloaded from the following location:
# https://d2s8p88vqu9w66.cloudfront.net/releases/greengrass-nucleus-latest.zip
#
# Alternatively, you can download a specific version from the following location, replacing
# <version> with the desired version to download:
# https://d2s8p88vqu9w66.cloudfront.net/releases/greengrass-<version>.zip
# ** REQUIRED **
GGV2_CORE_FILE_URL="https://d2s8p88vqu9w66.cloudfront.net/releases/greengrass-2.5.6.zip"

# Signature for the Greengrass V2 Core Nucelus zip file
GGV2_CORE_SIGNATURE=""

# Name of the resource tarball file
# Default is "resources.tar.gz"
GGV2_RESOURCE_FILE=""
# ** REQUIRED **
GGV2_RESOURCE_FILE="resources.tar.gz"

# URL to root CA certificate (e.g., usually from Amazon)
# ** REQUIRED **
GGV2_ROOT_CA_CERT_URL="https://www.amazontrust.com/repository/AmazonRootCA1.pem"

# Launch parameters for the Greengrass V2 Core Nucleus passed to the JVM
# Default is "-Xmx128m -XX:+UseSerialGC -XX:TieredStopAtLevel=1"
GGV2_NUCLEUS_LAUNCH_PARAMS="-Xmx128m -XX:+UseSerialGC -XX:TieredStopAtLevel=1"

# URL to Laird-provided OpenJDK dependencies tarball file
OPENJDK_FILE_URL="https://igprovdist-s3bucket-15bl34m4svimx.s3.amazonaws.com/lrd-openjdk-0.0.3.tar.gz"

# Signature for the OpenJDK dependencies tarball file
OPENJDK_SIGNATURE=""
# Name of the OpenJDK dependency components tarball file
# ** REQUIRED **
OPENJDK_FILE=""

# URL to Greengrass V2 Fleet Provisioning plugin
# ** REQUIRED **
FLEET_PROVISIONING_PLUGIN_URL="https://d2s8p88vqu9w66.cloudfront.net/releases/aws-greengrass-FleetProvisioningByClaim/fleetprovisioningbyclaim-latest.jar"

# Signature for the Greengrass V2 Fleet Provisioning plugin
Expand All @@ -46,59 +58,77 @@ FLEET_PROVISIONING_PLUGIN_SIGNATURE=""

# Path to device certificate
# Default is "/var/media/mmcblk0p1/greengrass/v2/device.pem.crt"
# ** REQUIRED **
SYSTEM_CERTIFICATE_FILE_PATH="/var/media/mmcblk0p1/greengrass/v2/thingCert.crt"

# Path to device private key
# Default is "/var/media/mmcblk0p1/greengrass/v2/private.pem.key"
# ** REQUIRED **
SYSTEM_PRIVATE_KEY_PATH="/var/media/mmcblk0p1/greengrass/v2/privKey.key"

# Path to Amazon Root CA certificate
# Default is "/var/media/mmcblk0p1/greengrass/v2/AmazonRootCA1.pem"
# ** REQUIRED **
SYSTEM_ROOT_CA_PATH="/var/media/mmcblk0p1/greengrass/v2/AmazonRootCA1.pem"

# Greengrass v2 Core Nucleus root path
# Default is "/var/media/mmcblk0p1/greengrass/v2"
# ** REQUIRED **
SYSTEM_ROOT_PATH="/var/media/mmcblk0p1/greengrass/v2"

# Greengrass v2 Nucleus version
SERVICES_AWS_GREENGRASS_NUCLEUS_VERSION=""
# This parameter should match the version of the Greengrass v2 Nucleus specified in
# GGV2_CORE_FILE_URL
# ** REQUIRED **
SERVICES_AWS_GREENGRASS_NUCLEUS_VERSION="2.5.6"

# Greengrass v2 root path
# ** REQUIRED **
SERVICES_AWS_FLEET_PROVISIONING_BY_CLAIM_CONFIGURATION_ROOT_PATH="/var/media/mmcblk0p1/greengrass/v2"

# AWS region
# ** REQUIRED **
SERVICES_AWS_GREENGRASS_NUCLEUS_CONFIGURATION_AWS_REGION=""

# AWS IoT credential endpoint
# ** REQUIRED **
SERVICES_AWS_GREENGRASS_NUCLEUS_CONFIGURATION_IOT_CRED_ENDPOINT=""

# AWS IoT role alias
# ** REQUIRED **
SERVICES_AWS_FLEET_PROVISIONING_BY_CLAIM_CONFIGURATION_IOT_ROLE_ALIAS=""

# AWS IoT data endpoint
# ** REQUIRED **
SERVICES_AWS_FLEET_PROVISIONING_BY_CLAIM_CONFIGURATION_IOT_DATA_ENDPOINT=""

# AWS IoT credential endpoint
# ** REQUIRED **
SERVICES_AWS_FLEET_PROVISIONING_BY_CLAIM_CONFIGURATION_IOT_CREDENTIAL_ENDPOINT=""

# AWS IoT Greengrass V2 provisioning template
# ** REQUIRED **
SERVICES_AWS_FLEET_PROVISIONING_BY_CLAIM_CONFIGURATION_PROVISIONING_TEMPLATE=""

# Path to claim certificate
# Default is "/var/media/mmcblk0p1/greengrass/v2/claim-certs/claim.pem.crt"
# ** REQUIRED **
SERVICES_AWS_FLEET_PROVISIONING_BY_CLAIM_CONFIGURATION_CLAIM_CERTIFICATE_PATH="/var/media/mmcblk0p1/greengrass/v2/claim-certs/claim.pem.crt"

# Path to claim certificate private key
# Default is "/var/media/mmcblk0p1/greengrass/v2/claim-certs/claim.private.pem.key"
# ** REQUIRED **
SERVICES_AWS_FLEET_PROVISIONING_BY_CLAIM_CONFIGURATION_CLAIM_CERTIFICATE_PRIVATE_KEY="/var/media/mmcblk0p1/greengrass/v2/claim-certs/claim.private.pem.key"

# Path to Amazon Root CA certificate
# Default is "/var/media/mmcblk0p1/greengrass/v2/AmazonRootCA1.pem"
# ** REQUIRED **
SERVICES_AWS_FLEET_PROVISIONING_BY_CLAIM_CONFIGURATION_ROOT_CA_PATH="/var/media/mmcblk0p1/greengrass/v2/AmazonRootCA1.pem"

# Greengrass v2 Core thing name
# If blank, "IG60_" plus the last six digits of the MAC address are used instead
SERVICES_AWS_FLEET_PROVISIONING_BY_CLAIM_CONFIGURATION_TEMPLATE_PARAMETERS_THING_NAME=""

# Greengrass v2 Core thing group name
# ** REQUIRED **
SERVICES_AWS_FLEET_PROVISIONING_BY_CLAIM_CONFIGURATION_TEMPLATE_PARAMETERS_THING_GROUP_NAME=""
72 changes: 72 additions & 0 deletions edgeiq/ggv2/ig60_ggv2_update_openjdk_components.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/bin/bash
# Copyright 2022 Laird Connectivity
#
# IG60 helper script for updating the OpenJDK dependency components to support
# GGv2 which are stored on the SD card
#
# Usage: ig60_ggv2_update_openjdk_components.sh path/to/openjdk.tar.gz
#

# Make verbose log, fail on uncaught errors
set -xe

OPENJDK_TARBALL_FILE=$1

programname=$(basename $0)

#
# Helper function to print out the script usage
#
show_usage() {
echo -e "Usage: $programname path/to/openjdk.tar.gz\n"
}

#
# Helper function to print an error message and exit with a failure code
#
cleanup_and_fail(){
echo $1
rm -f ${OPENJDK_TARBALL_FILE}
exit 1
}

if [ $# -ne 1 ]; then
show_usage
cleanup_and_fail "Invalid arguments"
exit 1
fi

SDCARD_ROOT="/var/media/mmcblk0p1"

# Link in the FS key
keyctl link @us @s

# Stop GGv2
echo "Stopping Greengrass V2"
systemctl stop ggv2runner

# Since the 'ggv2sdmount' service is configured as 'PartOf' the main
# 'ggv2runner' service, it must be "manually" started here in order to properly
# re-mount the SD card.
echo "Re-mounting SD card"
systemctl start ggv2sdmount

# Verify the SD card root exists
if [ ! -d "${SDCARD_ROOT}" ]; then cleanup_and_fail "SD card not found"; fi

# Delete existing OpenJDK files
rm -rf $SDCARD_ROOT/jdk

# Extract the tarball
echo "Extracting the OpenJDK dependency components tarball"
tar xzf ${OPENJDK_TARBALL_FILE} -C ${SDCARD_ROOT} --no-same-owner
if [ ! $? -eq 0 ]; then cleanup_and_fail "Unable to extract OpenJDK dependency components tarball"; fi

# Delete the OpenJDK dependency components tarball
rm -f ${OPENJDK_TARBALL_FILE}

# Restart GGv2
echo "Restarting Greengrass V2"
systemctl start ggv2runner

exit 0
Loading

0 comments on commit 7d5b3c1

Please sign in to comment.