This repository has been archived by the owner on May 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1458 from advancedtelematic/feat/c-api-updates
Feat/c api updates
- Loading branch information
Showing
9 changed files
with
97 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 0 additions & 55 deletions
55
src/libaktualizr-c/test/api-test-utils/uptane-generator-utils.cc
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
add_custom_target(uptane_repo_full_no_correlation_id | ||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/full_no_correlation_id.sh | ||
${UPTANE_GENERATOR} ${PROJECT_BINARY_DIR}/uptane_repos/full_no_correlation_id) | ||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/generate_repo.sh | ||
${UPTANE_GENERATOR} ${PROJECT_BINARY_DIR}/uptane_repos/full_no_correlation_id --add_default_secondary) | ||
add_dependencies(uptane_repo_full_no_correlation_id uptane-generator) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#! /bin/bash | ||
set -eEuo pipefail | ||
|
||
if [ "$#" -eq 0 ]; then | ||
echo "Usage: $0 <uptane-generator> <output directory> [options]" | ||
echo "Options:" | ||
echo " -s|--add_default_secondary" | ||
echo " -c|--add_campaigns" | ||
exit 1 | ||
fi | ||
|
||
ADD_DEFAULT_SECONDARY=false | ||
ADD_CAMPAIGNS=false | ||
|
||
for arg in "$@" | ||
do | ||
case $arg in | ||
-s|--add_default_secondary) | ||
ADD_DEFAULT_SECONDARY=true | ||
;; | ||
-c|--add_campaigns) | ||
ADD_CAMPAIGNS=true | ||
;; | ||
esac | ||
done | ||
|
||
UPTANE_GENERATOR="$1" | ||
DEST_DIR="$2" | ||
|
||
uptane_gen() { | ||
"$UPTANE_GENERATOR" --path "$DEST_DIR" "$@" | ||
} | ||
|
||
if [ -d "$DEST_DIR" ]; then | ||
# already here, bailing | ||
exit 0 | ||
fi | ||
|
||
mkdir -p "$DEST_DIR" | ||
trap 'rm -rf "$DEST_DIR"' ERR | ||
|
||
IMAGES=$(mktemp -d) | ||
trap 'rm -rf "$IMAGES"' exit | ||
PRIMARY_FIRMWARE="$IMAGES/primary.txt" | ||
echo "primary" > "$PRIMARY_FIRMWARE" | ||
|
||
uptane_gen --command generate --expires 2021-07-04T16:33:27Z | ||
uptane_gen --command image --filename "$PRIMARY_FIRMWARE" --targetname primary.txt --hwid primary_hw | ||
uptane_gen --command addtarget --hwid primary_hw --serial CA:FE:A6:D2:84:9D --targetname primary.txt | ||
|
||
if [ "$ADD_DEFAULT_SECONDARY" = true ]; then | ||
SECONDARY_FIRMWARE="$IMAGES/secondary.txt" | ||
echo "secondary" > "$SECONDARY_FIRMWARE" | ||
uptane_gen --command image --filename "$SECONDARY_FIRMWARE" --targetname secondary.txt --hwid secondary_hw | ||
uptane_gen --command addtarget --hwid secondary_hw --serial secondary_ecu_serial --targetname secondary.txt | ||
fi | ||
|
||
uptane_gen --command signtargets | ||
|
||
if [ "$ADD_CAMPAIGNS" = true ]; then | ||
uptane_gen --command addcampaigns | ||
fi |