]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - wilink8-wlan/build-utilites.git/blobdiff - build_wl18xx.sh
build_wl18xx.sh: Add option to compile with dtb file
[wilink8-wlan/build-utilites.git] / build_wl18xx.sh
index 870fb5eb2c65ae7410215d7c25bc355e419ec7f5..56c188e026170804c7a4faeb8a4de1f99c86ed8c 100755 (executable)
@@ -223,9 +223,9 @@ function setup_branches()
                url=${repositories[$i + 1]}
         branch=${repositories[$i + 2]}   
         checkout_type="branch"       
-        #for all the openlink repo. we use a tag if provided.        
+        #for all the openlink repo. we use a tag if provided.               
         [ "$name" == "kernel" ] && [ -z "$DEFAULT_KERNEL" ] && i=$[$i + 3] && continue
-        cd_repo $name    
+        cd_repo $name  
         echo -e "\n${NORMAL}Checking out branch ${GREEN}$branch  ${NORMAL}in repo ${GREEN}$name ${NORMAL} "
                git checkout $branch        
         git fetch origin
@@ -252,20 +252,28 @@ function setup_toolchain()
 
 function build_uimage()
 {
-       cd_repo kernel
+    cd_repo kernel
        [ -z $NO_CONFIG ] && cp `path configuration`/kernel_$KERNEL_VERSION.$KERNEL_PATCHLEVEL.config `repo_path kernel`/.config
        [ -z $NO_CLEAN ] && make clean
        [ -z $NO_CLEAN ] && assert_no_error
        
-        if [ "$KERNEL_VERSION" -eq 3 ] && [ "$KERNEL_PATCHLEVEL" -eq 2 ]
+    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
+        if [ -z $NO_DTB ] 
         then
-           make -j${PROCESSORS_NUMBER} uImage
+            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.dtba
         else
-            LOADADDR=0x80008000 make -j${PROCESSORS_NUMBER} uImage.am335x-evm
+            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
-       cp `repo_path kernel`/arch/arm/boot/uImage `path tftp`/uImage
        cd_back
 }
 
@@ -379,7 +387,7 @@ function build_calibrator()
 
 function build_wlconf()
 {
-       files_to_copy="dictionary.txt struct.bin wl18xx-conf-default.bin README example.conf example.ini configure-device.sh"
+       files_to_copy="dictionary.txt struct.bin default.conf wl18xx-conf-default.bin README example.conf example.ini configure-device.sh"
        cd `repo_path ti_utils`/wlconf
        if [ -z $NO_CLEAN ]; then
                NFSROOT=`path filesystem` make clean
@@ -421,9 +429,16 @@ function build_scripts_download()
        cd_back
 }
 
+function clean_kernel()
+{
+       echo "Cleaning kernel folder"
+       cd_repo kernel
+       git clean -fdx > /dev/null      
+}
+
 function clean_outputs()
 {
-       echo "Cleaning outputs"    
+       echo "Cleaning outputs"   
     rm -rf `path filesystem`/*
     rm -f `path outputs`/${tar_filesystem[0]}
        rm -f `path outputs`/uImage
@@ -438,7 +453,19 @@ function build_outputs()
         cd_path filesystem
         tar cpjf `path outputs`/${tar_filesystem[0]} .
         cd_back
-        cp `path tftp`/uImage `path outputs`/uImage
+               
+        if [ "$KERNEL_VERSION" -eq 3 ] && [ "$KERNEL_PATCHLEVEL" -eq 2 ]
+        then
+            cp `path tftp`/uImage `path outputs`/uImage
+        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
 }
 
@@ -603,8 +630,6 @@ function setup_workspace()
 
 function build_all()
 {
-    read_kernel_version
-
     if [ -z $NO_EXTERNAL ] 
     then        
         [ $DEFAULT_KERNEL ] && build_uimage
@@ -625,7 +650,6 @@ function build_all()
     fi
     
     [ -z $NO_VERIFY ] && verify_skeleton
-    
 }
 
 function setup_and_build()
@@ -640,6 +664,7 @@ function main()
 
     setup_environment
     setup_directories
+    read_kernel_version
     
        case "$1" in
                'update')                
@@ -651,8 +676,11 @@ function main()
         else
             print_highlight "Updating all to head (this will revert local changes)" 
             RESET=1    
-        fi        
+        fi
+        clean_kernel
+        clean_outputs        
         setup_workspace
+        read_kernel_version #####read kernel version again after update#####
         build_all
                ;;
         
@@ -661,10 +689,9 @@ 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')        
         print_highlight " cleaning & building all "       
         clean_outputs
@@ -684,6 +711,7 @@ function main()
         #################### Building single components #############################
                'kernel')
                print_highlight " building only Kernel "
+                clean_kernel
                build_uimage
                ;;
 
@@ -694,8 +722,7 @@ function main()
 
                'wpa_supplicant')
         print_highlight " building only wpa_supplicant "
-               build_wpa_supplicant
-        
+               build_wpa_supplicant      
                ;;
 
                'hostapd')
@@ -712,6 +739,7 @@ function main()
         print_highlight " Copying scripts "
                build_scripts_download
                ;;
+               
         'utils')
         print_highlight " building only ti-utils "
         build_calibrator