]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - wilink8-wlan/build-utilites.git/blobdiff - build_wl18xx.sh
configuration.sh: update driver & hostap branches
[wilink8-wlan/build-utilites.git] / build_wl18xx.sh
index a732f37501939b49233abd9f8cbb7661675e50c0..c9fa82f8d9851f0a86c689cbdd5586512e9d1adc 100755 (executable)
@@ -109,9 +109,22 @@ function cd_back()
        cd - > /dev/null
 }
 
+function check_for_build_updates()
+{
+        count=`git status -uno | grep behind | wc -l`
+        if [ $count -ne 0 ]
+        then
+                echo ""
+               echo "*** Please note, there is an updated build script avilalable ***"
+               echo "*** Use 'git pull' to get the latest update. ***" 
+               echo ""
+               sleep 5
+        fi
+}
+
 function read_kernel_version()
 {
-        filename=`repo_path kernel`/Makefile
+        filename=$KERNEL_PATH/Makefile
 
         if [ ! -f $filename ]
         then
@@ -172,7 +185,7 @@ function setup_environment()
        export PKG_CONFIG_PATH=`path filesystem`/lib/pkgconfig
        export INSTALL_PREFIX=`path filesystem`
        export LIBNL_PATH=`repo_path libnl`     
-       export KLIB=${KERNEL_PATH}
+       export KLIB=`path filesystem`
        export KLIB_BUILD=${KERNEL_PATH}
         export GIT_TREE=`repo_path driver`
         export PATH=$TOOLCHAIN_PATH:$PATH
@@ -286,18 +299,19 @@ function generate_compat()
 
 function build_modules()
 {
-    generate_compat
+       generate_compat
        cd_repo compat_wireless
        if [ -z $NO_CLEAN ]; then
                make clean
        fi
        make defconfig-wl18xx
-    make -j${PROCESSORS_NUMBER} 
+       make -j${PROCESSORS_NUMBER}
        assert_no_error
        find . -name \*.ko -exec cp {} `path debugging`/ \;
        find . -name \*.ko -exec ${CROSS_COMPILE}strip -g {} \;
     
-       make -C ${KERNEL_PATH} M=`pwd` "INSTALL_MOD_PATH=`path filesystem`" modules_install
+#      make -C ${KERNEL_PATH} M=`pwd` "INSTALL_MOD_PATH=`path filesystem`" modules_install
+       make  modules_install
        assert_no_error
        #chmod -R 0777 ${PATH__FILESYSTEM}/lib/modules/
        cd_back
@@ -316,6 +330,18 @@ function build_openssl()
        cd_back
 }
 
+
+function build_iw()
+{
+       cd_repo iw
+       [ -z $NO_CLEAN ] && make clean
+       [ -z $NO_CLEAN ] && assert_no_error
+       CC=${CROSS_COMPILE}gcc LIBS+=" -lpthread -lm" make V=1
+       assert_no_error
+       DESTDIR=`path filesystem` make install
+       assert_no_error
+       cd_back
+}
 function build_libnl()
 {
        cd_repo libnl
@@ -348,6 +374,7 @@ function build_hostapd()
 {             
     cd `repo_path hostap`/hostapd
        [ -z $NO_CONFIG ] && cp android.config .config
+       [ -n "$UPNP_EN" ] && echo "Enable UPNP config" && sed -i "/#CONFIG_WPS_UPNP=y/ s/# *//" .config
        CONFIG_LIBNL32=y DESTDIR=`path filesystem` make clean
        assert_no_error
        CONFIG_LIBNL32=y DESTDIR=`path filesystem` CFLAGS+="-I`path filesystem`/usr/local/ssl/include -I`repo_path libnl`/include" LIBS+="-L`path filesystem`/lib -L`path filesystem`/usr/local/ssl/lib -lssl -lcrypto -lm -ldl -lpthread" LIBS_p+="-L`path filesystem`/lib -L`path filesystem`/usr/local/ssl/lib -lssl -lcrypto -lm -ldl -lpthread" make -j${PROCESSORS_NUMBER} CC=${CROSS_COMPILE}gcc LD=${CROSS_COMPILE}ld AR=${CROSS_COMPILE}ar
@@ -405,6 +432,7 @@ function build_wlconf()
        chmod 755 `path filesystem`/usr/sbin/wlconf
        for file_to_copy in $files_to_copy; do
                cp $file_to_copy `path filesystem`/usr/sbin/wlconf/$file_to_copy
+               echo "echoying files $file_to_copy"
        done
        cp official_inis/* `path filesystem`/usr/sbin/wlconf/official_inis/
        cd_back
@@ -431,18 +459,20 @@ function build_scripts_download()
 
 function clean_kernel()
 {
-       echo "Cleaning kernel folder"
-       cd_repo kernel
-       git clean -fdx > /dev/null      
+       [ "$DEFAULT_KERNEL" ] && echo "Cleaning kernel folder"
+       [ "$DEFAULT_KERNEL" ] && cd_repo kernel
+       [ "$DEFAULT_KERNEL" ] && git clean -fdx > /dev/null
 }
 
 function clean_outputs()
 {
-       echo "Cleaning outputs"   
-    rm -rf `path filesystem`/*
-    rm -f `path outputs`/${tar_filesystem[0]}
+    if [[ "$ROOTFS" == "DEFAULT" ]]
+    then
+        echo "Cleaning outputs"
+        rm -rf `path filesystem`/*
+        rm -f `path outputs`/${tar_filesystem[0]}
        rm -f `path outputs`/uImage
-       
+   fi
 }
 
 function build_outputs()
@@ -516,11 +546,11 @@ function set_files_to_verify()
         `repo_path fw_download`/wl18xx-fw-4.bin
         "data"
 
-        `path filesystem`/lib/modules/$KERNEL_VERSION.$KERNEL_PATCHLEVEL.*/extra/drivers/net/wireless/ti/wl18xx/wl18xx.ko
+        `path filesystem`/lib/modules/$KERNEL_VERSION.$KERNEL_PATCHLEVEL.*/updates/drivers/net/wireless/ti/wl18xx/wl18xx.ko
         `path compat_wireless`/drivers/net/wireless/ti/wl18xx/wl18xx.ko
         "ELF 32-bit LSB relocatable, ARM"
 
-        `path filesystem`/lib/modules/$KERNEL_VERSION.$KERNEL_PATCHLEVEL.*/extra/drivers/net/wireless/ti/wlcore/wlcore.ko
+        `path filesystem`/lib/modules/$KERNEL_VERSION.$KERNEL_PATCHLEVEL.*/updates/drivers/net/wireless/ti/wlcore/wlcore.ko
         `path compat_wireless`/drivers/net/wireless/ti/wlcore/wlcore.ko
         "ELF 32-bit LSB relocatable, ARM"
 
@@ -641,6 +671,7 @@ function build_all()
     if [ -z $NO_TI ] 
     then
         build_modules
+        build_iw
         build_wpa_supplicant
         build_hostapd  
         build_calibrator
@@ -661,7 +692,7 @@ function setup_and_build()
 function main()
 {
        [[ "$1" == "-h" || "$1" == "--help"  ]] && usage
-
+    check_for_build_updates
     setup_environment
     setup_directories
     read_kernel_version
@@ -714,7 +745,12 @@ function main()
                 clean_kernel
                build_uimage
                ;;
-
+               
+                'kernel_modules')
+        print_highlight " building only Driver modules "
+                build_uimage
+               build_modules
+                ;;
                'modules')
         print_highlight " building only Driver modules "
                build_modules
@@ -740,6 +776,11 @@ function main()
                build_libnl
                ;;
 
+               'iw')
+               print_highlight " building only iw"
+               build_iw
+               ;;
+
                'openssl')
                print_highlight " building only openssl"
                build_openssl