Bladeren bron

Revert "Use atheros wifi package"

This reverts commit 5814c386c186c32a650c981c6213b8965f1cf720.
Bob Mottram 7 jaren geleden
bovenliggende
commit
b19479e7df
2 gewijzigde bestanden met toevoegingen van 61 en 3 verwijderingen
  1. 16
    2
      src/freedombone-image-customise
  2. 45
    1
      src/freedombone-utils-wifi

+ 16
- 2
src/freedombone-image-customise Bestand weergeven

@@ -492,7 +492,22 @@ continue_installation() {
492 492
 }
493 493
 
494 494
 atheros_wifi() {
495
-    chroot "$rootdir" apt-get -yq install open-ath9k-htc-firmware
495
+    if [[ "$MACHINE" == "beaglebonewifi" ]]; then
496
+        return
497
+    fi
498
+
499
+    firmware_filename="open-ath9k-htc-firmware_1.3-1_all.deb"
500
+    firmware_hash='5fea58ffefdf0ef15b504db7fbe3bc078c03e0d927bba64085e4b6f2546102f5'
501
+
502
+    firmware_url="http://us.archive.trisquel.info/trisquel/pool/main/o/open-ath9k-htc-firmware/$firmware_filename"
503
+    firmware_tempfile="/tmp/$firmware_filename"
504
+    wget "$firmware_url" -O "$rootdir$firmware_tempfile"
505
+    downloaded_firmware_hash=$(sha256sum "$rootdir$firmware_tempfile" | awk -F ' ' '{print $1}')
506
+    if [[ "$downloaded_firmware_hash" == "$firmware_hash" ]]; then
507
+        chroot "$rootdir" dpkg -i "$firmware_tempfile"
508
+    else
509
+        echo 'WARNING: Atheros Wifi firmware hash does not match. The driver has not been installed.'
510
+    fi
496 511
 }
497 512
 
498 513
 configure_wifi() {
@@ -887,7 +902,6 @@ initialise_mesh() {
887 902
         # install proprietary wifi drivers
888 903
         # see https://wiki.debian.org/iwlwifi
889 904
         chroot "$rootdir" apt-get -yq install firmware-iwlwifi firmware-b43-installer firmware-brcm80211 firmware-realtek
890
-        chroot "$rootdir" apt-get -yq install firmware-atheros firmware-zd1211
891 905
     fi
892 906
 
893 907
     INSTALLING_MESH=1

+ 45
- 1
src/freedombone-utils-wifi Bestand weergeven

@@ -36,6 +36,9 @@ WIFI_PASSPHRASE=
36 36
 WIFI_HOTSPOT='no'
37 37
 WIFI_NETWORKS_FILE=~/${PROJECT_NAME}-wifi.cfg
38 38
 
39
+# repo for atheros AR9271 wifi driver
40
+ATHEROS_WIFI_REPO="https://github.com/qca/open-ath9k-htc-firmware.git"
41
+
39 42
 function default_network_config {
40 43
     echo '# This file describes the network interfaces available on your system' > /etc/network/interfaces
41 44
     echo '# and how to activate them. For more information, see interfaces(5).' >> /etc/network/interfaces
@@ -163,7 +166,48 @@ function install_atheros_wifi {
163 166
     if [[ $(is_completed $FUNCNAME) == "1" ]]; then
164 167
         return
165 168
     fi
166
-    apt-get -yq install open-ath9k-htc-firmware
169
+    if [ $INSTALLING_ON_BBB != "yes" ]; then
170
+        return
171
+    fi
172
+    if [[ $ENABLE_BATMAN != "yes" ]]; then
173
+        return
174
+    fi
175
+    if [ -d $INSTALL_DIR/open-ath9k-htc-firmware ]; then
176
+        return
177
+    fi
178
+    # have drivers already been installed ?
179
+    if [ -f /lib/firmware/htc_9271.fw ]; then
180
+        return
181
+    fi
182
+    apt-get -yq install build-essential cmake git m4 texinfo
183
+    if [ ! -d $INSTALL_DIR ]; then
184
+        mkdir -p $INSTALL_DIR
185
+    fi
186
+    cd $INSTALL_DIR
187
+    if [ ! -d $INSTALL_DIR/open-ath9k-htc-firmware ]; then
188
+        function_check git_clone
189
+        git_clone $ATHEROS_WIFI_REPO $INSTALL_DIR/open-ath9k-htc-firmware
190
+        if [ ! "$?" = "0" ]; then
191
+            rm -rf $INSTALL_DIR/open-ath9k-htc-firmware
192
+            exit 74283
193
+        fi
194
+    fi
195
+    cd $INSTALL_DIR/open-ath9k-htc-firmware
196
+    git checkout 1.4.0
197
+    make toolchain
198
+    if [ ! "$?" = "0" ]; then
199
+        rm -rf $INSTALL_DIR/open-ath9k-htc-firmware
200
+        exit 24820
201
+    fi
202
+    make firmware
203
+    if [ ! "$?" = "0" ]; then
204
+        rm -rf $INSTALL_DIR/open-ath9k-htc-firmware
205
+        exit 63412
206
+    fi
207
+    cp target_firmware/*.fw /lib/firmware/
208
+    if [ ! "$?" = "0" ]; then
209
+        exit 74681
210
+    fi
167 211
     mark_completed $FUNCNAME
168 212
 }
169 213