|
From: Heiko Z. <smi...@us...> - 2004-12-12 04:55:10
|
Update of /cvsroot/devil-linux/build/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12781/scripts Modified Files: build.sh functions settings Log Message: initial version of support for parallel execution of build scripts Index: functions =================================================================== RCS file: /cvsroot/devil-linux/build/scripts/functions,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- functions 10 Sep 2004 23:16:24 -0000 1.58 +++ functions 12 Dec 2004 04:54:32 -0000 1.59 @@ -419,8 +419,7 @@ } function reset_kernel_includes () { - test "$CONFIG_LINUX_VERSION" = "2.6" && return 0 - rm /usr/include/{linux,asm,asm-generic} || exit 1 + rm /usr/include/{linux,asm,asm-generic} ln -nsf $KERNELDIR/include/linux /usr/include/linux || exit 1 ln -nsf $KERNELDIR/include/asm-i386 /usr/include/asm || exit 1 ln -nsf $KERNELDIR/include/asm-generic /usr/include/asm-generic || exit 1 Index: build.sh =================================================================== RCS file: /cvsroot/devil-linux/build/scripts/build.sh,v retrieving revision 1.83 retrieving revision 1.84 diff -u -d -r1.83 -r1.84 --- build.sh 6 Sep 2004 14:13:04 -0000 1.83 +++ build.sh 12 Dec 2004 04:54:31 -0000 1.84 @@ -38,6 +38,102 @@ test -n "$RUN_ONLY_CMD" && shift case $CMD in + makefile) + CMD="build" + # set the correct "runlevel" + if [ "$CMD" = "build" ]; then + LEVEL=1 + elif [ "$CMD" = "install" ]; then + LEVEL=2 + elif [ "$CMD" = "iso" ]; then + LEVEL=3 + else + echo "Someone messed up this script :(" + exit 1 + fi + + # fake uname to display another platform we want to compile the kernel for + # also make sure our kernel version is displayed + if [ -n "$KERNELVERSION" ]; then + test -f /bin/uname.old || cp /bin/uname /bin/uname.old || exit 1 + rm /bin/uname || exit 1 + REALKERNEL=$(/bin/uname.old -r) + echo "/bin/uname.old \$* | sed -e 's/i.86/i$CONFIG_CPU/' | sed -e 's/x86_64/i$CONFIG_CPU/' | sed -e 's/$REALKERNEL/$KERNELVERSION/'" > /bin/uname || exit 1 + chmod +x /bin/uname || exit 1 + test -f /bin/arch.old || cp /bin/arch /bin/arch.old || exit 1 + echo "/bin/uname -m" > /bin/arch || exit 1 + fi + + LASTNO="" + THISGROUP="" + ALLGROUPS="" + BEFORENO="" + + rm $WORKDIR/Makefile.$CMD &> /dev/null + rm $WORKDIR/Makefile.inc*.$CMD &> /dev/null + + echo "include Makefile.inc1.$CMD" >> $WORKDIR/Makefile.$CMD + echo "include Makefile.inc2.$CMD" >> $WORKDIR/Makefile.$CMD + echo >> $WORKDIR/Makefile.$CMD + + for LINK in $( ls -v $DL_DIR/scripts/.buildorder/rc$LEVEL.d/S* 2> /dev/null) + do + + LINK=${LINK##/*/} + SCRIPT=${LINK#S[0-9][0-9]} + THISNO=${LINK:0:3} + + if [ "$THISNO" != "$LASTNO" ]; then + if [ "$THISGROUP" != "" ] ; then + echo "$LASTNO =$THISGROUP" >> $WORKDIR/Makefile.inc1.$CMD + fi + THISGROUP="" + if [ "$LASTNO" != "" ] ; then + ALLGROUPS="$ALLGROUPS \$($LASTNO)" + fi + fi + + DONEFILE="${DONE}_${CMD}_${SCRIPT}" + DONEFILE="${DONEFILE##/*/}" + + THISGROUP="$THISGROUP $DONEFILE" + + if [ ! -f "$MYDIR/$SCRIPT" ]; then + echo "ERROR" + echo "$MYDIR/$SCRIPT not found" + echo "(LINK=${LINK} - SCRIPT=${SCRIPT}" + errorbeep + exit 1 + fi + + if [ "$THISNO" != "$LASTNO" ]; then + BEFORENO=$LASTNO + fi + + if [ "$BEFORENO" != "" ] ; then + REQ="\$($BEFORENO)" + else + REQ="" + fi + + SOURCEDIR=$(find_src_dir $SCRIPT) + + echo "$DONEFILE: $REQ" >> $WORKDIR/Makefile.$CMD + echo " ( test -f $DONEFILE || ( source $MYDIR/settings ; reset_kernel_includes ; enable_et_dyn ; cd $SOURCEDIR ; $MYDIR/$SCRIPT $CMD ) )" >> $WORKDIR/Makefile.$CMD + echo " touch $DONEFILE" >> $WORKDIR/Makefile.$CMD + echo >> $WORKDIR/Makefile.$CMD + + LASTNO=$THISNO + done + if [ "$THISGROUP" != "" ] ; then + echo "$THISNO =$THISGROUP" >> $WORKDIR/Makefile.inc1.$CMD + fi + echo "all : $ALLGROUPS" >> $WORKDIR/Makefile.inc2.$CMD + + make -j 3 -C $WORKDIR -f Makefile.$CMD || exit 1 + + ;; + dist ) if [ ! -f $WORKDIR/bootcd.iso ]; then echo "You should create the ISO Image first!" Index: settings =================================================================== RCS file: /cvsroot/devil-linux/build/scripts/settings,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- settings 22 Sep 2004 14:46:03 -0000 1.42 +++ settings 12 Dec 2004 04:54:32 -0000 1.43 @@ -7,7 +7,7 @@ if [ -z $DL_DIR ] ; then echo "you must define DL_DIR" - exit + exit 1 fi source $DL_DIR/scripts/functions |