[aadk-commits] dbailey: trunk r176 - /trunk/scripts/build-distro
    aadk-commits at lists.digium.com 
    aadk-commits at lists.digium.com
       
    Mon Feb 26 08:14:38 MST 2007
    
    
  
Author: dbailey
Date: Mon Feb 26 09:14:37 2007
New Revision: 176
URL: http://svn.digium.com/view/aadk?view=rev&rev=176
Log:
Tweaked distro build to remove romfs directory if version information changes
The kernel could not find kernel modules when the localversion file changed which affected path names in the file system 
Modified:
    trunk/scripts/build-distro
Modified: trunk/scripts/build-distro
URL: http://svn.digium.com/view/aadk/trunk/scripts/build-distro?view=diff&rev=176&r1=175&r2=176
==============================================================================
--- trunk/scripts/build-distro (original)
+++ trunk/scripts/build-distro Mon Feb 26 09:14:37 2007
@@ -1,13 +1,40 @@
 #!/bin/sh -e
 cd ../
 . scripts/build-common
+
+LOCALVERSIONFILE="uClinux/uClinux-dist/linux-2.6.x/localversion-Digium"
+ALLLOCALVERSIONFILE="uClinux/uClinux-dist/linux-2.6.x/localversion-*"
+IMAGEDIR="uClinux/uClinux-dist/romfs"
 
 if [ -f ".version" -a -f ".flavor" ]; then 
 	echo "Version Files exist"
 	VER=`cat .version`
 	FLAVOR=`cat .flavor`
-	rm uClinux/uClinux-dist/linux-2.6.x/localversion-*
-	echo ${FLAVOR}"-"${VER} >uClinux/uClinux-dist/linux-2.6.x/localversion-Digium
+# Test to see if the local version file exists or has changed 
+#	If so, the existing romfs image must be purged
+	if [ ! -f ${LOCALVERSIONFILE} ]; then
+		echo "Cannot find localversion file"
+		if [ -d ${IMAGEDIR} ]; then 
+			echo "Deleting romfs image, YOU MUST REBUILD ASTERISK!!!!!!"
+			rm -r $IMAGEDIR
+		fi
+	else 
+		if [ ${FLAVOR}"-"${VER} != `cat $LOCALVERSIONFILE ` ]; then
+			echo "Text does not match in localversion file"
+			if [ -d ${IMAGEDIR} ]; then 
+				echo "Deleting romfs image, YOU MUST REBUILD ASTERISK!!!!!!"
+				rm -r $IMAGEDIR
+			fi
+		fi
+	fi
+	
+# Delete any non-digium localversion files and then regenerate the Digium file
+	for filename in $ALLLOCALVERSIONFILE; do
+	if [ -e $filename ] ; then 
+			rm $filename
+		fi
+	done
+	echo ${FLAVOR}"-"${VER} >$LOCALVERSIONFILE
 fi 
 
 cd uClinux/uClinux-dist
    
    
More information about the aadk-commits
mailing list