3 ############################################################################
5 # This file is part of the IPFire Firewall. #
7 # IPFire is free software; you can redistribute it and/or modify #
8 # it under the terms of the GNU General Public License as published by #
9 # the Free Software Foundation; either version 2 of the License, or #
10 # (at your option) any later version. #
12 # IPFire is distributed in the hope that it will be useful, #
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15 # GNU General Public License for more details. #
17 # You should have received a copy of the GNU General Public License #
18 # along with IPFire; if not, write to the Free Software #
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
21 # Copyright (C) 2006 IPFire-Team <entwickler@ipfire.org>. #
23 ############################################################################
26 NAME
="IPFire" # Software name
27 SNAME
="ipfire" # Short name
28 VERSION
="2.0" # Version number
29 SLOGAN
="www.ipfire.org" # Software slogan
30 CONFIG_ROOT
=/var
/ipfire
# Configuration rootdir
32 MAX_RETRIES
=3 # prefetch/check loop
33 KVER
=`grep --max-count=1 VER lfs/linux | awk '{ print $3 }'`
35 SVN_REVISION
=`svn info | grep Revision | cut -c 11-`
37 # Setzen des IPFire Builds
38 if [ -e .
/.svn
]; then
39 FIREBUILD
=`cat .svn/entries |sed -n 's/^[ \t]*revision=\"// p' | sed -n 's/\".*$// p'`
42 # Debian specific settings
43 if [ ! -e /etc
/debian_version
]; then
46 if [ -x /usr
/bin
/realpath
]; then
47 FULLPATH
=`/usr/bin/realpath $0`
49 echo "ERROR: Need to do apt-get install realpath"
55 BASENAME
=`basename $0`
56 BASEDIR
=`echo $FULLPATH | sed "s/\/$BASENAME//g"`
57 LOGFILE
=$BASEDIR/log
/_build.preparation.log
58 export BASEDIR LOGFILE
59 DIR_CHK
=$BASEDIR/cache
/check
60 mkdir
$BASEDIR/log
/ 2>/dev
/null
62 if [ -f .config
]; then
66 if [ 'x86_64' = $MACHINE -o 'i686' = $MACHINE -o 'i586' = $MACHINE -o 'i486' = $MACHINE -o 'i386' = $MACHINE ]; then
67 echo "`date -u '+%b %e %T'`: Machine is ix86 (or equivalent)" >> $LOGFILE
69 BUILDTARGET
=i386-pc-linux-gnu
70 CFLAGS
="-O2 -mcpu=i386 -march=i386 -pipe -fomit-frame-pointer"
71 CXXFLAGS
="-O2 -mcpu=i386 -march=i386 -pipe -fomit-frame-pointer"
72 elif [ 'alpha' = $MACHINE ]; then
73 echo "`date -u '+%b %e %T'`: Machine is Alpha AXP" >> $LOGFILE
74 BUILDTARGET
=alpha-unknown-linux-gnu
75 CFLAGS
="-O2 -mcpu=ev4 -mieee -pipe"
76 CXXFLAGS
="-O2 -mcpu=ev4 -mieee -pipe"
78 echo "`date -u '+%b %e %T'`: Can't determine your architecture - $MACHINE" >> $LOGFILE
84 umount
$BASEDIR/build
/dev
/pts
2>/dev
/null
;
85 umount
$BASEDIR/build
/proc
2>/dev
/null
;
86 umount
$BASEDIR/build
/install
/mnt
2>/dev
/null
;
87 umount
$BASEDIR/build
/usr
/src
/cache
2>/dev
/null
;
88 umount
$BASEDIR/build
/usr
/src
/ccache
2>/dev
/null
;
89 umount
$BASEDIR/build
/usr
/src
/config
2>/dev
/null
;
90 umount
$BASEDIR/build
/usr
/src
/doc
2>/dev
/null
;
91 umount
$BASEDIR/build
/usr
/src
/html
2>/dev
/null
;
92 umount
$BASEDIR/build
/usr
/src
/langs
2>/dev
/null
;
93 umount
$BASEDIR/build
/usr
/src
/lfs
2>/dev
/null
;
94 umount
$BASEDIR/build
/usr
/src
/log
2>/dev
/null
;
95 umount
$BASEDIR/build
/usr
/src
/src
2>/dev
/null
;
100 for i
in `seq 0 7`; do
101 if ( losetup
/dev
/loop
${i} 2>/dev
/null |
grep -q "/install/images" ); then
102 losetup
-d /dev
/loop
${i} 2>/dev
/null
106 echo " Check $LOGFILE for errors if applicable"
111 if [ ! -e $BASEDIR/build
/usr
/src
/lfs
/ ]; then
112 exiterror
"No such file or directory: $BASEDIR/build/usr/src/lfs/"
114 echo "Entering to a shell inside LFS chroot, go out with exit"
115 chroot
$LFS /tools
/bin
/env
-i HOME
=/root TERM
=$TERM PS1
='\u:\w\$ ' \
116 PATH
=/usr
/local
/bin
:/bin
:/usr
/bin
:/sbin
:/usr
/sbin
:/tools
/bin \
117 VERSION
=$VERSION CONFIG_ROOT
=$CONFIG_ROOT \
118 NAME
="$NAME" SNAME
="$SNAME" SLOGAN
="$SLOGAN" \
119 CFLAGS
="$CFLAGS" CXXFLAGS
="$CXXFLAGS" \
120 CCACHE_DIR
=/usr
/src
/ccache \
123 BUILDTARGET
="$BUILDTARGET" MACHINE
="$MACHINE" \
124 KGCC
="ccache /usr/bin/gcc" \
126 if [ $?
-ne 0 ]; then
127 exiterror
"chroot error"
134 ############################################################################
136 # Are we running the right shell? #
138 ############################################################################
139 if [ ! "$BASH" ]; then
140 exiterror
"BASH environment variable is not set. You're probably running the wrong shell."
143 if [ -z "${BASH_VERSION}" ]; then
144 exiterror
"Not running BASH shell."
148 ############################################################################
150 # Trap on emergency exit #
152 ############################################################################
153 trap "exiterror 'Build process interrupted'" SIGINT SIGTERM SIGKILL SIGSTOP SIGQUIT
156 ############################################################################
158 # Resetting our nice level #
160 ############################################################################
161 echo "`date -u '+%b %e %T'`: Resetting our nice level to $NICE" |
tee -a $LOGFILE
162 renice
$NICE $$
> /dev
/null
163 if [ `nice` != "$NICE" ]; then
164 exiterror
"Failed to set correct nice level"
167 ############################################################################
169 # Checking if running as root user #
171 ############################################################################
172 echo "`date -u '+%b %e %T'`: Checking if we're running as root user" |
tee -a $LOGFILE
173 if [ `id -u` != 0 ]; then
174 exiterror
"Not building as root"
178 ############################################################################
180 # Checking for necessary temporary space #
182 ############################################################################
183 echo "`date -u '+%b %e %T'`: Checking for necessary space on disk $BASE_DEV" |
tee -a $LOGFILE
184 BASE_DEV
=`df -P -k $BASEDIR | tail -n 1 | awk '{ print $1 }'`
185 BASE_ASPACE
=`df -P -k $BASEDIR | tail -n 1 | awk '{ print $4 }'`
186 if (( 2202000 > $BASE_ASPACE )); then
187 BASE_USPACE
=`du -skx $BASEDIR | awk '{print $1}'`
188 if (( 2202000 - $BASE_USPACE > $BASE_ASPACE )); then
189 exiterror
"Not enough temporary space available, need at least 2.1GB on $BASE_DEV"
193 ############################################################################
195 # Building Linux From Scratch system #
197 ############################################################################
198 echo "`date -u '+%b %e %T'`: Building Linux From Scratch system" |
tee -a $LOGFILE
206 # Check /tools symlink
207 if [ -h /tools
]; then
210 if [ ! -a /tools
]; then
211 ln -s $BASEDIR/build
/tools
/
213 if [ ! -h /tools
]; then
214 exiterror
"Could not create /tools symbolic link."
220 export LFS LC_ALL CFLAGS CXXFLAGS
221 unset CC CXX CPP LD_LIBRARY_PATH LD_PRELOAD
223 # Make some extra directories
224 mkdir
-p $BASEDIR/build
/{tools
,etc
,usr
/src
} 2>/dev
/null
225 mkdir
-p $BASEDIR/{cache
,ccache
} 2>/dev
/null
226 mkdir
-p $BASEDIR/build
/dev
/pts
$BASEDIR/build
/proc
$BASEDIR/build
/usr
/src
/{cache
,config
,doc
,html
,langs
,lfs
,log
,src
,ccache
}
228 # Make all sources and proc available under lfs build
229 mount
--bind /dev
/pts
$BASEDIR/build
/dev
/pts
230 mount
--bind /proc
$BASEDIR/build
/proc
231 mount
--bind $BASEDIR/cache
$BASEDIR/build
/usr
/src
/cache
232 mount
--bind $BASEDIR/ccache
$BASEDIR/build
/usr
/src
/ccache
233 mount
--bind $BASEDIR/config
$BASEDIR/build
/usr
/src
/config
234 mount
--bind $BASEDIR/doc
$BASEDIR/build
/usr
/src
/doc
235 mount
--bind $BASEDIR/html
$BASEDIR/build
/usr
/src
/html
236 mount
--bind $BASEDIR/langs
$BASEDIR/build
/usr
/src
/langs
237 mount
--bind $BASEDIR/lfs
$BASEDIR/build
/usr
/src
/lfs
238 mount
--bind $BASEDIR/log
$BASEDIR/build
/usr
/src
/log
239 mount
--bind $BASEDIR/src
$BASEDIR/build
/usr
/src
/src
241 # Run LFS static binary creation scripts one by one
242 export CCACHE_DIR
=$BASEDIR/ccache
243 export CCACHE_HASHDIR
=1
245 # Remove pre-install list of installed files in case user erase some files before rebuild
246 rm -f $BASEDIR/build
/usr
/src
/lsalr
2>/dev
/null
250 ############################################################################
252 # Necessary shell functions #
254 ############################################################################
256 if [ -f $BASEDIR/lfs
/$1 ]; then
257 echo "`date -u '+%b %e %T'`: Building $*" |
tee -a $LOGFILE
258 cd $BASEDIR/lfs
&& make -s -f $
* LFS_BASEDIR
=$BASEDIR MESSAGE
="$1\t " download
>> $LOGFILE 2>&1
259 if [ $?
-ne 0 ]; then
260 exiterror
"Download error in $1"
262 cd $BASEDIR/lfs
&& make -s -f $
* LFS_BASEDIR
=$BASEDIR MESSAGE
="$1\t md5sum" md5
>> $LOGFILE 2>&1
263 if [ $?
-ne 0 ]; then
264 exiterror
"md5sum error in $1, check file in cache or signature"
266 cd $BASEDIR/lfs
&& make -f $
* BUILDTARGET
=$BUILDTARGET \
268 LFS_BASEDIR
=$BASEDIR \
271 install >> $LOGFILE 2>&1
272 if [ $?
-ne 0 ]; then
273 exiterror
"Building $*";
276 exiterror
"No such file or directory: $BASEDIR/$1"
282 if [ -f $BASEDIR/build
/usr
/src
/lfs
/$1 ]; then
283 echo "`date -u '+%b %e %T'`: Building $*" |
tee -a $LOGFILE
284 cd $BASEDIR/lfs
&& make -s -f $
* LFS_BASEDIR
=$BASEDIR MESSAGE
="$1\t " download
>> $LOGFILE 2>&1
285 if [ $?
-ne 0 ]; then
286 exiterror
"Download error in $1"
288 cd $BASEDIR/lfs
&& make -s -f $
* LFS_BASEDIR
=$BASEDIR MESSAGE
="$1\t md5sum" md5
>> $LOGFILE 2>&1
289 if [ $?
-ne 0 ]; then
290 exiterror
"md5sum error in $1, check file in cache or signature"
292 chroot
$LFS /tools
/bin
/env
-i HOME
=/root \
293 TERM
=$TERM PS1
='\u:\w\$ ' \
294 PATH
=/usr
/local
/bin
:/bin
:/usr
/bin
:/sbin
:/usr
/sbin
:/tools
/bin \
296 CONFIG_ROOT
=$CONFIG_ROOT \
297 NAME
="$NAME" SNAME
="$SNAME" SLOGAN
="$SLOGAN" \
298 CFLAGS
="$CFLAGS" CXXFLAGS
="$CXXFLAGS" \
299 CCACHE_DIR
=/usr
/src
/ccache CCACHE_HASHDIR
=1 \
301 BUILDTARGET
="$BUILDTARGET" MACHINE
="$MACHINE" \
302 /tools
/bin
/bash
-x -c "cd /usr/src/lfs && \
303 make -f $* LFS_BASEDIR=/usr/src install" >>$LOGFILE 2>&1
304 if [ $?
-ne 0 ]; then
305 exiterror
"Building $*"
308 exiterror
"No such file or directory: $BASEDIR/build/usr/src/lfs/$1"
314 if [ -f $BASEDIR/build
/usr
/src
/lfs
/$1 ]; then
315 echo "`date -u '+%b %e %T'`: Building $*" |
tee -a $LOGFILE
316 cd $BASEDIR/lfs
&& make -s -f $
* LFS_BASEDIR
=$BASEDIR MESSAGE
="$1\t " download
>> $LOGFILE 2>&1
317 if [ $?
-ne 0 ]; then
318 exiterror
"Download error in $1"
320 cd $BASEDIR/lfs
&& make -s -f $
* LFS_BASEDIR
=$BASEDIR MESSAGE
="$1\t md5sum" md5
>> $LOGFILE 2>&1
321 if [ $?
-ne 0 ]; then
322 exiterror
"md5sum error in $1, check file in cache or signature"
324 chroot
$LFS /tools
/bin
/env
-i HOME
=/root \
325 TERM
=$TERM PS1
='\u:\w\$ ' \
326 PATH
=/usr
/local
/bin
:/bin
:/usr
/bin
:/sbin
:/usr
/sbin \
328 CONFIG_ROOT
=$CONFIG_ROOT \
329 NAME
="$NAME" SNAME
="$SNAME" SLOGAN
="$SLOGAN" \
330 CFLAGS
="$CFLAGS" CXXFLAGS
="$CXXFLAGS" \
331 CCACHE_DIR
=/usr
/src
/ccache CCACHE_HASHDIR
=1 \
333 BUILDTARGET
="$BUILDTARGET" MACHINE
="$MACHINE" \
334 /bin
/bash
-x -c "cd /usr/src/lfs && \
335 make -f $* LFS_BASEDIR=/usr/src install" >>$LOGFILE 2>&1
336 if [ $?
-ne 0 ]; then
337 exiterror
"Building $*"
340 exiterror
"No such file or directory: $BASEDIR/build/usr/src/lfs/$1"
346 if [ -f $BASEDIR/build
/usr
/src
/lfs
/$1 ]; then
347 # if [ ! `ls -w1 $BASEDIR/packages/*.ipfire | grep $1` ]; then
348 echo "`date -u '+%b %e %T'`: Packaging $1" |
tee -a $LOGFILE
349 chroot
$LFS /tools
/bin
/env
-i HOME
=/root \
350 TERM
=$TERM PS1
='\u:\w\$ ' \
351 PATH
=/usr
/local
/bin
:/bin
:/usr
/bin
:/sbin
:/usr
/sbin \
353 CONFIG_ROOT
=$CONFIG_ROOT \
354 NAME
="$NAME" SNAME
="$SNAME" SLOGAN
="$SLOGAN" \
355 CFLAGS
="$CFLAGS" CXXFLAGS
="$CXXFLAGS" \
356 CCACHE_DIR
=/usr
/src
/ccache CCACHE_HASHDIR
=1 \
358 BUILDTARGET
="$BUILDTARGET" MACHINE
="$MACHINE" \
359 /bin
/bash
-x -c "cd /usr/src/lfs && \
360 make -f $1 LFS_BASEDIR=/usr/src dist" >>$LOGFILE 2>&1
361 if [ $?
-ne 0 ]; then
362 exiterror
"Packaging $1"
365 # echo "`date -u '+%b %e %T'`: Packaging: The package $1 already exists"
368 exiterror
"No such file or directory: $BASEDIR/build/usr/src/lfs/$1"
375 if [ -f $BASEDIR/build
/usr
/src
/lfs
/$1 ]; then
376 echo "`date -u '+%b %e %T'`: Building $*" |
tee -a $LOGFILE
377 cd $BASEDIR/lfs
&& make -s -f $
* LFS_BASEDIR
=$BASEDIR MESSAGE
="$1\t " download
>> $LOGFILE 2>&1
378 if [ $?
-ne 0 ]; then
379 exiterror
"Download error in $1"
381 cd $BASEDIR/lfs
&& make -s -f $
* LFS_BASEDIR
=$BASEDIR MESSAGE
="$1\t md5sum" md5
>> $LOGFILE 2>&1
382 if [ $?
-ne 0 ]; then
383 exiterror
"md5sum error in $1, check file in cache or signature"
385 chroot
$LFS /tools
/bin
/env
-i HOME
=/root \
386 TERM
=$TERM PS1
='\u:\w\$ ' \
387 PATH
=/usr
/local
/bin
:/opt
/$MACHINE-uClibc/usr
/bin
:/bin
:/usr
/bin
:/sbin
:/usr
/sbin \
389 CONFIG_ROOT
=$CONFIG_ROOT \
391 NAME
="$NAME" SNAME
="$SNAME" SLOGAN
="$SLOGAN" \
392 CFLAGS
="-Os" CXXFLAGS
="-Os" \
393 CCACHE_DIR
=/usr
/src
/ccache CCACHE_HASHDIR
=1 \
395 BUILDTARGET
="$BUILDTARGET" MACHINE
="$MACHINE" \
396 /bin
/bash
-x -c "cd /usr/src/lfs && \
397 make -f $* LFS_BASEDIR=/usr/src install" >>$LOGFILE 2>&1
398 if [ $?
-ne 0 ]; then
399 exiterror
"Building $*"
402 exiterror
"No such file or directory: $BASEDIR/build/usr/src/lfs/$1"
408 LOGFILE
="$BASEDIR/log/_build.toolchain.log"
410 echo -ne "`date -u '+%b %e %T'`: Stage1 toolchain build \n" |
tee -a $LOGFILE
411 # Build sed now, as we use some extensions
413 NATIVEGCC
=`gcc --version | grep GCC | awk {'print $3'}`
414 export NATIVEGCC GCCmajor
=${NATIVEGCC:0:1} GCCminor=${NATIVEGCC:2:1} GCCrelease=${NATIVEGCC:4:1}
416 lfsmake1
sed LFS_PASS
=1
417 lfsmake1
m4 LFS_PASS
=1
418 lfsmake1 bison LFS_PASS
=1
419 lfsmake1 flex LFS_PASS
=1
420 lfsmake1 binutils LFS_PASS
=1
421 lfsmake1 gcc LFS_PASS
=1
422 export PATH
=$BASEDIR/build
/usr
/local
/bin
:$BASEDIR/build
/tools
/bin
:$PATH
429 lfsmake1 gcc LFS_PASS
=2
430 lfsmake1 binutils LFS_PASS
=2
439 lfsmake1
sed LFS_PASS
=2
440 lfsmake1
m4 LFS_PASS
=2
441 lfsmake1 bison LFS_PASS
=2
442 lfsmake1 flex LFS_PASS
=2
451 export PATH
=$ORG_PATH
455 LOGFILE
="$BASEDIR/log/_build.base.log"
457 echo -ne "`date -u '+%b %e %T'`: Stage2 linux base build \n" |
tee -a $LOGFILE
458 # Run LFS dynamic binary creation scripts one by one
496 if [ 'i386' = $MACHINE ]; then
498 elif [ 'alpha' = $MACHINE ]; then
517 # Run IPFire make scripts one by one
518 LOGFILE
="$BASEDIR/log/_build.ipfire.log"
520 echo -ne "`date -u '+%b %e %T'`: Stage3 $NAME build \n" |
tee -a $LOGFILE
522 # Build these first as some of the kernel packages below rely on
523 # these for some of their client program functionality
534 if [ 'i386' = $MACHINE ]; then
535 # abuse the SMP flag, and make an minimal installer kernel first
536 # so that the boot floppy always works.....
537 ipcopmake linux LFS_PASS
=ipfire SMP
=installer
538 ipcopmake linux LFS_PASS
=ipfire SMP
=1
539 ipcopmake
3cp4218 SMP
=1
540 ipcopmake amedyn SMP
=1
541 ipcopmake cxacru SMP
=1
542 ipcopmake eagle SMP
=1
544 # These are here because they have i386 only binary libraries
545 # included in the package.
546 ipcopmake cnx_pci SMP
=1
547 ipcopmake fcdsl SMP
=1
548 ipcopmake fcdsl2 SMP
=1
549 ipcopmake fcdslsl SMP
=1
550 ipcopmake fcdslusb SMP
=1
551 ipcopmake fcdslslusb SMP
=1
552 ipcopmake fcpci SMP
=1
553 ipcopmake fcclassic SMP
=1
554 ipcopmake pulsar SMP
=1
555 ipcopmake unicorn SMP
=1
556 ipcopmake promise-sata-300-tx SMP
=1
559 ipcopmake linux LFS_PASS
=ipfire
566 if [ 'i386' = $MACHINE ]; then
567 # These are here because they have i386 only binary libraries
568 # included in the package.
579 ipcopmake promise-sata-300-tx
604 ipcopmake BerkeleyDB
## The Perl module
606 ipcopmake saslauthd PASS
=1
614 ipcopmake capi4k-utils
619 ipcopmake ez-ipupdate
625 ipcopmake initscripts
632 ipcopmake l7-protocols
633 ipcopmake isapnptools
634 ipcopmake isdn4k-utils
645 ipcopmake HTML-Tagset
646 ipcopmake HTML-Parser
647 ipcopmake Compress-Zlib
649 ipcopmake Digest-SHA1
650 ipcopmake Digest-HMAC
651 ipcopmake libwww-perl
653 ipcopmake Net-IPv4Addr
656 ipcopmake Unix-Syslog
660 ipcopmake Convert-TNEF
661 ipcopmake Convert-UUlib
662 ipcopmake Archive-Tar
663 ipcopmake Archive-Zip
664 ipcopmake Text-Tabs
+Wrap
665 ipcopmake Locale-Country
668 ipcopmake noip_updater
680 ipcopmake squid-graph
688 # echo -ne "`date -u '+%b %e %T'`: Building ### IPFire modules ### \n" | tee -a $LOGFILE
690 ipcopmake startscripts
691 ## Zuerst die Libs und dann die Programme. Ordnung muss sein!
703 ipcopmake saslauthd PASS
=2
705 ipcopmake ghostscript
707 # ipcopmake lpd ## Im Moment aus, da CUPS vorhanden ist.
715 ipcopmake bridge-utils
718 ipcopmake smartmontools
721 echo -ne "`date -u '+%b %e %T'`: Building ### Mailserver ### \n" |
tee -a $LOGFILE
730 ipcopmake spamassassin
732 echo -ne "`date -u '+%b %e %T'`: Building ### VoIP-Server ### \n" |
tee -a $LOGFILE
739 echo -ne "`date -u '+%b %e %T'`: Building ### Multimedia-Server ### \n" |
tee -a $LOGFILE
750 echo -ne "`date -u '+%b %e %T'`: Building ### P2P-Clients ### \n" |
tee -a $LOGFILE
754 # ipcopmake edonkeyclc
756 echo -ne "`date -u '+%b %e %T'`: Building ### Net-Tools ### \n" |
tee -a $LOGFILE
773 # ipcopmake stunnel # Ausgeschaltet, weil wir es doch nicht nutzen
777 # Run installer scripts one by one
778 LOGFILE
="$BASEDIR/log/_build.installer.log"
780 echo -ne "`date -u '+%b %e %T'`: Stage4 installer build \n" |
tee -a $LOGFILE
781 if [ 'i386' = $MACHINE ]; then
789 installmake e2fsprogs
790 installmake misc-progs
792 installmake util-linux
795 installmake pcmcia-cs
797 installmake installer
799 installmake driver.img
805 LOGFILE
="$BASEDIR/log/_build.packages.log"
807 echo "... see detailed log in _build.*.log files" >> $LOGFILE
808 echo -ne "`date -u '+%b %e %T'`: Stage5 packages build \n" |
tee -a $LOGFILE
810 echo "`date -u '+%b %e %T'`: Stripping files" |
tee -a $LOGFILE
811 find $LFS/lib
$LFS/usr
/lib
$LFS/usr
/share
/rrdtool-
* $LFS/install ! -type l \
( -name '*.so' -o -name '*.so[\.0-9]*' \
) \
812 ! -name 'libc.so' ! -name 'libpthread.so' ! -name 'libcrypto.so.0.9.7.sha1' \
813 -exec $LFS/tools
/bin
/strip
--strip-all {} \
; >> $LOGFILE 2>&1
814 # add -ls before -exec if you want to verify what files are stripped
816 find $LFS/{,s
}bin
$LFS/usr
/{,s
}bin
$LFS/usr
/local
/{,s
}bin
! -type l \
817 -exec file {} \
; |
grep " ELF " | cut
-f1 -d ':' |
xargs $LFS/tools
/bin
/strip
--strip-all >> $LOGFILE 2>&1
818 # there add -v to strip to verify
820 if [ 'i386' = $MACHINE ]; then
821 # Create fcdsl packages
822 echo "`date -u '+%b %e %T'`: Building fcdsl tgz" |
tee -a $LOGFILE
823 cp $LFS/install
/images
/fcdsl
/license.txt
$LFS >> $LOGFILE 2>&1
824 touch $LFS/var
/run
/{need-depmod-
$KVER,need-depmod-
$KVER-smp}
825 cd $LFS && tar cvfz
$LFS/install
/images
/$SNAME-fcdsl-$VERSION.
$MACHINE.tgz \
826 lib
/modules
/$KVER/misc
/fcdsl
*.o.gz \
827 lib
/modules
/$KVER-smp/misc
/fcdsl
*.o.gz \
828 usr
/lib
/isdn
/{fds?base.bin
,fd?ubase.frm
} \
829 etc
/fcdsl
/fcdsl
*.conf \
830 etc
/drdsl
/{drdsl
,drdsl.ini
} \
832 var
/run
/{need-depmod-
$KVER,need-depmod-
$KVER-smp} >> $LOGFILE 2>&1
833 rm -f $LFS/license.txt
>> $LOGFILE 2>&1
837 # Generating list of packages used
838 echo "`date -u '+%b %e %T'`: Generating packages list from logs" |
tee -a $LOGFILE
839 rm -f $BASEDIR/doc
/packages-list
840 for i
in `ls -1tr $BASEDIR/log/[^_]*`; do
841 if [ "$i" != "$BASEDIR/log/FILES" -a -n $i ]; then
842 echo " * `basename $i`" >>$BASEDIR/doc
/packages-list
845 echo "====== List of softwares used to build $NAME Version: $VERSION ======" > $BASEDIR/doc
/packages-list.txt
846 grep -v 'configroot$\|img$\|initrd$\|initscripts$\|installer$\|install$\|ipfire$\|setup$\|pakfire$\|stage2$\|smp$\|tools$\|tools1$\|tools2$\|^ipfire-logs' \
847 $BASEDIR/doc
/packages-list |
sort >> $BASEDIR/doc
/packages-list.txt
848 rm -f $BASEDIR/doc
/packages-list
849 # packages-list.txt is ready to be displayed for wiki page
851 # Create ISO for CDRom and USB-superfloppy
853 rm -f $LFS/install
/images
/*usb
*
854 cp $LFS/install
/images
/{*.iso
,*.tgz
} $BASEDIR >> $LOGFILE 2>&1
860 rm -rf $BASEDIR/build
/tmp
/*
862 # Generating total list of files
863 echo "`date -u '+%b %e %T'`: Generating files list from logs" |
tee -a $LOGFILE
864 rm -f $BASEDIR/log
/FILES
865 for i
in `ls -1tr $BASEDIR/log/[^_]*`; do
866 if [ "$i" != "$BASEDIR/log/FILES" -a -n $i ]; then
867 echo "##" >>$BASEDIR/log
/FILES
868 echo "## `basename $i`" >>$BASEDIR/log
/FILES
869 echo "##" >>$BASEDIR/log
/FILES
870 cat $i |
sed "s%^\./%#%" |
sort >> $BASEDIR/log
/FILES
873 cd $BASEDIR/packages
; ls -w1 *.ipfire |
awk -F ".ipfire" '{ print $1 }' > $BASEDIR/packages
/packages_list.txt
874 echo -n "###EOF###" >> $BASEDIR/packages
/packages_list.txt
881 if [ -d "$BASEDIR/packages" ]; then
882 for i
in `ls $BASEDIR/packages`; do
883 touch $BASEDIR/build
/install
/packages
/$i.empty
887 ipfiredist applejuice
915 ipfiredist spamassassin
916 ipfiredist subversion
918 ipfiredist web-cyradm
922 test -d $BASEDIR/packages || mkdir
$BASEDIR/packages
923 mv -f $LFS/install
/packages
/*.
{ipfire
,md5
} $BASEDIR/packages
>> $LOGFILE 2>&1
924 rm -rf $BASEDIR/build
/install
/packages
/*
928 tar cfz log
/ipfire-logs-
`date +'%Y-%m-%d-%H:%M'`.tgz log
/_build.
*
932 # See what we're supposed to do
935 BUILDMACHINE
=`uname -m`
936 PACKAGE
=`ls -v -r $BASEDIR/cache/toolchains/$SNAME-$VERSION-toolchain-$BUILDMACHINE.tar.gz 2> /dev/null | head -n 1`
937 #only restore on a clean disk
938 if [ ! -f log
/perl-
*-tools ]; then
939 if [ ! -n "$PACKAGE" ]; then
940 echo "`date -u '+%b %e %T'`: Full toolchain compilation" |
tee -a $LOGFILE
944 PACKAGENAME
=${PACKAGE%.tar.gz}
945 echo "`date -u '+%b %e %T'`: Restore from $PACKAGE" |
tee -a $LOGFILE
946 if [ `md5sum $PACKAGE | awk '{print $1}'` == `cat $PACKAGENAME.md5 | awk '{print $1}'` ]; then
950 exiterror
"$PACKAGENAME md5 did not match, check downloaded package"
954 echo "`date -u '+%b %e %T'`: Using installed toolchain" |
tee -a $LOGFILE
961 # Setzen des IPFire Builds
962 if [ "$FIREBUILD" ]; then
963 echo "$FIREBUILD" > $BASEDIR/build
/var
/ipfire
/firebuild
965 echo "_(OvO)_" > $BASEDIR/build
/var
/ipfire
/firebuild
972 # enter a shell inside LFS chroot
973 # may be used to changed kernel settings
978 echo -n "Loading new Changelog from SVN: "
979 svn log http
://svn.ipfire.eu
/svn
/ipfire
> doc
/ChangeLog
983 echo "Checking sources files availability on the web"
984 if [ ! -d $DIR_CHK ]; then
989 for c
in `seq $MAX_RETRIES`; do
990 if (( FINISHED
==1 )); then
996 if [ -f "$i" -a "$i" != "Config" ]; then
997 make -s -f $i MACHINE
=$MACHINE LFS_BASEDIR
=$BASEDIR ROOT
=$BASEDIR/build \
998 MESSAGE
="$i\t ($c/$MAX_RETRIES)" check
999 if [ $?
-ne 0 ]; then
1000 echo "Check : wget error in lfs/$i"
1009 echo "Erasing sources files availability tags"
1013 for i
in `mount | grep $BASEDIR | sed 's/^.*loop=\(.*\))/\1/'`; do
1014 $LOSETUP -d $i 2>/dev
/null
1016 for i
in `mount | grep $BASEDIR | cut -d " " -f 1`; do
1020 for i
in `seq 0 7`; do
1021 if ( losetup
/dev
/loop
${i} 2>/dev
/null |
grep -q "/install/images" ); then
1022 umount
/dev
/loop
${i} 2>/dev
/null
;
1023 losetup
-d /dev
/loop
${i} 2>/dev
/null
;
1026 rm -rf $BASEDIR/build
1027 rm -rf $BASEDIR/cdrom
1028 rm -rf $BASEDIR/packages
1030 if [ -h /tools
]; then
1035 # create structure for a new package
1036 echo -e "Name of the new package: $2"
1037 if [ ! -f "lfs/$2" ]; then
1038 echo "`date -u '+%b %e %T'`: Creating directory src/paks/$2"
1039 mkdir
-p src
/paks
/$2
1041 echo "`date -u '+%b %e %T'`: Creating files"
1042 cp $BASEDIR/lfs
/postfix
$BASEDIR/lfs
/$2
1045 touch {,un
}install.sh
1047 echo '#!/bin/bash' > install.sh
1048 echo '#' >> install.sh
1049 echo '#################################################################' >> install.sh
1050 echo '# #' >> install.sh
1051 echo '# This file belongs to IPFire Firewall - GPLv2 - www.ipfire.org #' >> install.sh
1052 echo '# #' >> install.sh
1053 echo '#################################################################' >> install.sh
1054 echo '#' >> install.sh
1055 echo '# Extract the files' >> install.sh
1056 echo 'tar xfz files.tgz -C /' >> install.sh
1057 echo 'cp -f ROOTFILES /opt/pakfire/installed/ROOTFILES.$2' >> install.sh
1059 echo '#!/bin/bash' > uninstall.sh
1060 echo '#################################################################' >> uninstall.sh
1061 echo '# #' >> uninstall.sh
1062 echo '# This file belongs to IPFire Firewall - GPLv2 - www.ipfire.org #' >> uninstall.sh
1063 echo '# #' >> uninstall.sh
1064 echo '#################################################################' >> uninstall.sh
1065 echo '#' >> uninstall.sh
1066 echo '# Delete the files' >> uninstall.sh
1067 echo '## Befehl fehlt noch' >> uninstall.sh
1068 echo 'rm -f /opt/pakfire/installed/ROOTFILES.$2' >> uninstall.sh
1069 echo "`date -u '+%b %e %T'`: Adding files to SVN"
1070 cd - && svn add lfs
/$2 && svn add src
/paks
/$2
1072 echo -n "Do you want to remove the folders? [y/n]"
1074 if [ "$REM" == "y" ]; then
1075 echo "Removing the folders..."
1076 svn del src
/paks
/$2 --force
1078 echo "Folders are kept."
1081 echo "$2 already exists"
1086 if [ ! -d $BASEDIR/cache
]; then
1087 mkdir
$BASEDIR/cache
1089 mkdir
-p $BASEDIR/log
1090 echo "`date -u '+%b %e %T'`:Preload all source files" |
tee -a $LOGFILE
1093 for c
in `seq $MAX_RETRIES`; do
1094 if (( FINISHED
==1 )); then
1100 if [ -f "$i" -a "$i" != "Config" ]; then
1101 make -s -f $i LFS_BASEDIR
=$BASEDIR MESSAGE
="$i\t ($c/$MAX_RETRIES)" download
>> $LOGFILE 2>&1
1102 if [ $?
-ne 0 ]; then
1103 echo "Prefetch : wget error in lfs/$i"
1106 if [ $c -eq 1 ]; then
1107 echo "Prefetch : lfs/$i files loaded"
1113 echo "Prefetch : verifying md5sum"
1116 if [ -f "$i" -a "$i" != "Config" ]; then
1117 make -s -f $i LFS_BASEDIR
=$BASEDIR MESSAGE
="$i\t " md5
>> $LOGFILE 2>&1
1118 if [ $?
-ne 0 ]; then
1119 echo "md5 difference in lfs/$i"
1124 if [ $ERROR -eq 0 ]; then
1125 echo "Prefetch : all files md5sum match"
1132 BUILDMACHINE
=`uname -m`
1133 echo "`date -u '+%b %e %T'`: Create toolchain tar.gz for $BUILDMACHINE" |
tee -a $LOGFILE
1134 test -d $BASEDIR/cache
/toolchains || mkdir
$BASEDIR/cache
/toolchains
1135 cd $BASEDIR && tar -zc --exclude='log/_build.*.log' -f cache
/toolchains
/$SNAME-$VERSION-toolchain-$BUILDMACHINE.
tar.gz \
1136 build
/{bin
,etc
,usr
/bin
,usr
/local} \
1137 build
/tools
/{bin
,etc
,*-linux-gnu,include
,lib
,libexec
,sbin
,share
,var
} \
1139 md5sum cache
/toolchains
/$SNAME-$VERSION-toolchain-$BUILDMACHINE.
tar.gz \
1140 > cache
/toolchains
/$SNAME-$VERSION-toolchain-$BUILDMACHINE.md5
1144 BUILDMACHINE
=`uname -m`
1145 # arbitrary name to be updated in case of new toolchain package upload
1146 PACKAGE
=$SNAME-$VERSION-toolchain-$BUILDMACHINE
1147 if [ ! -f $BASEDIR/cache
/toolchains
/$PACKAGE.
tar.gz
]; then
1148 URL_IPFIRE
=`grep URL_IPFIRE lfs/Config | awk '{ print $3 }'`
1149 test -d $BASEDIR/cache
/toolchains || mkdir
$BASEDIR/cache
/toolchains
1150 echo "`date -u '+%b %e %T'`: Load toolchain tar.gz for $BUILDMACHINE" |
tee -a $LOGFILE
1151 cd $BASEDIR/cache
/toolchains
1152 wget
$URL_IPFIRE/toolchains
/$PACKAGE.
tar.gz
$URL_IPFIRE/toolchains
/$PACKAGE.md5
>& /dev
/null
1153 if [ $?
-ne 0 ]; then
1154 echo "`date -u '+%b %e %T'`: error downloading toolchain for $BUILDMACHINE machine" |
tee -a $LOGFILE
1156 if [ "`md5sum $PACKAGE.tar.gz | awk '{print $1}'`" = "`cat $PACKAGE.md5 | awk '{print $1}'`" ]; then
1157 echo "`date -u '+%b %e %T'`: toolchain md5 ok" |
tee -a $LOGFILE
1159 exiterror
"$PACKAGE.md5 did not match, check downloaded package"
1163 echo "Toolchain is already downloaded. Exiting..."
1168 echo "`date -u '+%b %e %T'`: Build sources iso for $MACHINE" |
tee -a $LOGFILE
1169 chroot
$LFS /tools
/bin
/env
-i HOME
=/root \
1170 TERM
=$TERM PS1
='\u:\w\$ ' \
1171 PATH
=/usr
/local
/bin
:/bin
:/usr
/bin
:/sbin
:/usr
/sbin \
1172 VERSION
=$VERSION NAME
="$NAME" SNAME
="$SNAME" MACHINE
=$MACHINE \
1173 /bin
/bash
-x -c "cd /usr/src/lfs && make -f sources-iso LFS_BASEDIR=/usr/src install" >>$LOGFILE 2>&1
1174 mv $LFS/install
/images
/ipfire-
* $BASEDIR >> $LOGFILE 2>&1
1181 echo -n "Load the latest source files..."
1182 svn update
>> $PWD/log
/_build.svn.update.log
1183 if [ $?
-eq 0 ]; then
1189 echo -n "Write the svn info to a file..."
1190 svn info
> $PWD/svn_status
1191 if [ "$?" -eq "0" ]; then
1198 tail log
/_build.svn.update.log
1203 if [ -e /sbin
/yast
]; then
1206 echo "Upload the changed files..."
1208 IPFIRE_SVN_MESSAGE
=/tmp
/ipfire-svn-co-message.txt
1209 rm -f $IPFIRE_SVN_MESSAGE
1210 mcedit
$IPFIRE_SVN_MESSAGE
1211 svn commit
-F $IPFIRE_SVN_MESSAGE
1212 rm -f $IPFIRE_SVN_MESSAGE
1217 echo -ne "Download source package from svn..."
1218 svn
export http
://svn.ipfire.eu
/svn
/ipfire ipfire-source
/ --force > /dev
/null
1219 if [ "$?" -eq "0" ]; then
1225 echo -n "Compress files..."
1226 tar cfz ipfire-source-r
$SVN_REVISION.
tar.gz ipfire-source
1227 if [ "$?" -eq "0" ]; then
1233 echo -n "Cleanup..."
1234 rm ipfire-source
/ -r
1235 if [ "$?" -eq "0" ]; then
1243 echo -ne "Make a local diff to last svn revision..."
1244 svn
diff > ipfire-diff-
`date +'%Y-%m-%d-%H:%M'`-r`svn info | grep Revision | cut -c 11-`.
diff
1245 if [ "$?" -eq "0" ]; then
1251 echo "Diff was successfully saved to ipfire-diff-`date +'%Y-%m-%d-%H:%M'`-r`svn info | grep Revision | cut -c 11-`.diff"
1256 echo -e "This is for creating your configuration..."
1257 echo -e "We will need some input:"
1259 echo -n "FTP-DOMAIN FOR THE ISO: "
1260 read IPFIRE_FTP_URL_EXT
1261 echo -n "PATH FOR $IPFIRE_FTP_URL_EXT: "
1262 read IPFIRE_FTP_PATH_EXT
1263 echo -n "USERNAME FOR $IPFIRE_FTP_URL_EXT: "
1264 read IPFIRE_FTP_USER_EXT
1265 echo -n "PASSWORD FOR $IPFIRE_FTP_URL_EXT: "
1266 read -s IPFIRE_FTP_PASS_EXT
1268 echo "(You can leave this empty if the cache-server is the same as your iso-server.)"
1269 echo -n "FTP-DOMAIN FOR THE CACHE: "
1270 read IPFIRE_FTP_URL_INT
1271 echo -n "PATH FOR $IPFIRE_FTP_URL_INT: "
1272 read IPFIRE_FTP_PATH_INT
1273 if [ $IPFIRE_FTP_URL_INT ]; then
1274 echo -n "USERNAME FOR $IPFIRE_FTP_URL_INT: "
1275 read IPFIRE_FTP_USER_INT
1276 echo -n "PASSWORD FOR $IPFIRE_FTP_URL_INT: "
1277 read -s IPFIRE_FTP_PASS_INT
1279 IPFIRE_FTP_URL_INT
=$IPFIRE_FTP_URL_EXT
1280 IPFIRE_FTP_USER_INT
=$IPFIRE_FTP_USER_EXT
1281 IPFIRE_FTP_PASS_INT
=$IPFIRE_FTP_PASS_EXT
1282 echo "USERNAME FOR $IPFIRE_FTP_URL_INT: $IPFIRE_FTP_USER_INT"
1283 echo "PASSWORD FOR $IPFIRE_FTP_URL_INT: !HIDDEN!"
1286 echo "(You can leave this empty if the pak-server is the same as your iso-server.)"
1287 echo -n "FTP-DOMAIN FOR THE PAKS: "
1288 read IPFIRE_FTP_URL_PAK
1289 echo -n "PATH FOR $IPFIRE_FTP_URL_PAK: "
1290 read IPFIRE_FTP_PATH_PAK
1291 if [ $IPFIRE_FTP_URL_PAK ]; then
1292 echo -n "USERNAME FOR $IPFIRE_FTP_URL_PAK: "
1293 read IPFIRE_FTP_USER_PAK
1294 echo -n "PASSWORD FOR $IPFIRE_FTP_URL_PAK: "
1295 read -s IPFIRE_FTP_PASS_PAK
1297 IPFIRE_FTP_URL_PAK
=$IPFIRE_FTP_URL_EXT
1298 IPFIRE_FTP_USER_PAK
=$IPFIRE_FTP_USER_EXT
1299 IPFIRE_FTP_PASS_PAK
=$IPFIRE_FTP_PASS_EXT
1300 echo "USERNAME FOR $IPFIRE_FTP_URL_PAK: $IPFIRE_FTP_USER_PAK"
1301 echo "PASSWORD FOR $IPFIRE_FTP_URL_PAK: !HIDDEN!"
1304 echo -e "ONE OR MORE EMAIL ADDRESS(ES) TO WHICH THE REPORTS WILL BE SENT"
1305 echo -e "(seperated by comma)"
1306 read IPFIRE_MAIL_REPORT
1307 echo -n "EMAIL FROM: "
1308 read IPFIRE_MAIL_FROM
1309 echo -n "EMAIL SERVER: "
1310 read IPFIRE_MAIL_SERVER
1311 echo -n "LOGIN TO MAIL SERVER: "
1312 read IPFIRE_MAIL_USER
1313 echo -n "MAIL PASSWORD: "
1314 read -s IPFIRE_MAIL_PASS
1316 for i
in `seq 20`; do
1317 sleep 0.1; echo -n "."
1322 IPFIRE_FTP_URL_EXT=$IPFIRE_FTP_URL_EXT
1323 IPFIRE_FTP_PATH_EXT=$IPFIRE_FTP_PATH_EXT
1324 IPFIRE_FTP_USER_EXT=$IPFIRE_FTP_USER_EXT
1325 IPFIRE_FTP_PASS_EXT=$IPFIRE_FTP_PASS_EXT
1327 IPFIRE_FTP_URL_INT=$IPFIRE_FTP_URL_INT
1328 IPFIRE_FTP_PATH_INT=$IPFIRE_FTP_PATH_INT
1329 IPFIRE_FTP_USER_INT=$IPFIRE_FTP_USER_INT
1330 IPFIRE_FTP_PASS_INT=$IPFIRE_FTP_PASS_INT
1332 IPFIRE_FTP_URL_PAK=$IPFIRE_FTP_URL_PAK
1333 IPFIRE_FTP_PATH_PAK=$IPFIRE_FTP_PATH_PAK
1334 IPFIRE_FTP_USER_PAK=$IPFIRE_FTP_USER_PAK
1335 IPFIRE_FTP_PASS_PAK=$IPFIRE_FTP_PASS_PAK
1337 IPFIRE_MAIL_REPORT=$IPFIRE_MAIL_REPORT
1338 IPFIRE_MAIL_FROM=$IPFIRE_MAIL_FROM
1339 IPFIRE_MAIL_SERVER=$IPFIRE_MAIL_SERVER
1340 IPFIRE_MAIL_USER=$IPFIRE_MAIL_USER
1341 IPFIRE_MAIL_PASS=$IPFIRE_MAIL_PASS
1345 echo -e "Syncing cache to ftp:"
1346 # rm -f doc/packages-to-remove-from-ftp
1347 ncftpls
-u $IPFIRE_FTP_USER_INT -p $IPFIRE_FTP_PASS_INT ftp://$IPFIRE_FTP_URL_INT$IPFIRE_FTP_PATH_INT/ > ftplist
1348 for i
in `ls -w1 cache/`; do
1350 if [ "$?" -ne "0" ]; then
1351 ncftpput
-u $IPFIRE_FTP_USER_INT -p $IPFIRE_FTP_PASS_INT $IPFIRE_FTP_URL_INT $IPFIRE_FTP_PATH_INT/ cache
/$i
1352 if [ "$?" -eq "0" ]; then
1353 echo -e "$i was successfully uploaded to the ftp server."
1355 echo -e "There was an error while uploading $i to the ftp server."
1359 # for i in `cat ftplist`; do
1360 # ls -w1 cache/ | grep $i
1361 # if [ "$?" -eq "1" ]; then
1362 # echo $i | grep -v toolchain >> doc/packages-to-remove-from-ftp
1370 echo -e "Uploading the iso to $IPFIRE_FTP_URL_EXT."
1371 cat <<EOF > .ftp-commands
1372 mkdir $IPFIRE_FTP_PATH_EXT
1376 ncftp
-u $IPFIRE_FTP_USER_EXT -p $IPFIRE_FTP_PASS_EXT $IPFIRE_FTP_URL_EXT < .ftp-commands
1378 md5sum ipfire-install-
$VERSION.i386.iso
> ipfire-install-
$VERSION.i386.iso.md5
1379 ncftpput
-u $IPFIRE_FTP_USER_EXT -p $IPFIRE_FTP_PASS_EXT $IPFIRE_FTP_URL_EXT $IPFIRE_FTP_PATH_EXT/ ipfire-install-
$VERSION.i386.iso
1380 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
1381 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
1382 ncftpput
-u $IPFIRE_FTP_USER_EXT -p $IPFIRE_FTP_PASS_EXT $IPFIRE_FTP_URL_EXT $IPFIRE_FTP_PATH_EXT/ svn_status
1383 if [ "$?" -eq "0" ]; then
1384 echo -e "The iso of Revision $SVN_REVISION was successfully uploaded to $IPFIRE_FTP_URL_EXT$IPFIRE_FTP_PATH_EXT/."
1386 echo -e "There was an error while uploading the iso to the ftp server."
1389 if [ "$3" = "--with-sources-cd" ]; then
1390 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
1394 cat <<EOF > .ftp-commands
1395 mkdir $IPFIRE_FTP_PATH_PAK
1399 ncftp
-u $IPFIRE_FTP_USER_PAK -p $IPFIRE_FTP_PASS_PAK $IPFIRE_FTP_URL_PAK < .ftp-commands
1401 ncftpput
-z -u $IPFIRE_FTP_USER_PAK -p $IPFIRE_FTP_PASS_PAK $IPFIRE_FTP_URL_PAK $IPFIRE_FTP_PATH_PAK/ packages
/*
1402 if [ "$?" -eq "0" ]; then
1403 echo -e "The packages were successfully uploaded to $IPFIRE_FTP_URL_PAK$IPFIRE_FTP_PATH_PAK/."
1405 echo -e "There was an error while uploading the packages to the ftp server."
1412 rm -f $BASEDIR/log
/$2*
1413 BUILDMACHINE
=`uname -m`
1418 screen
-dmS ipfire
$0 build
1419 echo "Build started... This will take a while!"
1420 echo "You can see the status with 'screen -x ipfire'."
1423 chmod 755 tools
/sendEmail
1424 ATTACHMENT
=/tmp
/ipfire-build-logs-R
$SVN_REVISION.
tar.gz
1425 if [ "$2" = "ERROR" ]; then
1426 SUBJECT
="ERROR: IPFIRE-BUILD R$SVN_REVISION on `hostname`"
1427 echo "ERROR: $0 build!"
1428 cat <<END > /tmp/ipfire_mail_body
1429 When I was building IPFire on `hostname`, I have found an ERROR!
1430 Here you can see the logs and detect the reason for this error.
1433 Your IPFire-Build-Script
1436 if [ "$2" = "SUCCESS" ]; then
1437 SUBJECT
="SUCCESS: IPFIRE-BUILD R$SVN_REVISION on `hostname`"
1438 cat <<END > /tmp/ipfire_mail_body
1439 Building IPFire on `hostname` in Revision $SVN_REVISION was successfull!
1440 You can find the ISO on your ftp server.
1444 Started: $IPFIRE_START_TIME
1448 Your IPFire-Build-Script
1451 if [ "$2" = "SVNUPDATE" ]; then
1452 SUBJECT
="SVNUPDATE: IPFIRE-BUILD R$SVN_REVISION on `hostname`"
1453 echo "ERROR: $0 svn up!"
1454 cat <<END > /tmp/ipfire_mail_body
1455 When I was downloading the latest svn source,
1456 I have found an ERROR!
1457 Here you can see the logs and detect the reason for this error.
1460 Your IPFire-Build-Script
1464 if [ "$2" = "SVNDIST" ]; then
1465 SUBJECT
="SVNDIST: IPFIRE-BUILD R$SVN_REVISION on `hostname`"
1466 echo "ERROR: $0 svn dist!"
1467 cat <<END > /tmp/ipfire_mail_body
1468 When I was exporting the latest svn source,
1469 I have found an ERROR!
1470 Here you can see the logs and detect the reason for this error.
1473 Your IPFire-Build-Script
1477 if [ "$2" = "PREFETCH" ]; then
1478 SUBJECT
="PREFETCH: IPFIRE-BUILD R$SVN_REVISION on `hostname`"
1479 echo "ERROR: $0 prefetch!"
1480 cat <<END > /tmp/ipfire_mail_body
1481 When I was downloading the source packages,
1482 I have found an ERROR!
1483 Here you can see the logs and detect the reason for this error.
1486 Your IPFire-Build-Script
1490 if [ "$2" = "ISO" ]; then
1491 SUBJECT
="ISO: IPFIRE-BUILD R$SVN_REVISION on `hostname`"
1492 echo "ERROR: $0 upload iso!"
1493 cat <<END > /tmp/ipfire_mail_body
1494 When I was uploading the iso image,
1495 I have found an ERROR!
1496 Here you can see the logs and detect the reason for this error.
1499 Your IPFire-Build-Script
1503 if [ "$2" = "PAKS" ]; then
1504 SUBJECT
="PAKS: IPFIRE-BUILD R$SVN_REVISION on `hostname`"
1505 echo "ERROR: $0 upload paks!"
1506 cat <<END > /tmp/ipfire_mail_body
1507 When I was uploading the packages,
1508 I have found an ERROR!
1509 Here you can see the logs and detect the reason for this error.
1512 Your IPFire-Build-Script
1516 tar cfz
$ATTACHMENT log
/_build
*
1517 cat <<END >> /tmp/ipfire_mail_body
1519 Here is a summary... The full logs are in the attachment.
1520 ---------------------------------------------------------
1524 cat /tmp
/ipfire_mail_body | tools
/sendEmail
-q \
1525 -f $IPFIRE_MAIL_FROM \
1526 -t $IPFIRE_MAIL_REPORT \
1528 -s $IPFIRE_MAIL_SERVER:25 \
1529 -xu $IPFIRE_MAIL_USER \
1530 -xp $IPFIRE_MAIL_PASS \
1531 -l log
/_build.
mail.log \
1533 rm -f /tmp
/ipfire_mail_body
$ATTACHMENT
1536 if [ ! -f .config
]; then
1537 echo "No configuration found. Try ./make.sh make-config."
1539 ### This is our procedure that will compile the IPFire by herself...
1540 echo "### UPDATE LOGS"
1543 if [ "$IPFIRE_REBUILD" -eq "0" ]; then
1544 echo "### SAVING TIME"
1545 export IPFIRE_START_TIME
=`date`
1547 echo "### GETTING TOOLCHAIN"
1550 echo "### RUNNING SVN-UPDATE"
1552 if [ $?
-ne 0 ]; then
1557 echo "### EXPORT SOURCES"
1559 if [ $?
-ne 0 ]; then
1564 echo "### RUNNING PREFETCH"
1565 $0 prefetch |
grep -q "md5 difference"
1566 if [ $?
-eq 0 ]; then
1572 echo "### RUNNING BUILD"
1574 if [ $?
-ne 0 ]; then
1579 echo "### MAKING SOURCES-ISO"
1580 echo "DISABLED by Delaco!"
1583 echo "### UPLOADING ISO"
1585 if [ $?
-ne 0 ]; then
1590 echo "### UPLOADING PAKS"
1592 if [ $?
-ne 0 ]; then
1602 if [ `screen -ls | grep -q ipfire` ]; then
1603 echo "Build is already running, sorry!"
1606 if [ "$2" = "--rebuild" ]; then
1607 export IPFIRE_REBUILD
=1
1610 export IPFIRE_REBUILD
=0
1612 echo -n "IPFire-Batch-Build is starting..."
1613 screen
-dmS ipfire
$0 unattended
1614 if [ "$?" -eq "0" ]; then
1626 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"
1632 "IPFIRE: Build (silent)")
1635 "IPFIRE: Watch Build")
1636 echo "Exit with Ctrl+A, Ctrl+D."
1637 echo -n "Preparing..."
1638 for i
in `seq 10`; do
1639 sleep 0.1; echo -n "."
1652 echo "Are your sure to Update all Files to the Server (write: yes)?"; read input
1653 if [ "$input" == "yes" ]; then
1662 svn status
# | grep -v ^?
1668 echo "Usage: $0 {build|changelog|check|checkclean|clean|gettoolchain|newpak|prefetch|shell|sync|toolchain}"
1669 cat doc
/make.sh-usage