diff options
author | iliana etaoin <iliana@buttslol.net> | 2023-12-29 19:05:19 +0000 |
---|---|---|
committer | iliana etaoin <iliana@buttslol.net> | 2023-12-29 19:05:19 +0000 |
commit | c50eb80f23c08f1ffc824d4983d5b9a740fb1273 (patch) | |
tree | 1835a1f498ef7cd59a393c25f0914f0f1c786773 /fetch-current.sh | |
download | fauxlo-c50eb80f23c08f1ffc824d4983d5b9a740fb1273.tar.gz |
initial commit
Diffstat (limited to 'fetch-current.sh')
-rwxr-xr-x | fetch-current.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/fetch-current.sh b/fetch-current.sh new file mode 100755 index 0000000..b8cad93 --- /dev/null +++ b/fetch-current.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +set -euxo pipefail + +script_dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) +temp_dir=$(mktemp -d) +trap 'rm -rf -- "$temp_dir"' EXIT + +candidate=$(curl -fLsS https://steamdeck-atomupd.steamos.cloud/meta/steamos/amd64/snapshot/steamdeck.json \ + | jq '(.major.candidates + .minor.candidates)[0]') + +curl -fLSo "$temp_dir/bundle.raucb" \ + "https://steamdeck-images.steamos.cloud/$(jq -r .update_path <<<"$candidate")" +rauc extract --keyring="$script_dir/valve-rauc-keyring.pem" --trust-environment "$temp_dir/bundle.raucb" "$temp_dir/bundle" + +output_path=steamdeck-$(jq -r .image.buildid <<<"$candidate")-$(jq -r .image.version <<<"$candidate").img +casync extract \ + --store="https://steamdeck-images.steamos.cloud/$(jq -r .update_path <<<"$candidate" | sed -e 's/\.raucb$/.castr/')" \ + "$temp_dir/bundle/rootfs.img.caibx" "$output_path" +echo "$output_path" |