Publish a checksum beside every released ISO (#119)
The release script computed the ISO's sha256 and echoed it to the releaser's terminal, where nobody downloading the ISO could ever see it, and the uploader shipped the ISO and its signature but nothing to check the download against. So "verify your download" was not advice anyone could act on. That matters more for this ISO than for most. The offline pacman mirror lives inside the airootfs and is stored uncompressed, and the installer bind-mounts it onto the target's package cache, so pacstrap reads packages straight off the medium. A flipped block there meets no decompressor and no squashfs block checksum on the way; pacman's integrity check is the first thing in the chain to notice, minutes into the install, as "invalid or corrupted package" against a package name that says nothing about the download. The sidecar names the ISO alone rather than the build path, so it verifies from whatever directory it was downloaded into. A release that cannot write it stops, because the sidecar left over from the previous release reads as a checksum for this one. The uploader now tallies every copy instead of letting the last one decide the exit status, and warns when there is no checksum to publish. Co-authored-by: Codex XHigh <codex@openai.com>
This commit is contained in:
1 parent
df80b320cb
commit
6d02625f7f
4 files changed
+213
-4
No files matched your search
@@ -56,7 +56,17 @@ cp "$latest_iso" "$release_iso"
|
||||
echo -e "\e[32mSigning $ISO_REF ISO\e[0m"
|
||||
omarchy-iso-sign "$release_iso"
|
||||
|
||||
# The checksum sidecar names the ISO alone, never the build path: it is
|
||||
# downloaded next to the ISO and has to verify with `sha256sum -c` from
|
||||
# whatever directory the person who downloaded it happens to be in. A release
|
||||
# that cannot write it stops here, because the sidecar left over from the last
|
||||
# release reads as a checksum for this one.
|
||||
iso_sha=$(sha256sum "$release_iso")
|
||||
iso_sha=${iso_sha%% *}
|
||||
if [[ -z $iso_sha ]] || ! printf '%s %s\n' "$iso_sha" "${release_iso##*/}" >"$release_iso.sha256"; then
|
||||
echo -e "\e[31mCould not write the checksum for $release_iso\e[0m" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo -e "\e[32mSHA256 for $ISO_REF ISO: $iso_sha\e[0m"
|
||||
|
||||
omarchy-iso-upload "$release_iso"
|
||||
+19
-3
@@ -10,8 +10,24 @@ if [[ ! -f ~/.config/rclone/rclone.conf ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rclone copy $1 Omarchy:omarchy/ -P
|
||||
# Every copy reports, and one failure fails the upload. Without the tally the
|
||||
# last copy decides the exit status, so a signature that never made it is
|
||||
# hidden by a checksum that did.
|
||||
status=0
|
||||
|
||||
if [[ -f $1.sig ]]; then
|
||||
rclone copy $1.sig Omarchy:omarchy/ -P
|
||||
rclone copy "$1" Omarchy:omarchy/ -P || status=1
|
||||
|
||||
# The signature and the checksum are only worth anything to someone who can
|
||||
# reach them beside the ISO, so they go up in the same run rather than a step
|
||||
# a release can finish without.
|
||||
for sidecar in "$1.sig" "$1.sha256"; do
|
||||
if [[ -f $sidecar ]]; then
|
||||
rclone copy "$sidecar" Omarchy:omarchy/ -P || status=1
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ ! -f $1.sha256 ]]; then
|
||||
echo "Warning: no $1.sha256 to publish, so nobody can verify this download" >&2
|
||||
fi
|
||||
|
||||
exit $status
|
||||
Reference in new issue
Block a user