From 5d10f5212ddb28903f914594bc47ba145c927dce Mon Sep 17 00:00:00 2001 From: Reuben Miller Date: Sun, 3 Dec 2023 16:28:22 +0100 Subject: [PATCH] Fix tedge install on default targets (#13) * fix: use default install script when not building for armv6 * build pi 2,3,4,5 images by default --- justfile | 2 +- recipes/thin-edge.io/steps/00-install.sh | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/justfile b/justfile index 5f686e1..a976934 100644 --- a/justfile +++ b/justfile @@ -87,6 +87,6 @@ publish: cd {{justfile_directory()}} && ./scripts/upload-c8y.sh build-all-variants: extract customize - # just VARIANT=pi023 bake + just VARIANT=pi023 bake # just VARIANT=pi4 bake just VARIANT=pi45 bake diff --git a/recipes/thin-edge.io/steps/00-install.sh b/recipes/thin-edge.io/steps/00-install.sh index ef6857f..a902f4a 100755 --- a/recipes/thin-edge.io/steps/00-install.sh +++ b/recipes/thin-edge.io/steps/00-install.sh @@ -7,10 +7,21 @@ echo "uname -a: $(uname -a)" | tee -a "${RECIPE_DIR}/build.log" echo "uname -m: $(uname -m)" | tee -a "${RECIPE_DIR}/build.log" echo -curl -1sLf 'https://dl.cloudsmith.io/public/thinedge/community/gpg.2E65716592E5C6D4.key' | gpg --no-default-keyring --dearmor > /usr/share/keyrings/thinedge-community-archive-keyring.gpg - # install thin-edge.io -"${RECIPE_DIR}/files/thin-edge.io.sh" --channel main --arch armv6 2>&1 | tee -a "${RECIPE_DIR}/build.log" +arch=$(uname -m) +case "$arch" in + *arm7*) + # Due to differences between the build process and the target device, the arch + # used for installation needs to be forced to armv6. + echo "Using armv6 workaround" | tee -a "${RECIPE_DIR}/build.log" + curl -1sLf 'https://dl.cloudsmith.io/public/thinedge/community/gpg.2E65716592E5C6D4.key' | gpg --no-default-keyring --dearmor > /usr/share/keyrings/thinedge-community-archive-keyring.gpg + "${RECIPE_DIR}/files/thin-edge.io.sh" --channel main --arch armv6 2>&1 | tee -a "${RECIPE_DIR}/build.log" + ;; + *) + wget -O - thin-edge.io/install.sh | sh -s -- --channel main | tee -a "${RECIPE_DIR}/build.log" + ;; +esac + # Install collectd apt-get install -y -o DPkg::Options::=--force-confnew --no-install-recommends \