/
firmware.sh
35 lines (28 loc) · 1021 Bytes
/
firmware.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env sh
set -eu
if [ "$(id -u)" -ne 0 ]; then
echo 'This script must be run as root!' >&2
exit 1
fi
if ! [ -x "$(command -v curl)" ]; then
echo 'This script requires curl!' >&2
exit 1
fi
if ! [ -x "$(command -v cabextract)" ]; then
echo 'This script requires cabextract!' >&2
exit 1
fi
if [ "${1:-}" != --skip-disclaimer ]; then
echo "The firmware for the wireless dongle is subject to Microsoft's Terms of Use:"
echo 'https://www.microsoft.com/en-us/legal/terms-of-use'
echo
echo 'Press enter to continue!'
read -r _
fi
driver_url='http://download.windowsupdate.com/c/msdownload/update/driver/drvs/2017/07/1cd6a87c-623f-4407-a52d-c31be49e925c_e19f60808bdcbfbd3c3df6be3e71ffc52e43261e.cab'
firmware_hash='48084d9fa53b9bb04358f3bb127b7495dc8f7bb0b3ca1437bd24ef2b6eabdf66'
curl -L -o driver.cab "$driver_url"
cabextract -F FW_ACC_00U.bin driver.cab
echo "$firmware_hash" FW_ACC_00U.bin | sha256sum -c
mv FW_ACC_00U.bin /lib/firmware/xow_dongle.bin
rm driver.cab