]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - tools/make-functions
Alle htdocs nach /srv/web verschoben...
[people/pmueller/ipfire-2.x.git] / tools / make-functions
index 147d76b6fbd5b3b210637e43c0c334a31b04d538..48b5df696996aaee5a80d3ed9ca0ffce3f7c411f 100644 (file)
@@ -334,6 +334,7 @@ lfsmake2() {
                                                CCACHE_DIR=/usr/src/ccache CCACHE_HASHDIR=1 \
                                                KVER=$KVER MAKETUNING=$MAKETUNING \
                                                BUILDTARGET="$BUILDTARGET" MACHINE="$MACHINE" \
+                                               IPFVER="$IPFVER" \
                                                /tools/bin/bash -x -c "cd /usr/src/lfs && \
                                                make -f $* LFS_BASEDIR=/usr/src install" >>$LOGFILE 2>&1
        local COMPILE_SUCCESS=$?
@@ -364,6 +365,7 @@ ipfiremake() {
                                                CCACHE_DIR=/usr/src/ccache CCACHE_HASHDIR=1 \
                                                KVER=$KVER MAKETUNING=$MAKETUNING \
                                                BUILDTARGET="$BUILDTARGET" MACHINE="$MACHINE" \
+                                               IPFVER="$IPFVER" \
                                                /bin/bash -x -c "cd /usr/src/lfs && \
                                                make -f $* LFS_BASEDIR=/usr/src install" >>$LOGFILE 2>&1
 
@@ -390,7 +392,7 @@ ipfiredist() {
                                                NAME="$NAME" SNAME="$SNAME" SLOGAN="$SLOGAN" \
                                                CFLAGS="$C2FLAGS" CXXFLAGS="$CXX2FLAGS" \
                                                CCACHE_DIR=/usr/src/ccache CCACHE_HASHDIR=1 \
-                                               KVER=$KVER \
+                                               KVER=$KVER IPFVER="$IPFVER" \
                                                BUILDTARGET="$BUILDTARGET" MACHINE="$MACHINE" \
                    /bin/bash -x -c "cd /usr/src/lfs && \
                    make -f $1 LFS_BASEDIR=/usr/src dist" >>$LOGFILE 2>&1
@@ -404,34 +406,32 @@ 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" \
                                                NAME="$NAME" SNAME="$SNAME" SLOGAN="$SLOGAN" \
                                                CFLAGS="-Os" CXXFLAGS="-Os" \
                                                CCACHE_DIR=/usr/src/ccache CCACHE_HASHDIR=1 \
-                                               KVER=$KVER \
+                                               KVER=$KVER IPFVER="$IPFVER" \
                                                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
 }
@@ -629,4 +629,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
+}