Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,10 @@ If image pulls or snapshot downloads fail, make sure the host can reach:

If `bedrock-init` exits with `Unexpected checksum file format`,
`Checksum file does not match downloaded archive`, or `SHA256 verification
failed`, do not reuse that download. Retry later or verify the checksum
yourself before attempting another restore.
failed`, retry later: the next run downloads the snapshot again and replaces
the failed archive. Archives named like `snapshot.tar.1.zst`, left by runs
before this behaviour, stay in the `snapshot_downloads` volume until you remove
them (for example with `docker compose down -v`).

### Snapshot sources

Expand Down
10 changes: 9 additions & 1 deletion scripts/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,21 @@ function extractlz4() {
# Arguments:
# url: URL of the file to download.
# out: Location to download the file to.
#
# A file left at `out` by an earlier failed run (for example after a checksum
# mismatch or an interrupted extraction) must be replaced, not kept: by default
# aria2c saves the new download as "<name>.1.<ext>" and the caller would go on
# to verify and extract the stale file. An unfinished download that still has
# its .aria2 control file is resumed as before.
function download() {
local out_dir out_name
out_dir="$(dirname "$2")"
out_name="$(basename "$2")"

mkdir -p "$out_dir"
aria2c --max-tries=0 -x 16 -s 16 -k100M --dir="$out_dir" --out="$out_name" "$1"
aria2c --max-tries=0 -x 16 -s 16 -k100M \
--allow-overwrite=true --auto-file-renaming=false \
--dir="$out_dir" --out="$out_name" "$1"
}

# verify_sha256_checksum: Verifies a downloaded file against a checksum file.
Expand Down