-
-############################################################################
-# #
-# Necessary shell functions #
-# #
-############################################################################
-lfsmake1() {
- if [ -f $BASEDIR/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
- cd $BASEDIR/lfs && make -f $* BUILDTARGET=$BUILDTARGET \
- MACHINE=$MACHINE \
- LFS_BASEDIR=$BASEDIR \
- ROOT=$LFS \
- KVER=$KVER \
- install >> $LOGFILE 2>&1
- if [ $? -ne 0 ]; then
- exiterror "Building $*";
- fi
- else
- exiterror "No such file or directory: $BASEDIR/$1"
- fi
- return 0
-}
-
-lfsmake2() {
- 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
- chroot $LFS /tools/bin/env -i HOME=/root \
- TERM=$TERM PS1='\u:\w\$ ' \
- PATH=/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
- VERSION=$VERSION \
- CONFIG_ROOT=$CONFIG_ROOT \
- NAME="$NAME" SNAME="$SNAME" SLOGAN="$SLOGAN" \
- CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" \
- CCACHE_DIR=/usr/src/ccache CCACHE_HASHDIR=1 \
- KVER=$KVER \
- BUILDTARGET="$BUILDTARGET" MACHINE="$MACHINE" \
- /tools/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
- else
- exiterror "No such file or directory: $BASEDIR/build/usr/src/lfs/$1"
- fi
- return 0
-}
-
-ipcopmake() {
- 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
- chroot $LFS /tools/bin/env -i HOME=/root \
- TERM=$TERM PS1='\u:\w\$ ' \
- PATH=/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin \
- VERSION=$VERSION \
- CONFIG_ROOT=$CONFIG_ROOT \
- NAME="$NAME" SNAME="$SNAME" SLOGAN="$SLOGAN" \
- CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" \
- CCACHE_DIR=/usr/src/ccache CCACHE_HASHDIR=1 \
- KVER=$KVER \
- 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
- else
- exiterror "No such file or directory: $BASEDIR/build/usr/src/lfs/$1"
- fi
- return 0
-}
-
-ipfiredist() {
- if [ -f $BASEDIR/build/usr/src/lfs/$1 ]; then
- ls $BASEDIR/packages/$1* >& /dev/null
- if [ $? -eq 1 ]; then
- echo "`date -u '+%b %e %T'`: Packaging $1" | tee -a $LOGFILE
- cp -f $BASEDIR/src/scripts/make-packages.sh $BASEDIR/build/usr/local/bin
- chroot $LFS /tools/bin/env -i HOME=/root \
- TERM=$TERM PS1='\u:\w\$ ' \
- PATH=/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin \
- VERSION=$VERSION \
- CONFIG_ROOT=$CONFIG_ROOT \
- NAME="$NAME" SNAME="$SNAME" SLOGAN="$SLOGAN" \
- CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" \
- CCACHE_DIR=/usr/src/ccache CCACHE_HASHDIR=1 \
- KVER=$KVER \
- BUILDTARGET="$BUILDTARGET" MACHINE="$MACHINE" \
- /bin/bash -x -c "cd /usr/src/lfs && \
- make -f $1 LFS_BASEDIR=/usr/src dist" >>$LOGFILE 2>&1
- if [ $? -ne 0 ]; then
- exiterror "Packaging $1"
- fi
- else
- echo -e "`date -u '+%b %e %T'`: Package with name $1 already exists!" | tee -a $LOGFILE
- fi
- else
- exiterror "No such file or directory: $BASEDIR/build/usr/src/lfs/$1"
- fi
- return 0
-}
-
-
-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
- 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 \
- 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 \
- 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
- else
- exiterror "No such file or directory: $BASEDIR/build/usr/src/lfs/$1"
- fi
- return 0
-}
-