]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - tools/make-functions
Neueste GnuMP3d-Version eingepflegt
[people/teissler/ipfire-2.x.git] / tools / make-functions
index b81ce3c9527aad96a4e9748a0b1dbeab2a366a7e..96c2bb62be7259cd0fb20c2fce5194d1102e6550 100644 (file)
@@ -106,11 +106,23 @@ beautify()
                                        ;;
                        esac
                        ;;
-               build_stage)
+               build_stage_start)
                        MESSAGE=$2
+                       STAGE_TIME_START=`date +%s`
                        echo -ne "${BOLD}*** ${MESSAGE}${SET_VER_COL}      version${SET_OPT_COL} options"
                        echo -ne "${SET_TIME_COL} time (sec)${SET_RESULT_COL} status${NORMAL}\n"
                        ;;
+               build_stage_end)
+                       STAGE_TIME_END=`date +%s`
+                       echo -ne "${BOLD}***This stage took:\t\t $[ $STAGE_TIME_END - $STAGE_TIME_START ] (secs)${NORMAL}\n"
+                       ;;
+               build_start)
+                       BUILD_TIME_START=`date +%s`
+                       ;;
+               build_end)
+                       BUILD_TIME_END=`date +%s`
+                       echo -ne "${BOLD}***Build is finished now!\nThis took:\t\t\t $[ $BUILD_TIME_END - $BUILD_TIME_START ] (secs)${NORMAL}\n"
+                       ;;
                make_pkg)
                        echo "$2" | while read PKG_VER PROGRAM OPTIONS
                        do
@@ -406,19 +418,13 @@ ipfiredist() {
 }
 
 installmake() {
-       if [ -f $BASEDIR/build/usr/src/lfs/$1 ]; then
-               echo "`date -u '+%b %e %T'`: Building $*" | tee -a $LOGFILE
-               cd $BASEDIR/lfs && make -s -f $* LFS_BASEDIR=$BASEDIR MESSAGE="$1\t " download  >> $LOGFILE 2>&1
-               if [ $? -ne 0 ]; then
-                       exiterror "Download error in $1"
-               fi
-               cd $BASEDIR/lfs && make -s -f $* LFS_BASEDIR=$BASEDIR MESSAGE="$1\t md5sum" md5  >> $LOGFILE 2>&1
-               if [ $? -ne 0 ]; then
-                       exiterror "md5sum error in $1, check file in cache or signature"
-               fi
+       lfsmakecommoncheck $*
+       [ $? == 1 ] && return 0
+
+       local PKG_TIME_START=`date +%s`
                chroot $LFS /tools/bin/env -i   HOME=/root \
                                                TERM=$TERM PS1='\u:\w\$ ' \
-                                               PATH=/usr/local/bin:/opt/$MACHINE-uClibc/usr/bin:/bin:/usr/bin:/sbin:/usr/sbin \
+                                               PATH=/opt/i586-uClibc/i586-linux-uclibc/bin:/opt/i586-uClibc/bin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin \
                                                VERSION=$VERSION \
                                                CONFIG_ROOT=$CONFIG_ROOT \
                                                LFS_PASS="install" \
@@ -429,11 +435,15 @@ installmake() {
                                                BUILDTARGET="$BUILDTARGET" MACHINE="$MACHINE" \
                    /bin/bash -x -c "cd /usr/src/lfs && \
                    make -f $* LFS_BASEDIR=/usr/src install" >>$LOGFILE 2>&1
-               if [ $? -ne 0 ]; then
-                       exiterror "Building $*"
-               fi
+
+       local COMPILE_SUCCESS=$?
+       local PKG_TIME_END=`date +%s`
+
+       if [ $COMPILE_SUCCESS -ne 0 ]; then
+               beautify result FAIL $[ $PKG_TIME_END - $PKG_TIME_START ]
+               exiterror "Building $*";
        else
-               exiterror "No such file or directory: $BASEDIR/build/usr/src/lfs/$1"
+               beautify result DONE $[ $PKG_TIME_END - $PKG_TIME_START ]
        fi
        return 0
 }
@@ -631,4 +641,48 @@ IPFIRE_MAIL_USER=$IPFIRE_MAIL_USER
 IPFIRE_MAIL_PASS=$IPFIRE_MAIL_PASS
 END
        beautify message DONE
-}
\ No newline at end of file
+}
+
+compile_tftpd() {
+       mkdir $BASEDIR/tmp
+       tar xvfz $BASEDIR/cache/tftp-hpa-0.42.tar.gz -C $BASEDIR/tmp
+       cd $BASEDIR/tmp/tftp-hpa-0.42
+               ./configure --prefix=/ipfire/trunk/tools/ \
+                       --sbindir=/ipfire/trunk/tools/ --disable-nls
+               make
+               install -c tftpd/tftpd $BASEDIR/tools/in.tftpd
+       cd -
+       rm -rf $BASEDIR/tmp/tftp-hpa-0.42
+}
+
+start_tftpd() {
+       if [ ! -e $BASEDIR/tools/in.tftpd ]; then
+               compile_tftpd
+       fi
+       reload_tftpd
+       if [ "$?" == "0" ]; then
+               $BASEDIR/tools/in.tftpd -l -s $BASEDIR/tftpboot
+               beautify message DONE
+       else
+               echo -en "You don not have a pxe boot image in your base directory.\nPlease compile first."
+               beautify message FAIL
+               exit 1
+       fi
+}
+
+stop_tftpd() {
+       echo -n "Stopping TFTPD..."
+       killall in.tftpd >/dev/null 2>&1
+       sleep 3
+       killall -9 in.tftp >/dev/null 2>&1
+       beautify message DONE
+}
+
+reload_tftpd() {
+       if [ -e $BASEDIR/ipfire-$VERSION-pxe-$MACHINE.tgz ]; then
+               mkdir -p $BASEDIR/tftpboot
+               tar xfz $BASEDIR/ipfire-$VERSION-pxe-$MACHINE.tgz -C $BASEDIR/tftpboot
+               return 0
+       fi
+       return 1
+}