Browse Source

implement fast mode, remove rebuild option

Waldemar Brodkorb 10 years ago
parent
commit
508659a521
1 changed files with 20 additions and 17 deletions
  1. 20 17
      embedded-test.sh

+ 20 - 17
embedded-test.sh

@@ -54,12 +54,12 @@ Explanation:
 	-a: architecture to check (otherwise all supported)
 	-a: architecture to check (otherwise all supported)
 	-u: update openadk source via git pull, before building
 	-u: update openadk source via git pull, before building
 	-s: use directory with source for C library
 	-s: use directory with source for C library
+	-f: enable fast compile, after a failure no rebuild
 	-d: enable debug output from OpenADK
 	-d: enable debug output from OpenADK
 	-c: clean OpenADK build directory before build
 	-c: clean OpenADK build directory before build
 	-n: set NTP server for test run
 	-n: set NTP server for test run
 	-t: run tests (boot|libc|ltp|native)
 	-t: run tests (boot|libc|ltp|native)
 	-p: add extra packages to build
 	-p: add extra packages to build
-	-r: rebuild C library
 	-m: start a shell in Qemu system for manual testing
 	-m: start a shell in Qemu system for manual testing
 	-h: help text
 	-h: help text
 EOF
 EOF
@@ -71,11 +71,11 @@ shell=0
 update=0
 update=0
 debug=0
 debug=0
 git=0
 git=0
-rebuild=0
+fast=0
 
 
 ntp=time.fu-berlin.de
 ntp=time.fu-berlin.de
 
 
-while getopts "hgrumdcn:a:s:l:t:p:" ch; do
+while getopts "hfgumdcn:a:s:l:t:p:" ch; do
         case $ch in
         case $ch in
                 m)
                 m)
                         shell=1
                         shell=1
@@ -89,12 +89,12 @@ while getopts "hgrumdcn:a:s:l:t:p:" ch; do
                 d)
                 d)
                         debug=1
                         debug=1
                         ;;
                         ;;
+                f)
+                        fast=1
+                        ;;
                 u)
                 u)
                         update=1
                         update=1
                         ;;
                         ;;
-                r)
-                        rebuild=1
-                        ;;
                 s)
                 s)
                         source=$OPTARG
                         source=$OPTARG
                         ;;
                         ;;
@@ -428,12 +428,13 @@ build() {
 	make prereq
 	make prereq
 
 
 	# always trigger regeneration of kernel config
 	# always trigger regeneration of kernel config
-	rm build_*_${lib}_${arch}*/linux/.config > /dev/null 2>&1
-	if [ $rebuild -eq 1 ];then
+	#rm build_*_${lib}_${arch}*/linux/.config > /dev/null 2>&1
+
+	# download and rebuild C library package
+	if [ $fast -eq 0 ];then
 		rm dl/$lib*
 		rm dl/$lib*
+		make package=$lib clean > /dev/null 2>&1
 	fi
 	fi
-	# always rebuild C library package
-	make package=$lib clean > /dev/null 2>&1
 
 
 	DEFAULT="ADK_TARGET_LIBC=$lib ADK_TARGET_FS=initramfsarchive"
 	DEFAULT="ADK_TARGET_LIBC=$lib ADK_TARGET_FS=initramfsarchive"
 
 
@@ -657,13 +658,15 @@ for lib in ${libc}; do
 			echo "Not a directory."
 			echo "Not a directory."
 			exit 1
 			exit 1
 		fi
 		fi
-		usrc=$(mktemp -d /tmp/XXXX)
-		echo "Creating source tarball openadk/dl/${libver}.tar.xz"
-		cp -a $source $usrc/$libver
-		mkdir -p $topdir/openadk/dl 2>/dev/null
-		rm $topdir/openadk/dl/${libver}.tar.xz 2>/dev/null
-		(cd $usrc && tar cJf $topdir/openadk/dl/${libver}.tar.xz ${libver} )
-		touch $topdir/openadk/dl/${libver}.tar.xz.nohash
+		if [ $fast -eq 0 ];then
+			usrc=$(mktemp -d /tmp/XXXX)
+			echo "Creating source tarball openadk/dl/${libver}.tar.xz"
+			cp -a $source $usrc/$libver
+			mkdir -p $topdir/openadk/dl 2>/dev/null
+			rm $topdir/openadk/dl/${libver}.tar.xz 2>/dev/null
+			(cd $usrc && tar cJf $topdir/openadk/dl/${libver}.tar.xz ${libver} )
+			touch $topdir/openadk/dl/${libver}.tar.xz.nohash
+		fi
 	fi
 	fi
 
 
 	echo "Architectures to test: $archlist"
 	echo "Architectures to test: $archlist"