SDK_HOME="$HOME/sdk"
SDK_PATH=https://downloads.lede-project.org/snapshots/targets/ar71xx/generic/
-SDK=openwrt-sdk-ar71xx-generic_gcc-5.5.0_musl.Linux-x86_64
+SDK=-sdk-ar71xx-generic_
PACKAGES_DIR="$PWD"
echo_red() { printf "\033[1;31m$*\033[m\n"; }
return 0
}
+get_sdk_file() {
+ if [ -e "$SDK_HOME/sha256sums" ] ; then
+ grep -- "$SDK" "$SDK_HOME/sha256sums" | awk '{print $2}' | sed 's/*//g'
+ else
+ false
+ fi
+}
+
# download will run on the `before_script` step
# The travis cache will be used (all files under $HOME/sdk/). Meaning
# We don't have to download the file again
wget "$SDK_PATH/sha256sums.gpg" -O sha256sums.asc
# LEDE Build System (LEDE GnuPG key for unattended build jobs)
- gpg --import $PACKAGES_DIR/.travis/626471F1.asc
+ gpg --import $PACKAGES_DIR/.keys/626471F1.asc
echo '54CC74307A2C6DC9CE618269CD84BCED626471F1:6:' | gpg --import-ownertrust
# LEDE Release Builder (17.01 "Reboot" Signing Key)
- gpg --import $PACKAGES_DIR/.travis/D52BBB6B.asc
+ gpg --import $PACKAGES_DIR/.keys/D52BBB6B.asc
echo 'B09BE781AE8A0CD4702FDCD3833C6010D52BBB6B:6:' | gpg --import-ownertrust
+ echo_blue "=== Verifying sha256sums signature"
gpg --verify sha256sums.asc
- grep "$SDK" sha256sums > sha256sums.small
+ echo_blue "=== Verified sha256sums signature."
+ if ! grep -- "$SDK" sha256sums > sha256sums.small ; then
+ echo_red "=== Can not find $SDK file in sha256sums."
+ echo_red "=== Is \$SDK out of date?"
+ false
+ fi
# if missing, outdated or invalid, download again
if ! sha256sum -c ./sha256sums.small ; then
- wget "$SDK_PATH/$SDK.tar.xz" -O "$SDK.tar.xz"
+ local sdk_file
+ sdk_file="$(get_sdk_file)"
+ echo_blue "=== sha256 doesn't match or SDK file wasn't downloaded yet."
+ echo_blue "=== Downloading a fresh version"
+ wget "$SDK_PATH/$sdk_file" -O "$sdk_file"
fi
# check again and fail here if the file is still bad
- sha256sum -c ./sha256sums.small
+ echo_blue "Checking sha256sum a second time"
+ if ! sha256sum -c ./sha256sums.small ; then
+ echo_red "=== SDK can not be verified!"
+ false
+ fi
echo_blue "=== SDK is up-to-date"
}
echo_blue "=== Setting up SDK"
tmp_path=$(mktemp -d)
cd "$tmp_path"
- tar Jxf "$SDK_HOME/$SDK.tar.xz" --strip=1
+ tar Jxf "$SDK_HOME/$(get_sdk_file)" --strip=1
# use github mirrors to spare lede servers
cat > feeds.conf <<EOF
pkg_name=$(echo "$pkg_dir" | awk -F/ '{ print $NF }')
echo_blue "=== $pkg_name: Starting quick tests"
- exec_status 'WARNING|ERROR' make "package/$pkg_name/download" V=s || RET=1
- exec_status 'WARNING|ERROR' make "package/$pkg_name/check" V=s || RET=1
+ exec_status '^ERROR' make "package/$pkg_name/download" V=s || RET=1
+ exec_status '^ERROR' make "package/$pkg_name/check" V=s || RET=1
echo_blue "=== $pkg_name: quick tests done"
done