Commit f7028d50 authored by Vivia Nikolaidou's avatar Vivia Nikolaidou Committed by Youness Alaoui
Browse files

Use megadown to download ME .rar

Instead of prompting the user to download it manually
parent 4bb0b372
......@@ -35,6 +35,10 @@ SKL_ME_FILENAME="11.0.18.1002_CON_LP_C0_NPDM_PRD_RGN.bin"
SKL_ME_FULL_FILENAME="Intel CSME 11.0 Firmware Repository Pack r52/$SKL_ME_FILENAME"
SKL_ME_RAR_SHA="28b7c31ae6888623d2271f0c74cb7bbca55a56af73b26f9796742467a841441a"
# Needed to download SKL_ME_RAR_URL
MEGADOWN_URL="https://github.com/tonikelope/megadown.git"
MEGADOWN_GOOD_COMMIT="83c53ddad1c32bf6d35c61fcd12a2fa94271ff77"
# Might be required to compile unrar in case unrar-nonfree is not installed
RAR_NONFREE_SOURCE_URL="https://www.rarlab.com/rar/unrarsrc-5.5.8.tar.gz"
RAR_NONFREE_SOURCE_SHA="9b66e4353a9944bc140eb2a919ff99482dd548f858f5e296d809e8f7cdb2fcf4"
......@@ -222,15 +226,16 @@ get_and_patch_me_11 () {
sha=$(sha256sum "$rar_filename" | awk '{print $1}')
fi
if [ "$sha" != "$SKL_ME_RAR_SHA" ]; then
DIRECT_LINK=$(wget -O - "$SKL_ME_RAR_URL" 2>/dev/null | grep -o -e 'http://download.*.rar' | head -n 1)
if [ -z "$DIRECT_LINK" ]; then
echo ""
echo "Couldn't automatically determine the direct link URL to download the ME from."
echo "Please manually download the file from the URL '$SKL_ME_RAR_URL'"
echo "And place the file in '`pwd`/$rar_filename'"
die "Once done. Please run this script again."
if [ ! -d megadown ]; then
git clone $MEGADOWN_URL
fi
wget -O "$rar_filename" "$DIRECT_LINK"
(
cd megadown
git checkout $MEGADOWN_GOOD_COMMIT
echo -e "\n\nDownloading ME 11 Repository from $SKL_ME_RAR_URL"
echo "Please be patient while the download finishes..."
./megadown "$SKL_ME_RAR_URL" -o ../$rar_filename 2>/dev/null
)
sha=$(sha256sum "$rar_filename" | awk '{print $1}')
if [ "$sha" != "$SKL_ME_RAR_SHA" ]; then
# We'll assume the rar file was updated again
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment