updater-build.sh (1120B)
1 #!/usr/bin/env bash 2 # Builds the Patina updater (../updater) for the image, in the same Fedora 45 builder as the 3 # desktop (desktop/build.sh), so it links the libraries the image has. It lands in build/updater/ 4 # as it goes under /, and the Containerfile copies it in. The root helper, the polkit action and 5 # the launcher are plain files in linux/system/, not built here. 6 set -euo pipefail 7 8 ROOT=$(cd "$(dirname "$0")/.." && pwd) # the repository 9 BUILDER=patina-os-desktop-builder 10 STAGE="$ROOT/linux/build/updater" 11 12 docker build -q -f "$ROOT/linux/desktop/builder.Containerfile" -t "$BUILDER" "$ROOT/linux/desktop" >/dev/null 13 printf '==> building patina-updater\n' 14 docker run --rm --user "$(id -u):$(id -g)" -e CARGO_HOME=/cargo -e HOME=/tmp \ 15 -v patina-os-cargo:/cargo -v "$ROOT:/repo" -w /repo/updater "$BUILDER" \ 16 cargo build --release --locked --target-dir /repo/updater/target-fedora 17 18 rm -rf "$STAGE" && mkdir -p "$STAGE/usr/bin" 19 install -m 755 "$ROOT/updater/target-fedora/release/patina-updater" "$STAGE/usr/bin/patina-updater" 20 printf '==> build/updater/ (%s)\n' "$(git -C "$ROOT" rev-parse --short HEAD)"