Skip to content

Commit

Permalink
add firmware info inventory script (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
reubenmiller authored Dec 3, 2023
1 parent b6e28cf commit 447fcc5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions recipes/tedge-firmware-update/files/firmware-version
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh
##################################################
# Parse firmware file marker
#
# Example file contents:
# ```
# tedge_rugpi_default_pi45_20231203.1557
# ```
##################################################
set -e
ARTIFACT_FILE=/etc/.build_info

if [ ! -f "$ARTIFACT_FILE" ]; then
exit 0
fi

NAME=$(rev /etc/.build_info | cut -d_ -f2- | rev)
VERSION=$(rev /etc/.build_info | cut -d_ -f1 | rev)

echo "name=\"$NAME\""
echo "version=\"$VERSION\""
1 change: 1 addition & 0 deletions recipes/tedge-firmware-update/steps/00-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ install -D -m 644 "${RECIPE_DIR}/files/tedge-firmware" -t /etc/sudoers.d/
install -D -m 644 "${RECIPE_DIR}/files/system.toml" -t /etc/tedge/
install -D -m 644 "${RECIPE_DIR}/files/firmware_update.toml" -t /etc/tedge/operations/
install -D -m 755 "${RECIPE_DIR}/files/rugpi_workflow.sh" -t /usr/bin/
install -D -m 755 "${RECIPE_DIR}/files/firmware-version" -t /usr/share/tedge-inventory/scripts.d/80_c8y_Firmware

0 comments on commit 447fcc5

Please sign in to comment.