Skip to content

Instantly share code, notes, and snippets.

@oxavelar
Last active December 2, 2025 12:55
Show Gist options
  • Select an option

  • Save oxavelar/6da4719039b01f1f11bbc56c920c9cbb to your computer and use it in GitHub Desktop.

Select an option

Save oxavelar/6da4719039b01f1f11bbc56c920c9cbb to your computer and use it in GitHub Desktop.
Wireless Firmware Overrides
# This will get the filenames in your currently running OpenWRT
# image and download to override into the firmware path.
#
# I've used this in my MT6000 to override the firmware to perform
# some A/B comparisions, and choose which one to use based on my
# environment needs
#
# NOTE: Run this in your MT6000 directly
(
path="/lib/firmware/mediatek"
#repo="https://github.com/openwrt/mt76/raw/refs/heads/openwrt-23.05/firmware/"
#repo="https://github.com/openwrt/mt76/raw/refs/heads/master/firmware/"
repo="https://github.com/openwrt/mt76/raw/f83b1601cc10c0dc46e7ba9b499c592b183f4164/firmware/"
#repo="https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/mediatek/"
#repo="https://git.progress-linux.org/packages/graograman-backports/firmware-nonfree/plain/mediatek/"
#repo="https://svn.dd-wrt.com/export/HEAD/src/router/mac80211/drivers/net/wireless/mediatek/mt76/firmware"
cd "$path"
state="$(for f in *; do md5sum "$f" | awk '{printf "%s %s\n", substr($1,1,8), $2}'; done)"
echo -e "# info: pulling from\n# '$repo'"
for file in $(ls $path); do
(
wget -q --no-check-certificate "$repo/$file" -O /dev/null || ( echo "not ok # $path/$file" ; break )
wget -q --no-check-certificate "$repo/$file" -O "$file"
echo "ok # wrote: $path/$file"
);
done
printf '%*s\n' 40 '' | tr ' ' '-'
echo -e "before:\n$state"
printf '%*s\n' 40 '' | tr ' ' '-'
echo "after:"
for f in *; do md5sum "$f" | awk '{printf "%s %s\n", substr($1,1,8), $2}'; done
printf '%*s\n' 40 '' | tr ' ' '-'
)
(
path="/lib/firmware/IPQ8074"
repo="https://raw.githubusercontent.com/qosmio/upstream-wifi-fw/main/ath11k-firmware/IPQ8074/hw2.0/testing/2.12/WLAN.HK.2.12-01368-QCAHKSWPL_SILICONZ-1/"
#repo="https://raw.githubusercontent.com/qosmio/upstream-wifi-fw/main/ath11k-firmware/IPQ8074/hw2.0/2.7.0.1/WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1"
#repo="https://git.codelinaro.org/clo/ath-firmware/ath11k-firmware/-/raw/main/IPQ8074/hw2.0/2.6.0.1/WLAN.HK.2.6.0.1-01300-QCAHKSWPL_SILICONZ-1"
cd "$path"
state="$(for f in *; do md5sum "$f" | awk '{printf "%s %s\n", substr($1,1,8), $2}'; done)"
echo -e "# info: pulling from\n# '$repo'"
for file in $(ls $path); do
(
wget -q --no-check-certificate "$repo/$file" -O /dev/null || ( echo "not ok # $path/$file" ; break )
wget -q --no-check-certificate "$repo/$file" -O "$file"
echo "ok # wrote: $path/$file"
);
done
printf '%*s\n' 40 '' | tr ' ' '-'
echo -e "before:\n$state"
printf '%*s\n' 40 '' | tr ' ' '-'
echo "after:"
for f in *; do md5sum "$f" | awk '{printf "%s %s\n", substr($1,1,8), $2}'; done
printf '%*s\n' 40 '' | tr ' ' '-'
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment