Skip to content

Commit

Permalink
autopif2.sh: use wget2 over wget since arm busybox doesn't have LFS
Browse files Browse the repository at this point in the history
  • Loading branch information
osm0sis committed Feb 25, 2025
1 parent 1493650 commit c2af0fc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions module/autopif2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ find_busybox() {
return 1;
}

if ! which wget >/dev/null || grep -q "wget-curl" $(which wget); then
if which wget2 >/dev/null; then
wget() { wget2 "$@"; }
elif ! which wget >/dev/null || grep -q "wget-curl" $(which wget); then
if ! find_busybox; then
die "wget not found";
elif $BUSYBOX ping -c1 -s2 android.com 2>&1 | grep -q "bad address"; then
Expand Down Expand Up @@ -127,8 +129,8 @@ fi;
echo "$MODEL ($PRODUCT)";

(ulimit -f 2; wget -q -O PIXEL_ZIP_METADATA --no-check-certificate $OTA) 2>/dev/null;
FINGERPRINT="$(grep -am1 'post-build=' PIXEL_ZIP_METADATA | cut -d= -f2)";
SECURITY_PATCH="$(grep -am1 'security-patch-level=' PIXEL_ZIP_METADATA | cut -d= -f2)";
FINGERPRINT="$(grep -am1 'post-build=' PIXEL_ZIP_METADATA 2>/dev/null | cut -d= -f2)";
SECURITY_PATCH="$(grep -am1 'security-patch-level=' PIXEL_ZIP_METADATA 2>/dev/null | cut -d= -f2)";
if [ -z "$FINGERPRINT" -o -z "$SECURITY_PATCH" ]; then
echo "\nError: Failed to extract information from metadata!";
exit 1;
Expand Down

0 comments on commit c2af0fc

Please sign in to comment.