Skip to content

Commit

Permalink
Remove .asc from .DIGESTS
Browse files Browse the repository at this point in the history
Fixes #66
  • Loading branch information
NiKiZe committed Jun 3, 2023
1 parent 9164eee commit 9638c85
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions get_minimal_cd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ DISTBASE=${DISTMIRROR}/releases/amd64/autobuilds/current-install-amd64-minimal/
FILE=$(wget -q $DISTBASE -O - | grep -o -e "install-amd64-minimal-\w*.iso" | uniq)

wget -c $DISTBASE$FILE || exit 1
wget -c $DISTBASE$FILE.DIGESTS.asc || exit 2
wget -c $DISTBASE$FILE.DIGESTS || exit 2

# https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Media#Linux_based_verification
#wget -O- https://gentoo.org/.well-known/openpgpkey/hu/wtktzo4gyuhzu8a4z5fdj3fgmr1u6tob?l=releng | gpg --import
Expand All @@ -14,14 +14,14 @@ wget -c $DISTBASE$FILE.DIGESTS.asc || exit 2
# Download key if missing
gpg --locate-key [email protected]
# Verify DIGESTS
gpg --verify $FILE.DIGESTS.asc || exit 2
gpg --verify $FILE.DIGESTS || exit 2

echo "Verifying SHA512 ..."
# grab SHA512 lines and line after, then filter out line that ends with iso
echo "$(grep -A1 SHA512 $FILE.DIGESTS.asc | grep iso$)" | sha512sum -c || exit 2
echo "$(grep -A1 SHA512 $FILE.DIGESTS | grep iso$)" | sha512sum -c || exit 2
echo "Verifying BLAKE2 ..."
# grab BLAK2 lines and line after, then filter out line that ends with iso
blake2line=$(grep -A1 BLAKE2 $FILE.DIGESTS.asc | grep iso$)
blake2line=$(grep -A1 BLAKE2 $FILE.DIGESTS | grep iso$)
# remove /var/tmp*.../ part of filename
echo "${blake2line/\/*\//}" | b2sum -c || exit 2
echo " - Awesome! everything looks good."
8 changes: 4 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,14 @@ FILE=$(wget -q $DISTBASE -O - | grep -o -E 'stage3-amd64-openrc-20\w*\.tar\.(bz2
[ -z "$FILE" ] && echo No stage3 found on $DISTBASE && exit 1
echo download latest stage file $FILE
wget $DISTBASE$FILE || bash
wget $DISTBASE$FILE.DIGESTS.asc || bash
wget $DISTBASE$FILE.DIGESTS || bash
wait $pid_gpg
gpg --verify $FILE.DIGESTS.asc || bash
gpg --verify $FILE.DIGESTS || bash
echo "Verifying stage3 SHA512 ..."
# grab SHA512 lines and line after, then filter out line that ends with iso
echo "$(grep -A1 SHA512 $FILE.DIGESTS.asc | grep $FILE\$)" | sha512sum -c || bash
echo "$(grep -A1 SHA512 $FILE.DIGESTS | grep $FILE\$)" | sha512sum -c || bash
echo " - Awesome! stage3 verification looks good."
rm $FILE.DIGESTS.asc
rm $FILE.DIGESTS
time tar xpf $FILE --xattrs-include='*.*' --numeric-owner

wait || exit 1
Expand Down

0 comments on commit 9638c85

Please sign in to comment.