2 ############################################################################
4 # This file is part of the IPFire Firewall. #
6 # IPFire is free software; you can redistribute it and/or modify #
7 # it under the terms of the GNU General Public License as published by #
8 # the Free Software Foundation; either version 2 of the License, or #
9 # (at your option) any later version. #
11 # IPFire is distributed in the hope that it will be useful, #
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 # GNU General Public License for more details. #
16 # You should have received a copy of the GNU General Public License #
17 # along with IPFire; if not, write to the Free Software #
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
20 # Copyright (C) 2006 IPFire-Team <info@ipfire.eu>. #
22 ############################################################################
25 NAME
="IPFire" # Software name
26 SNAME
="ipfire" # Short name
27 VERSION
="2.0" # Version number
28 SLOGAN
="www.ipfire.eu" # Software slogan
29 CONFIG_ROOT
=/var
/ipfire
# Configuration rootdir
31 MAX_RETRIES
=3 # prefetch/check loop
32 KVER
=`grep --max-count=1 VER lfs/linux | awk '{ print $3 }'`
34 SVN_REVISION
=`svn info | grep Revision | cut -c 11-`
36 # Setzen des IPFire Builds
37 if [ -e .
/.svn
]; then
38 FIREBUILD
=`cat .svn/entries |sed -n 's/^[ \t]*revision=\"// p' | sed -n 's/\".*$// p'`
41 # Debian specific settings
42 if [ ! -e /etc
/debian_version
]; then
45 if [ -x /usr
/bin
/realpath
]; then
46 FULLPATH
=`/usr/bin/realpath $0`
48 echo "ERROR: Need to do apt-get install realpath"
54 BASENAME
=`basename $0`
55 BASEDIR
=`echo $FULLPATH | sed "s/\/$BASENAME//g"`
56 LOGFILE
=$BASEDIR/log
/_build.preparation.log
57 export BASEDIR LOGFILE
58 DIR_CHK
=$BASEDIR/cache
/check
59 mkdir
$BASEDIR/log
/ 2>/dev
/null
62 . tools
/make-functions
64 if [ -f .config
]; then
71 ############################################################################
73 # Are we running the right shell? #
75 ############################################################################
76 if [ ! "$BASH" ]; then
77 exiterror
"BASH environment variable is not set. You're probably running the wrong shell."
80 if [ -z "${BASH_VERSION}" ]; then
81 exiterror
"Not running BASH shell."
85 ############################################################################
87 # Trap on emergency exit #
89 ############################################################################
90 trap "exiterror 'Build process interrupted'" SIGINT SIGTERM SIGKILL SIGSTOP SIGQUIT
93 ############################################################################
95 # Resetting our nice level #
97 ############################################################################
98 echo -ne "`date -u '+%b %e %T'`: Resetting our nice level to $NICE" |
tee -a $LOGFILE
99 renice
$NICE $$
> /dev
/null
100 if [ `nice` != "$NICE" ]; then
101 beautify message FAIL
102 exiterror
"Failed to set correct nice level"
104 beautify message DONE
108 ############################################################################
110 # Checking if running as root user #
112 ############################################################################
113 echo -ne "`date -u '+%b %e %T'`: Checking if we're running as root user" |
tee -a $LOGFILE
114 if [ `id -u` != 0 ]; then
115 beautify message FAIL
116 exiterror
"Not building as root"
118 beautify message DONE
122 ############################################################################
124 # Checking for necessary temporary space #
126 ############################################################################
127 echo -ne "`date -u '+%b %e %T'`: Checking for necessary space on disk $BASE_DEV" |
tee -a $LOGFILE
128 BASE_DEV
=`df -P -k $BASEDIR | tail -n 1 | awk '{ print $1 }'`
129 BASE_ASPACE
=`df -P -k $BASEDIR | tail -n 1 | awk '{ print $4 }'`
130 if (( 2202000 > $BASE_ASPACE )); then
131 BASE_USPACE
=`du -skx $BASEDIR | awk '{print $1}'`
132 if (( 2202000 - $BASE_USPACE > $BASE_ASPACE )); then
133 beautify message FAIL
134 exiterror
"Not enough temporary space available, need at least 2.1GB on $BASE_DEV"
137 beautify message DONE
140 ############################################################################
142 # Building Linux From Scratch system #
144 ############################################################################
145 echo "`date -u '+%b %e %T'`: Building Linux From Scratch system" |
tee -a $LOGFILE
153 # Check /tools symlink
154 if [ -h /tools
]; then
157 if [ ! -a /tools
]; then
158 ln -s $BASEDIR/build
/tools
/
160 if [ ! -h /tools
]; then
161 exiterror
"Could not create /tools symbolic link."
168 export LFS LC_ALL CFLAGS CXXFLAGS MAKETUNING
169 unset CC CXX CPP LD_LIBRARY_PATH LD_PRELOAD
171 # Make some extra directories
172 mkdir
-p $BASEDIR/build
/{tools
,etc
,usr
/src
} 2>/dev
/null
173 mkdir
-p $BASEDIR/{cache
,ccache
} 2>/dev
/null
174 mkdir
-p $BASEDIR/build
/dev
/pts
$BASEDIR/build
/proc
$BASEDIR/build
/usr
/src
/{cache
,config
,doc
,html
,langs
,lfs
,log
,src
,ccache
}
176 # Make all sources and proc available under lfs build
177 mount
--bind /dev
/pts
$BASEDIR/build
/dev
/pts
178 mount
--bind /proc
$BASEDIR/build
/proc
179 mount
--bind $BASEDIR/cache
$BASEDIR/build
/usr
/src
/cache
180 mount
--bind $BASEDIR/ccache
$BASEDIR/build
/usr
/src
/ccache
181 mount
--bind $BASEDIR/config
$BASEDIR/build
/usr
/src
/config
182 mount
--bind $BASEDIR/doc
$BASEDIR/build
/usr
/src
/doc
183 mount
--bind $BASEDIR/html
$BASEDIR/build
/usr
/src
/html
184 mount
--bind $BASEDIR/langs
$BASEDIR/build
/usr
/src
/langs
185 mount
--bind $BASEDIR/lfs
$BASEDIR/build
/usr
/src
/lfs
186 mount
--bind $BASEDIR/log
$BASEDIR/build
/usr
/src
/log
187 mount
--bind $BASEDIR/src
$BASEDIR/build
/usr
/src
/src
189 # Run LFS static binary creation scripts one by one
190 export CCACHE_DIR
=$BASEDIR/ccache
191 export CCACHE_HASHDIR
=1
193 # Remove pre-install list of installed files in case user erase some files before rebuild
194 rm -f $BASEDIR/build
/usr
/src
/lsalr
2>/dev
/null
198 LOGFILE
="$BASEDIR/log/_build.toolchain.log"
201 NATIVEGCC
=`gcc --version | grep GCC | awk {'print $3'}`
202 export NATIVEGCC GCCmajor
=${NATIVEGCC:0:1} GCCminor=${NATIVEGCC:2:1} GCCrelease=${NATIVEGCC:4:1}
204 lfsmake1 binutils PASS
=1
206 export PATH
=$BASEDIR/build
/usr
/local
/bin
:$BASEDIR/build
/tools
/bin
:$PATH
207 lfsmake1 linux-libc-header
213 lfsmake1 binutils PASS
=2
232 lfsmake1 cleanup-toolchain
233 export PATH
=$ORG_PATH
237 LOGFILE
="$BASEDIR/log/_build.base.log"
293 LOGFILE
="$BASEDIR/log/_build.ipfire.log"
295 ipfiremake configroot
304 ipfiremake linux PASS
=ipfire SMP
=installer
305 ipfiremake linux PASS
=ipfire SMP
=1
306 ipfiremake
3cp4218 SMP
=1
307 ipfiremake amedyn SMP
=1
308 ipfiremake cxacru SMP
=1
309 ipfiremake eagle SMP
=1
310 ipfiremake cnx_pci SMP
=1
311 ipfiremake fcdsl SMP
=1
312 ipfiremake fcdsl2 SMP
=1
313 ipfiremake fcdslsl SMP
=1
314 ipfiremake fcdslusb SMP
=1
315 ipfiremake fcdslslusb SMP
=1
316 ipfiremake fcpci SMP
=1
317 ipfiremake fcclassic SMP
=1
318 ipfiremake pulsar SMP
=1
319 ipfiremake unicorn SMP
=1
320 ipfiremake promise-sata-300-tx SMP
=1
321 ipfiremake linux PASS
=ipfire
327 ipfiremake speedtouch
333 ipfiremake fcdslslusb
338 ipfiremake promise-sata-300-tx
362 ipfiremake BerkeleyDB
## The Perl module
364 ipfiremake saslauthd PASS
=1
368 ipfiremake subversion
369 ipfiremake apache2 PASS
=CONFIG
373 ipfiremake capi4k-utils
376 ipfiremake dosfstools
378 ipfiremake ez-ipupdate
384 ipfiremake initscripts
391 ipfiremake l7-protocols
392 ipfiremake isapnptools
393 ipfiremake isdn4k-utils
398 ipfiremake misc-progs
404 ipfiremake HTML-Tagset
405 ipfiremake HTML-Parser
406 ipfiremake Compress-Zlib
408 ipfiremake Digest-SHA1
409 ipfiremake Digest-HMAC
410 ipfiremake libwww-perl
412 ipfiremake Net-IPv4Addr
413 ipfiremake Net_SSLeay
414 ipfiremake IO-Stringy
415 ipfiremake Unix-Syslog
416 ipfiremake Mail-Tools
417 ipfiremake MIME-Tools
418 ipfiremake Net-Server
419 ipfiremake Convert-TNEF
420 ipfiremake Convert-UUlib
421 ipfiremake Archive-Tar
422 ipfiremake Archive-Zip
423 ipfiremake Text-Tabs
+Wrap
424 ipfiremake Locale-Country
427 ipfiremake noip_updater
429 ipfiremake oinkmaster
432 ipfiremake pptpclient
438 ipfiremake squid-graph
439 ipfiremake squidguard
441 ipfiremake
traceroute
445 ipfiremake
3c5x9setup
447 ipfiremake startscripts
449 ipfiremake bootsplash
453 ipfiremake pkg-config
457 ipfiremake saslauthd PASS
=2
459 ipfiremake ghostscript
466 ipfiremake bridge-utils
469 ipfiremake smartmontools
480 ipfiremake spamassassin
498 ipfiremake applejuice
503 ipfiremake tcpwrapper
520 # Run installer scripts one by one
521 LOGFILE
="$BASEDIR/log/_build.installer.log"
529 installmake e2fsprogs
530 installmake misc-progs
532 installmake util-linux
535 installmake pcmcia-cs
537 installmake installer
539 installmake driver.img
545 LOGFILE
="$BASEDIR/log/_build.packages.log"
547 echo "... see detailed log in _build.*.log files" >> $LOGFILE
548 echo -ne "`date -u '+%b %e %T'`: Stage5 packages build \n" |
tee -a $LOGFILE
550 echo "`date -u '+%b %e %T'`: Stripping files" |
tee -a $LOGFILE
551 find $LFS/lib
$LFS/usr
/lib
$LFS/usr
/share
/rrdtool-
* $LFS/install ! -type l \
( -name '*.so' -o -name '*.so[\.0-9]*' \
) \
552 ! -name 'libc.so' ! -name 'libpthread.so' ! -name 'libcrypto.so.0.9.7.sha1' \
553 -exec $LFS/tools
/bin
/strip
--strip-all {} \
; >> $LOGFILE 2>&1
554 # add -ls before -exec if you want to verify what files are stripped
556 find $LFS/{,s
}bin
$LFS/usr
/{,s
}bin
$LFS/usr
/local
/{,s
}bin
! -type l \
557 -exec file {} \
; |
grep " ELF " | cut
-f1 -d ':' |
xargs $LFS/tools
/bin
/strip
--strip-all >> $LOGFILE 2>&1
558 # there add -v to strip to verify
560 if [ 'i386' = $MACHINE ]; then
561 # Create fcdsl packages
562 echo "`date -u '+%b %e %T'`: Building fcdsl tgz" |
tee -a $LOGFILE
563 cp $LFS/install
/images
/fcdsl
/license.txt
$LFS >> $LOGFILE 2>&1
564 touch $LFS/var
/run
/{need-depmod-
$KVER,need-depmod-
$KVER-smp}
565 cd $LFS && tar cvfz
$LFS/install
/images
/$SNAME-fcdsl-$VERSION.
$MACHINE.tgz \
566 lib
/modules
/$KVER/misc
/fcdsl
*.o.gz \
567 lib
/modules
/$KVER-smp/misc
/fcdsl
*.o.gz \
568 usr
/lib
/isdn
/{fds?base.bin
,fd?ubase.frm
} \
569 etc
/fcdsl
/fcdsl
*.conf \
570 etc
/drdsl
/{drdsl
,drdsl.ini
} \
572 var
/run
/{need-depmod-
$KVER,need-depmod-
$KVER-smp} >> $LOGFILE 2>&1
573 rm -f $LFS/license.txt
>> $LOGFILE 2>&1
577 # Generating list of packages used
578 echo "`date -u '+%b %e %T'`: Generating packages list from logs" |
tee -a $LOGFILE
579 rm -f $BASEDIR/doc
/packages-list
580 for i
in `ls -1tr $BASEDIR/log/[^_]*`; do
581 if [ "$i" != "$BASEDIR/log/FILES" -a -n $i ]; then
582 echo "* `basename $i`" >>$BASEDIR/doc
/packages-list
585 echo "== List of softwares used to build $NAME Version: $VERSION ==" > $BASEDIR/doc
/packages-list.txt
586 grep -v 'configroot$\|img$\|initrd$\|initscripts$\|installer$\|install$\|ipfire$\|setup$\|pakfire$\|stage2$\|smp$\|tools$\|tools1$\|tools2$\|.tgz$\|-config$' \
587 $BASEDIR/doc
/packages-list |
sort >> $BASEDIR/doc
/packages-list.txt
588 rm -f $BASEDIR/doc
/packages-list
589 # packages-list.txt is ready to be displayed for wiki page
591 # Create ISO for CDROM
593 rm -f $LFS/install
/images
/*usb
*
594 cp $LFS/install
/images
/{*.iso
,*.tgz
} $BASEDIR >> $LOGFILE 2>&1
600 rm -rf $BASEDIR/build
/tmp
/*
602 # Generating total list of files
603 echo "`date -u '+%b %e %T'`: Generating files list from logs" |
tee -a $LOGFILE
604 rm -f $BASEDIR/log
/FILES
605 for i
in `ls -1tr $BASEDIR/log/[^_]*`; do
606 if [ "$i" != "$BASEDIR/log/FILES" -a -n $i ]; then
607 echo "##" >>$BASEDIR/log
/FILES
608 echo "## `basename $i`" >>$BASEDIR/log
/FILES
609 echo "##" >>$BASEDIR/log
/FILES
610 cat $i |
sed "s%^\./%#%" |
sort >> $BASEDIR/log
/FILES
613 cd $BASEDIR/packages
; ls -w1 *.ipfire |
awk -F ".ipfire" '{ print $1 }' > $BASEDIR/packages
/packages_list.txt
614 echo -n "###EOF###" >> $BASEDIR/packages
/packages_list.txt
621 if [ -d "$BASEDIR/packages" ]; then
622 for i
in `ls $BASEDIR/packages`; do
623 touch $BASEDIR/build
/install
/packages
/$i.empty
627 ipfiredist applejuice
654 ipfiredist spamassassin
655 ipfiredist subversion
660 test -d $BASEDIR/packages || mkdir
$BASEDIR/packages
661 mv -f $LFS/install
/packages
/*.
{ipfire
,md5
} $BASEDIR/packages
>> $LOGFILE 2>&1
662 rm -rf $BASEDIR/build
/install
/packages
/*
665 # See what we're supposed to do
668 BUILDMACHINE
=`uname -m`
669 PACKAGE
=`ls -v -r $BASEDIR/cache/toolchains/$SNAME-$VERSION-toolchain-$BUILDMACHINE.tar.gz 2> /dev/null | head -n 1`
670 #only restore on a clean disk
671 if [ ! -f log
/cleanup-toolchain-tools
]; then
672 if [ ! -n "$PACKAGE" ]; then
673 beautify build_stage
"Full toolchain compilation - Native GCC: `gcc --version | grep GCC | awk {'print $3'}`"
677 PACKAGENAME
=${PACKAGE%.tar.gz}
678 beautify build_stage
"Packaged toolchain compilation"
679 if [ `md5sum $PACKAGE | awk '{print $1}'` == `cat $PACKAGENAME.md5 | awk '{print $1}'` ]; then
683 exiterror
"$PACKAGENAME md5 did not match, check downloaded package"
687 echo "`date -u '+%b %e %T'`: Using installed toolchain" |
tee -a $LOGFILE
691 beautify build_stage
"Building base"
694 beautify build_stage
"Building IPFire"
697 # Setzen des IPFire Builds
698 if [ "$FIREBUILD" ]; then
699 echo "$FIREBUILD" > $BASEDIR/build
/var
/ipfire
/firebuild
701 echo "_(OvO)_" > $BASEDIR/build
/var
/ipfire
/firebuild
704 beautify build_stage
"Building installer"
707 beautify build_stage
"Building packages"
711 # enter a shell inside LFS chroot
712 # may be used to changed kernel settings
717 echo -n "Loading new Changelog from SVN: "
718 svn log http
://svn.ipfire.eu
/svn
/ipfire
> doc
/ChangeLog
722 for i
in `mount | grep $BASEDIR | sed 's/^.*loop=\(.*\))/\1/'`; do
723 $LOSETUP -d $i 2>/dev
/null
725 for i
in `mount | grep $BASEDIR | cut -d " " -f 1`; do
729 for i
in `seq 0 7`; do
730 if ( losetup
/dev
/loop
${i} 2>/dev
/null |
grep -q "/install/images" ); then
731 umount
/dev
/loop
${i} 2>/dev
/null
;
732 losetup
-d /dev
/loop
${i} 2>/dev
/null
;
735 rm -rf $BASEDIR/build
736 rm -rf $BASEDIR/cdrom
737 rm -rf $BASEDIR/packages
739 if [ -h /tools
]; then
744 # create structure for a new package
745 echo -e "Name of the new package: $2"
746 if [ ! -f "lfs/$2" ]; then
747 echo "`date -u '+%b %e %T'`: Creating directory src/paks/$2"
750 echo "`date -u '+%b %e %T'`: Creating files"
751 cp $BASEDIR/lfs
/postfix
$BASEDIR/lfs
/$2
754 touch {,un
}install.sh
756 echo '#!/bin/bash' > install.sh
757 echo '#' >> install.sh
758 echo '#################################################################' >> install.sh
759 echo '# #' >> install.sh
760 echo '# This file belongs to IPFire Firewall - GPLv2 - www.ipfire.org #' >> install.sh
761 echo '# #' >> install.sh
762 echo '#################################################################' >> install.sh
763 echo '#' >> install.sh
764 echo '# Extract the files' >> install.sh
765 echo 'tar xfz files.tgz -C /' >> install.sh
766 echo 'cp -f ROOTFILES /opt/pakfire/installed/ROOTFILES.$2' >> install.sh
768 echo '#!/bin/bash' > uninstall.sh
769 echo '#################################################################' >> uninstall.sh
770 echo '# #' >> uninstall.sh
771 echo '# This file belongs to IPFire Firewall - GPLv2 - www.ipfire.org #' >> uninstall.sh
772 echo '# #' >> uninstall.sh
773 echo '#################################################################' >> uninstall.sh
774 echo '#' >> uninstall.sh
775 echo '# Delete the files' >> uninstall.sh
776 echo '## Befehl fehlt noch' >> uninstall.sh
777 echo 'rm -f /opt/pakfire/installed/ROOTFILES.$2' >> uninstall.sh
778 echo "`date -u '+%b %e %T'`: Adding files to SVN"
779 cd - && svn add lfs
/$2 && svn add src
/paks
/$2
781 echo -n "Do you want to remove the folders? [y/n]"
783 if [ "$REM" == "y" ]; then
784 echo "Removing the folders..."
785 svn del src
/paks
/$2 --force
787 echo "Folders are kept."
790 echo "$2 already exists"
795 if [ ! -d $BASEDIR/cache
]; then
798 mkdir
-p $BASEDIR/log
799 echo "`date -u '+%b %e %T'`:Preload all source files" |
tee -a $LOGFILE
802 for c
in `seq $MAX_RETRIES`; do
803 if (( FINISHED
==1 )); then
809 if [ -f "$i" -a "$i" != "Config" ]; then
810 make -s -f $i LFS_BASEDIR
=$BASEDIR MESSAGE
="$i\t ($c/$MAX_RETRIES)" download
>> $LOGFILE 2>&1
811 if [ $?
-ne 0 ]; then
812 echo "Prefetch : wget error in lfs/$i"
815 if [ $c -eq 1 ]; then
816 echo "Prefetch : lfs/$i files loaded"
822 echo "Prefetch : verifying md5sum"
825 if [ -f "$i" -a "$i" != "Config" ]; then
826 make -s -f $i LFS_BASEDIR
=$BASEDIR MESSAGE
="$i\t " md5
>> $LOGFILE 2>&1
827 if [ $?
-ne 0 ]; then
828 echo "md5 difference in lfs/$i"
833 if [ $ERROR -eq 0 ]; then
834 echo "Prefetch : all files md5sum match"
840 beautify build_stage
"Toolchain compilation - Native GCC: `gcc --version | grep GCC | awk {'print $3'}`"
842 BUILDMACHINE
=`uname -m`
843 echo "`date -u '+%b %e %T'`: Create toolchain tar.gz for $BUILDMACHINE" |
tee -a $LOGFILE
844 test -d $BASEDIR/cache
/toolchains || mkdir
$BASEDIR/cache
/toolchains
845 cd $BASEDIR && tar -zc --exclude='log/_build.*.log' -f cache
/toolchains
/$SNAME-$VERSION-toolchain-$BUILDMACHINE.
tar.gz \
846 build
/{bin
,etc
,usr
/bin
,usr
/local} \
847 build
/tools
/{bin
,etc
,*-linux-gnu,include
,lib
,libexec
,sbin
,share
,var
} \
849 md5sum cache
/toolchains
/$SNAME-$VERSION-toolchain-$BUILDMACHINE.
tar.gz \
850 > cache
/toolchains
/$SNAME-$VERSION-toolchain-$BUILDMACHINE.md5
854 BUILDMACHINE
=`uname -m`
855 # arbitrary name to be updated in case of new toolchain package upload
856 PACKAGE
=$SNAME-$VERSION-toolchain-$BUILDMACHINE
857 if [ ! -f $BASEDIR/cache
/toolchains
/$PACKAGE.
tar.gz
]; then
858 URL_IPFIRE
=`grep URL_IPFIRE lfs/Config | awk '{ print $3 }'`
859 test -d $BASEDIR/cache
/toolchains || mkdir
$BASEDIR/cache
/toolchains
860 echo "`date -u '+%b %e %T'`: Load toolchain tar.gz for $BUILDMACHINE" |
tee -a $LOGFILE
861 cd $BASEDIR/cache
/toolchains
862 wget
$URL_IPFIRE/toolchains
/$PACKAGE.
tar.gz
$URL_IPFIRE/toolchains
/$PACKAGE.md5
>& /dev
/null
863 if [ $?
-ne 0 ]; then
864 echo "`date -u '+%b %e %T'`: error downloading toolchain for $BUILDMACHINE machine" |
tee -a $LOGFILE
866 if [ "`md5sum $PACKAGE.tar.gz | awk '{print $1}'`" = "`cat $PACKAGE.md5 | awk '{print $1}'`" ]; then
867 echo "`date -u '+%b %e %T'`: toolchain md5 ok" |
tee -a $LOGFILE
869 exiterror
"$PACKAGE.md5 did not match, check downloaded package"
873 echo "Toolchain is already downloaded. Exiting..."
878 echo -ne "`date -u '+%b %e %T'`: Build sources iso for $MACHINE" |
tee -a $LOGFILE
879 chroot
$LFS /tools
/bin
/env
-i HOME
=/root \
880 TERM
=$TERM PS1
='\u:\w\$ ' \
881 PATH
=/usr
/local
/bin
:/bin
:/usr
/bin
:/sbin
:/usr
/sbin \
882 VERSION
=$VERSION NAME
="$NAME" SNAME
="$SNAME" MACHINE
=$MACHINE \
883 /bin
/bash
-x -c "cd /usr/src/lfs && make -f sources-iso LFS_BASEDIR=/usr/src install" >>$LOGFILE 2>&1
884 mv $LFS/install
/images
/ipfire-
* $BASEDIR >> $LOGFILE 2>&1
885 if [ $?
-eq "0" ]; then
886 beautify message DONE
888 beautify message FAIL
896 echo -ne "Loading the latest source files...\n"
898 svn update
-r $3 |
tee -a $PWD/log
/_build.svn.update.log
900 svn update |
tee -a $PWD/log
/_build.svn.update.log
902 if [ $?
-eq "0" ]; then
903 beautify message DONE
905 beautify message FAIL
908 echo -ne "Writing the svn-info to a file"
909 svn info
> $PWD/svn_status
910 if [ $?
-eq "0" ]; then
911 beautify message DONE
913 beautify message FAIL
921 if [ -e /sbin
/yast
]; then
922 if [ "`echo $SVN_REVISION | cut -c 3`" -eq "0" ]; then
926 echo "Upload the changed files..."
935 if [ -f ipfire-source-r
$SVN_REVISION.
tar.gz
]; then
936 echo -ne "REV $SVN_REVISION: SKIPPED!\n"
939 echo -en "REV $SVN_REVISION: Downloading..."
940 svn
export http
://svn.ipfire.eu
/svn
/ipfire ipfire-source
/ --force > /dev
/null
941 svn log http
://svn.ipfire.eu
/svn
/ipfire
-r 1:$SVN_REVISION > ipfire-source
/Changelog
942 #svn info http://svn.ipfire.eu/svn/ipfire -r $SVN_REVISION > ipfire-source/svn_status
945 echo -en "REV $SVN_REVISION: Compressing files..."
946 if [ -e ipfire-source
/trunk
/make.sh
]; then
947 chmod 755 ipfire-source
/trunk
/make.sh
949 tar cfz ipfire-source-r
$SVN_REVISION.
tar.gz ipfire-source
951 echo -en "REV $SVN_REVISION: Cleaning up..."
956 echo -ne "Make a local diff to last svn revision"
957 svn
diff > ipfire-diff-
`date +'%Y-%m-%d-%H:%M'`-r`svn info | grep Revision | cut -c 11-`.
diff
959 echo "Diff was successfully saved to ipfire-diff-`date +'%Y-%m-%d-%H:%M'`-r`svn info | grep Revision | cut -c 11-`.diff"
966 echo -e "Uploading cache to ftp server:"
967 ncftpls
-u $IPFIRE_FTP_USER_INT -p $IPFIRE_FTP_PASS_INT ftp://$IPFIRE_FTP_URL_INT$IPFIRE_FTP_PATH_INT/ > /var
/tmp
/ftplist
969 grep -q $i /var
/tmp
/ftplist
970 if [ "$?" -ne "0" ]; then
972 ncftpput
-bb -u $IPFIRE_FTP_USER_INT -p $IPFIRE_FTP_PASS_INT $IPFIRE_FTP_URL_INT $IPFIRE_FTP_PATH_INT/ $i > /dev
/null
2>&1
973 if [ "$?" -eq "0" ]; then
974 beautify message DONE
976 beautify message FAIL
980 beautify message SKIP
983 rm -f /var
/tmp
/ftplist
984 UL_TIME_START
=`date +'%s'`
985 ncftpbatch
-d > /dev
/null
2>&1
986 while ps acx |
grep -q ncftpbatch
988 UL_TIME
=$
(expr `date +'%s'` - $UL_TIME_START)
989 echo -ne "\r ${UL_TIME}s : Upload is running..."
992 beautify message DONE
999 echo -e "Uploading the iso to $IPFIRE_FTP_URL_EXT."
1000 cat <<EOF > .ftp-commands
1001 mkdir $IPFIRE_FTP_PATH_EXT
1005 ncftp
-u $IPFIRE_FTP_USER_EXT -p $IPFIRE_FTP_PASS_EXT $IPFIRE_FTP_URL_EXT < .ftp-commands
1007 md5sum ipfire-install-
$VERSION.i386.iso
> ipfire-install-
$VERSION.i386.iso.md5
1008 ncftpput
-u $IPFIRE_FTP_USER_EXT -p $IPFIRE_FTP_PASS_EXT $IPFIRE_FTP_URL_EXT $IPFIRE_FTP_PATH_EXT/ ipfire-install-
$VERSION.i386.iso
1009 ncftpput
-u $IPFIRE_FTP_USER_EXT -p $IPFIRE_FTP_PASS_EXT $IPFIRE_FTP_URL_EXT $IPFIRE_FTP_PATH_EXT/ ipfire-install-
$VERSION.i386.iso.md5
1010 ncftpput
-u $IPFIRE_FTP_USER_EXT -p $IPFIRE_FTP_PASS_EXT $IPFIRE_FTP_URL_EXT $IPFIRE_FTP_PATH_EXT/ ipfire-source-r
$SVN_REVISION.
tar.gz
1011 ncftpput
-u $IPFIRE_FTP_USER_EXT -p $IPFIRE_FTP_PASS_EXT $IPFIRE_FTP_URL_EXT $IPFIRE_FTP_PATH_EXT/ svn_status
1012 if [ "$?" -eq "0" ]; then
1013 echo -e "The iso of Revision $SVN_REVISION was successfully uploaded to $IPFIRE_FTP_URL_EXT$IPFIRE_FTP_PATH_EXT/."
1015 echo -e "There was an error while uploading the iso to the ftp server."
1018 if [ "$3" = "--with-sources-cd" ]; then
1019 ncftpput
-u $IPFIRE_FTP_USER_EXT -p $IPFIRE_FTP_PASS_EXT $IPFIRE_FTP_URL_EXT $IPFIRE_FTP_PATH_EXT/ ipfire-sources-cd-
$VERSION.
$MACHINE.iso
1023 cat <<EOF > .ftp-commands
1024 mkdir $IPFIRE_FTP_PATH_PAK
1028 ncftp
-u $IPFIRE_FTP_USER_PAK -p $IPFIRE_FTP_PASS_PAK $IPFIRE_FTP_URL_PAK < .ftp-commands
1030 ncftpput
-z -u $IPFIRE_FTP_USER_PAK -p $IPFIRE_FTP_PASS_PAK $IPFIRE_FTP_URL_PAK $IPFIRE_FTP_PATH_PAK/ packages
/*
1031 if [ "$?" -eq "0" ]; then
1032 echo -e "The packages were successfully uploaded to $IPFIRE_FTP_URL_PAK$IPFIRE_FTP_PATH_PAK/."
1034 echo -e "There was an error while uploading the packages to the ftp server."
1041 if [ "$2" -eq "--background" ]; then
1045 if [ `screen -ls | grep -q ipfire` ]; then
1046 echo "Build is already running, sorry!"
1049 if [ "$2" = "--rebuild" ]; then
1050 export IPFIRE_REBUILD
=1
1053 export IPFIRE_REBUILD
=0
1055 echo -en "${BOLD}***IPFire-Batch-Build is starting...${NORMAL}"
1056 screen
-dmS ipfire
$0 batch --background
1067 select name
in "Exit" "IPFIRE: Prefetch" "IPFIRE: Build (silent)" "IPFIRE: Watch Build" "IPFIRE: Batch" "IPFIRE: Clean" "SVN: Commit" "SVN: Update" "SVN: Status" "SVN: Diff" "LOG: Tail" "Help"
1073 "IPFIRE: Build (silent)")
1076 "IPFIRE: Watch Build")
1086 if [ -f /usr
/bin
/mcedit
]; then
1087 export EDITOR
=/usr
/sbin
/mcedit
1096 svn status
# | grep -v ^?
1102 echo "Usage: $0 {build|changelog|check|checkclean|clean|gettoolchain|newpak|prefetch|shell|sync|toolchain}"
1103 cat doc
/make.sh-usage