fragattack: updated ath9k_htc firmware install script

This commit is contained in:
Mathy Vanhoef 2020-07-21 15:47:29 +04:00 committed by Mathy Vanhoef
parent 584e024cb3
commit 26e2797247

View File

@ -1,23 +1,29 @@
#!/bin/bash #!/bin/bash
set -e set -e
# Make backup of original firmware function install() {
if [[ ! -e /usr/lib/firmware/htc_7010.fw.backup ]]; ORIGINAL=$1
then MODIFIED=$2
cp /usr/lib/firmware/htc_7010.fw /usr/lib/firmware/htc_7010.fw.backup
cp /usr/lib/firmware/htc_9271.fw /usr/lib/firmware/htc_9271.fw.backup
echo "Made backup of original files (old directory)"
fi
if [[ ! -e /usr/lib/firmware/ath9k_htc/htc_7010-1.4.0.fw.backup ]]; # Create a backup of the original file
then if [[ ! -e $ORIGINAL.backup ]];
cp /usr/lib/firmware/ath9k_htc/htc_7010-1.4.0.fw /usr/lib/firmware/ath9k_htc/htc_7010-1.4.0.fw.backup then
cp /usr/lib/firmware/ath9k_htc/htc_9271-1.4.0.fw /usr/lib/firmware/ath9k_htc/htc_9271-1.4.0.fw.backup cp $ORIGINAL $ORIGINAL.backup
echo "Made backup of original files (new directory)" fi
fi
cp htc_*.fw /usr/lib/firmware/ # Overwrite it with the modified firmware image
cp htc_7010.fw /usr/lib/firmware/ath9k_htc/htc_7010-1.4.0.fw cp $MODIFIED $ORIGINAL
cp htc_9271.fw /usr/lib/firmware/ath9k_htc/htc_9271-1.4.0.fw }
echo "Copied compiled firmware to the system"
HTC7010=$(ls /lib/firmware/ath9k_htc/*7010* | grep -v backup)
HTC9271=$(ls /lib/firmware/ath9k_htc/*9271* | grep -v backup)
for ORIGINAL in $HTC7010
do
install $ORIGINAL htc_7010.fw
done
for ORIGINAL in $HTC9271
do
install $ORIGINAL htc_9271.fw
done