]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - wilink8-wlan/build-utilites.git/blobdiff - build_wl18xx.sh
General fixes to install the modules correctly
[wilink8-wlan/build-utilites.git] / build_wl18xx.sh
index 68b2fd14bbd2807f7209e9a07dcd16b46a4aafda..d2fd338835a81414e2cd6422be3312b17492a7d1 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
@@ -257,20 +270,22 @@ function build_uimage()
        [ -z $NO_CLEAN ] && make clean
        [ -z $NO_CLEAN ] && assert_no_error
        
-    make -j${PROCESSORS_NUMBER} uImage
-       
-    #TODO: Add support for kernel compilation with dtb file integrated to uImage:
-    #LOADADDR=0x80008000 make -j${PROCESSORS_NUMBER} uImage.am335x-evm
-               
     if [ "$KERNEL_VERSION" -eq 3 ] && [ "$KERNEL_PATCHLEVEL" -eq 2 ]
     then
+        make -j${PROCESSORS_NUMBER} uImage
         cp `repo_path kernel`/arch/arm/boot/uImage `path tftp`/uImage
-    else               
-        make -j${PROCESSORS_NUMBER} am335x-evm.dtb
-        cp `repo_path kernel`/arch/arm/boot/zImage `path tftp`/zImage
-        cp `repo_path kernel`/arch/arm/boot/dts/am335x-evm.dtb `path tftp`/am335x-evm.dtb
+    else
+        if [ -z $NO_DTB ] 
+        then
+            make -j${PROCESSORS_NUMBER} uImage
+            make -j${PROCESSORS_NUMBER} am335x-evm.dtb
+            cp `repo_path kernel`/arch/arm/boot/zImage `path tftp`/zImage
+            cp `repo_path kernel`/arch/arm/boot/dts/am335x-evm.dtb `path tftp`/am335x-evm.dtb
+        else
+            LOADADDR=0x80008000 make -j${PROCESSORS_NUMBER} uImage.am335x-evm 
+            cp `repo_path kernel`/arch/arm/boot/uImage.am335x-evm `path tftp`/uImage
+        fi
     fi
-        
        assert_no_error
        cd_back
 }
@@ -284,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
@@ -304,7 +320,7 @@ function build_modules()
 function build_openssl()
 {
        cd_repo openssl
-       [ -z $NO_CONFIG ] && ./Configure s/compiler:gcc
+       [ -z $NO_CONFIG ] && ./Configure linux-generic32
        [ -z $NO_CLEAN ] && make clean
        [ -z $NO_CLEAN ] && assert_no_error
        make
@@ -319,7 +335,7 @@ function build_libnl()
        cd_repo libnl
        [ -z $NO_CONFIG ] && ./autogen.sh
        [ -z $NO_CONFIG ] && ./configure --prefix=`path filesystem` --host=${ARCH} CC=${CROSS_COMPILE}gcc AR=${CROSS_COMPILE}ar
-       [ -z $NO_CLEAN ] && make clean
+       ([ -z $NO_CONFIG ] || [ -z $NO_CLEAN ]) && make clean
        [ -z $NO_CLEAN ] && assert_no_error
        make
        assert_no_error
@@ -403,6 +419,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
@@ -429,18 +446,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()
@@ -455,9 +474,14 @@ function build_outputs()
         if [ "$KERNEL_VERSION" -eq 3 ] && [ "$KERNEL_PATCHLEVEL" -eq 2 ]
         then
             cp `path tftp`/uImage `path outputs`/uImage
-        else                  
-            cp `path tftp`/zImage `path outputs`/zImage
-            cp `path tftp`/am335x-evm.dtb `path outputs`/am335x-evm.dtb
+        else
+            if [ -z $NO_DTB ]
+            then
+                cp `path tftp`/zImage `path outputs`/zImage
+                cp `path tftp`/am335x-evm.dtb `path outputs`/am335x-evm.dtb
+            else
+                cp `path tftp`/uImage `path outputs`/uImage
+            fi
         fi             
     fi
 }
@@ -509,11 +533,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"
 
@@ -623,8 +647,6 @@ function setup_workspace()
 
 function build_all()
 {
-    read_kernel_version
-
     if [ -z $NO_EXTERNAL ] 
     then        
         [ $DEFAULT_KERNEL ] && build_uimage
@@ -645,7 +667,6 @@ function build_all()
     fi
     
     [ -z $NO_VERIFY ] && verify_skeleton
-    
 }
 
 function setup_and_build()
@@ -657,9 +678,10 @@ function setup_and_build()
 function main()
 {
        [[ "$1" == "-h" || "$1" == "--help"  ]] && usage
-
+    check_for_build_updates
     setup_environment
     setup_directories
+    read_kernel_version
     
        case "$1" in
                'update')                
@@ -672,9 +694,10 @@ function main()
             print_highlight "Updating all to head (this will revert local changes)" 
             RESET=1    
         fi
-               clean_kernel
+        clean_kernel
         clean_outputs        
         setup_workspace
+        read_kernel_version #####read kernel version again after update#####
         build_all
                ;;
         
@@ -683,7 +706,7 @@ function main()
                [[  -n "$2" ]] && echo "Using tag $2 " && USE_TAG=$2                
         NO_BUILD=1 
         setup_workspace
-        read_kernel_version
+        read_kernel_version #####read kernel version again after init#####
                ;;
               
         'clean')        
@@ -705,10 +728,15 @@ function main()
         #################### Building single components #############################
                'kernel')
                print_highlight " building only Kernel "
-               read_kernel_version
+                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
@@ -729,6 +757,16 @@ function main()
                build_crda
                ;;
         
+               'libnl')
+               print_highlight " building only libnl"
+               build_libnl
+               ;;
+
+               'openssl')
+               print_highlight " building only openssl"
+               build_openssl
+               ;;
+
         'scripts')
         print_highlight " Copying scripts "
                build_scripts_download