Add new select_drivers helper to select more than one driver
authorLuis R. Rodriguez <lrodriguez@atheros.com>
Wed, 5 Aug 2009 18:53:44 +0000 (11:53 -0700)
committerLuis R. Rodriguez <lrodriguez@atheros.com>
Wed, 5 Aug 2009 18:53:44 +0000 (11:53 -0700)
Also add new "atheros" group which selects all atheros drivers,
this includes zydas drivers included in compat-wireless.

The "ath" group now only selects the drivers under
drivers/net/wireless/ath/

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
scripts/driver-select

index df3c1013e8ac44ab70dc3f2eeea842fa7e41ad60..e6f2ec32b77a65e3a000e81dedf302a8d4cb485e 100755 (executable)
@@ -38,7 +38,8 @@ function usage {
        done
 
        echo -e "Supported group drivers:"
-       echo -e "\t${CYAN}ath${NORMAL} < ${PURPLE} ath5k ath9k ar9170 zd1211rw ${NORMAL}>"
+       echo -e "\t${CYAN}atheros${NORMAL} < ${PURPLE} ath5k ath9k ar9170 zd1211rw ${NORMAL}>"
+       echo -e "\t${CYAN}ath${NORMAL} < ${PURPLE} ath5k ath9k ar9170 ${NORMAL}>"
        #echo -e "\t${CYAN}iwlwifi${NORMAL} < ${PURPLE} iwl3945 iwlagn${NORMAL}>"
 
        echo -e "Restoring compat-wireless:"
@@ -66,6 +67,23 @@ function select_driver
        perl -i -ne 'print if /'$1'/ ' $DRIVERS_MAKEFILE
 }
 
+function select_drivers
+{
+       backup_file $DRIVERS_MAKEFILE
+       CONFIGS=""
+       COUNT=0
+       for i in $@; do
+               if [[ "$CONFIGS" = "" ]]; then
+                       CONFIGS="$i"
+               else
+                       CONFIGS="${CONFIGS}|$i"
+               fi
+       done
+       echo -e "Configs: $CONFIGS"
+       egrep "$CONFIGS" $DRIVERS_MAKEFILE > ${DRIVERS_MAKEFILE}.tmp
+       mv ${DRIVERS_MAKEFILE}.tmp ${DRIVERS_MAKEFILE}
+}
+
 function disable_lib80211
 {
        backup_file $NET_WIRELESS_MAKEFILE
@@ -168,8 +186,13 @@ case $1 in
        restore)
                restore_compat
                ;;
+       atheros)
+               select_drivers          CONFIG_ATH_COMMON \
+                                       CONFIG_ZD1211RW
+               disable_var_01
+               ;;
        ath)
-               select_driver           CONFIG_ATH_COMMON
+               select_drivers          CONFIG_ATH_COMMON
                disable_var_01
                ;;
        ath5k)