mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
redesign firmware updater (#2521)
* bump version * Update image-recipe/build.sh * fix podman repo * improve firmware updater Co-authored-by: J H <Blu-J@users.noreply.github.com> * checksum firmware * include sha in json * fix build * fix semver parser, add rpc for manual trigger --------- Co-authored-by: J H <Blu-J@users.noreply.github.com>
This commit is contained in:
28
download-firmware.sh
Executable file
28
download-firmware.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")"
|
||||
|
||||
set -e
|
||||
|
||||
PLATFORM=$1
|
||||
|
||||
if [ -z "$PLATFORM" ]; then
|
||||
>&2 echo "usage: $0 <PLATFORM>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -rf ./firmware/$PLATFORM
|
||||
mkdir -p ./firmware/$PLATFORM
|
||||
|
||||
cd ./firmware/$PLATFORM
|
||||
|
||||
mapfile -t firmwares <<< "$(jq -c ".[] | select(.platform[] | contains(\"$PLATFORM\"))" ../../build/lib/firmware.json)"
|
||||
for firmware in "${firmwares[@]}"; do
|
||||
if [ -n "$firmware" ]; then
|
||||
id=$(echo "$firmware" | jq --raw-output '.id')
|
||||
url=$(echo "$firmware" | jq --raw-output '.url')
|
||||
shasum=$(echo "$firmware" | jq --raw-output '.shasum')
|
||||
curl --fail -L -o "${id}.rom.gz" "$url"
|
||||
echo "$shasum ${id}.rom.gz" | sha256sum -c
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user