Make.sh gesplittet und maechtig ueberarbeitet.
[ipfire-2.x.git] / make.sh
CommitLineData
df5e82b3 1#!/bin/bash
df5e82b3
MT
2############################################################################
3# #
f8e5510c 4# This file is part of the IPFire Firewall. #
df5e82b3 5# #
f8e5510c 6# IPFire is free software; you can redistribute it and/or modify #
df5e82b3
MT
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. #
10# #
f8e5510c 11# IPFire is distributed in the hope that it will be useful, #
df5e82b3
MT
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. #
15# #
16# You should have received a copy of the GNU General Public License #
f8e5510c 17# along with IPFire; if not, write to the Free Software #
df5e82b3
MT
18# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
19# #
15679d9f 20# Copyright (C) 2006 IPFire-Team <info@ipfire.eu>. #
df5e82b3
MT
21# #
22############################################################################
df5e82b3
MT
23#
24
15679d9f
MT
25NAME="IPFire" # Software name
26SNAME="ipfire" # Short name
27VERSION="2.0" # Version number
28SLOGAN="www.ipfire.eu" # Software slogan
29CONFIG_ROOT=/var/ipfire # Configuration rootdir
30NICE=10 # Nice level
31MAX_RETRIES=3 # prefetch/check loop
32KVER=`grep --max-count=1 VER lfs/linux | awk '{ print $3 }'`
33MACHINE=`uname -m`
34SVN_REVISION=`svn info | grep Revision | cut -c 11-`
35
36# Setzen des IPFire Builds
37if [ -e ./.svn ]; then
38 FIREBUILD=`cat .svn/entries |sed -n 's/^[ \t]*revision=\"// p' | sed -n 's/\".*$// p'`
39fi
40
41# Debian specific settings
42if [ ! -e /etc/debian_version ]; then
df5e82b3 43 FULLPATH=`which $0`
15679d9f 44else
df5e82b3
MT
45 if [ -x /usr/bin/realpath ]; then
46 FULLPATH=`/usr/bin/realpath $0`
47 else
48 echo "ERROR: Need to do apt-get install realpath"
49 exit 1
50 fi
15679d9f 51fi
df5e82b3 52
15679d9f
MT
53PWD=`pwd`
54BASENAME=`basename $0`
55BASEDIR=`echo $FULLPATH | sed "s/\/$BASENAME//g"`
56LOGFILE=$BASEDIR/log/_build.preparation.log
57export BASEDIR LOGFILE
58DIR_CHK=$BASEDIR/cache/check
59mkdir $BASEDIR/log/ 2>/dev/null
df5e82b3 60
15679d9f
MT
61# Include funtions
62. tools/make-functions
df5e82b3 63
15679d9f
MT
64if [ -f .config ]; then
65 . .config
66else
67 make_config
68fi
df5e82b3
MT
69
70prepareenv() {
71 ############################################################################
72 # #
73 # Are we running the right shell? #
74 # #
75 ############################################################################
76 if [ ! "$BASH" ]; then
77 exiterror "BASH environment variable is not set. You're probably running the wrong shell."
78 fi
79
80 if [ -z "${BASH_VERSION}" ]; then
81 exiterror "Not running BASH shell."
82 fi
83
84
85 ############################################################################
86 # #
87 # Trap on emergency exit #
88 # #
89 ############################################################################
90 trap "exiterror 'Build process interrupted'" SIGINT SIGTERM SIGKILL SIGSTOP SIGQUIT
91
92
93 ############################################################################
94 # #
95 # Resetting our nice level #
96 # #
97 ############################################################################
15679d9f 98 echo -ne "`date -u '+%b %e %T'`: Resetting our nice level to $NICE" | tee -a $LOGFILE
df5e82b3
MT
99 renice $NICE $$ > /dev/null
100 if [ `nice` != "$NICE" ]; then
15679d9f 101 beautify message FAIL
df5e82b3 102 exiterror "Failed to set correct nice level"
15679d9f
MT
103 else
104 beautify message DONE
df5e82b3
MT
105 fi
106
15679d9f 107
df5e82b3
MT
108 ############################################################################
109 # #
110 # Checking if running as root user #
111 # #
112 ############################################################################
15679d9f 113 echo -ne "`date -u '+%b %e %T'`: Checking if we're running as root user" | tee -a $LOGFILE
df5e82b3 114 if [ `id -u` != 0 ]; then
15679d9f 115 beautify message FAIL
df5e82b3 116 exiterror "Not building as root"
15679d9f
MT
117 else
118 beautify message DONE
df5e82b3
MT
119 fi
120
121
122 ############################################################################
123 # #
124 # Checking for necessary temporary space #
125 # #
126 ############################################################################
15679d9f 127 echo -ne "`date -u '+%b %e %T'`: Checking for necessary space on disk $BASE_DEV" | tee -a $LOGFILE
df5e82b3
MT
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
15679d9f 133 beautify message FAIL
df5e82b3
MT
134 exiterror "Not enough temporary space available, need at least 2.1GB on $BASE_DEV"
135 fi
15679d9f
MT
136 else
137 beautify message DONE
df5e82b3
MT
138 fi
139
140 ############################################################################
141 # #
142 # Building Linux From Scratch system #
143 # #
144 ############################################################################
145 echo "`date -u '+%b %e %T'`: Building Linux From Scratch system" | tee -a $LOGFILE
146
147 # Set umask
148 umask 022
149
150 # Set LFS Directory
151 LFS=$BASEDIR/build
152
153 # Check /tools symlink
154 if [ -h /tools ]; then
155 rm -f /tools
156 fi
157 if [ ! -a /tools ]; then
158 ln -s $BASEDIR/build/tools /
159 fi
160 if [ ! -h /tools ]; then
161 exiterror "Could not create /tools symbolic link."
162 fi
163
164 # Setup environment
165 set +h
166 LC_ALL=POSIX
dd714b8a
MT
167 MAKETUNING="-j8"
168 export LFS LC_ALL CFLAGS CXXFLAGS MAKETUNING
df5e82b3
MT
169 unset CC CXX CPP LD_LIBRARY_PATH LD_PRELOAD
170
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}
175
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
188
189 # Run LFS static binary creation scripts one by one
190 export CCACHE_DIR=$BASEDIR/ccache
191 export CCACHE_HASHDIR=1
192
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
195}
196
df5e82b3
MT
197buildtoolchain() {
198 LOGFILE="$BASEDIR/log/_build.toolchain.log"
199 export LOGFILE
df5e82b3
MT
200 ORG_PATH=$PATH
201 NATIVEGCC=`gcc --version | grep GCC | awk {'print $3'}`
202 export NATIVEGCC GCCmajor=${NATIVEGCC:0:1} GCCminor=${NATIVEGCC:2:1} GCCrelease=${NATIVEGCC:4:1}
203 lfsmake1 ccache
15679d9f
MT
204 lfsmake1 binutils PASS=1
205 lfsmake1 gcc PASS=1
df5e82b3 206 export PATH=$BASEDIR/build/usr/local/bin:$BASEDIR/build/tools/bin:$PATH
dd714b8a
MT
207 lfsmake1 linux-libc-header
208 lfsmake1 glibc
df5e82b3
MT
209 lfsmake1 tcl
210 lfsmake1 expect
df5e82b3 211 lfsmake1 dejagnu
15679d9f
MT
212 lfsmake1 gcc PASS=2
213 lfsmake1 binutils PASS=2
dd714b8a
MT
214 lfsmake1 ncurses
215 lfsmake1 bash
df5e82b3 216 lfsmake1 bzip2
dd714b8a 217 lfsmake1 coreutils
df5e82b3
MT
218 lfsmake1 diffutils
219 lfsmake1 findutils
dd714b8a 220 lfsmake1 gawk
df5e82b3 221 lfsmake1 gettext
dd714b8a
MT
222 lfsmake1 grep
223 lfsmake1 gzip
224 lfsmake1 m4
225 lfsmake1 make
df5e82b3 226 lfsmake1 patch
dd714b8a
MT
227 lfsmake1 perl
228 lfsmake1 sed
df5e82b3
MT
229 lfsmake1 tar
230 lfsmake1 texinfo
df5e82b3 231 lfsmake1 util-linux
dd714b8a 232 lfsmake1 cleanup-toolchain
df5e82b3
MT
233 export PATH=$ORG_PATH
234}
235
236buildbase() {
237 LOGFILE="$BASEDIR/log/_build.base.log"
238 export LOGFILE
df5e82b3
MT
239 lfsmake2 stage2
240 lfsmake2 makedev
241 lfsmake2 linux
242 lfsmake2 man-pages
243 lfsmake2 glibc
244 lfsmake2 binutils
245 lfsmake2 gcc
246 lfsmake2 coreutils
247 lfsmake2 zlib
248 lfsmake2 mktemp
249 lfsmake2 iana-etc
250 lfsmake2 findutils
251 lfsmake2 gawk
252 lfsmake2 ncurses
253 lfsmake2 vim
254 lfsmake2 m4
255 lfsmake2 bison
256 lfsmake2 less
257 lfsmake2 groff
258 lfsmake2 sed
259 lfsmake2 flex
260 lfsmake2 gettext
261 lfsmake2 net-tools
262 lfsmake2 inetutils
263 lfsmake2 perl
264 lfsmake2 texinfo
265 lfsmake2 autoconf
266 lfsmake2 automake
267 lfsmake2 bash
268 lfsmake2 file
269 lfsmake2 libtool
270 lfsmake2 bzip2
271 lfsmake2 diffutils
272 lfsmake2 ed
273 lfsmake2 kbd
274 lfsmake2 e2fsprogs
275 lfsmake2 grep
15679d9f 276 lfsmake2 grub
df5e82b3
MT
277 lfsmake2 gzip
278 lfsmake2 man
279 lfsmake2 make
280 lfsmake2 modutils
281 lfsmake2 patch
282 lfsmake2 procinfo
283 lfsmake2 procps
284 lfsmake2 psmisc
285 lfsmake2 shadow
286 lfsmake2 sysklogd
287 lfsmake2 sysvinit
288 lfsmake2 tar
289 lfsmake2 util-linux
290}
291
15679d9f 292buildipfire() {
907cd036 293 LOGFILE="$BASEDIR/log/_build.ipfire.log"
df5e82b3 294 export LOGFILE
15679d9f
MT
295 ipfiremake configroot
296 ipfiremake dhcp
297 ipfiremake dhcpcd
298 ipfiremake libusb
299 ipfiremake libpcap
300 ipfiremake linux-atm
301 ipfiremake ppp
302 ipfiremake rp-pppoe
303 ipfiremake unzip
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
322 ipfiremake 3cp4218
323 ipfiremake amedyn
324 ipfiremake cxacru
325 ipfiremake eciadsl
326 ipfiremake eagle
327 ipfiremake speedtouch
328 ipfiremake cnx_pci
329 ipfiremake fcdsl
330 ipfiremake fcdsl2
331 ipfiremake fcdslsl
332 ipfiremake fcdslusb
333 ipfiremake fcdslslusb
334 ipfiremake fcpci
335 ipfiremake fcclassic
336 ipfiremake pulsar
337 ipfiremake unicorn
338 ipfiremake promise-sata-300-tx
339 ipfiremake pcmcia-cs
340 ipfiremake expat
341 ipfiremake gdbm
342 ipfiremake gmp
343 ipfiremake openssl
344 ipfiremake python
345 ipfiremake libnet
346 ipfiremake libpng
347 ipfiremake libtiff
348 ipfiremake libjpeg
349 ipfiremake lcms
350 ipfiremake libmng
351 ipfiremake freetype
352 ipfiremake gd
353 ipfiremake popt
354 ipfiremake slang
355 ipfiremake newt
356 ipfiremake libcap
357 ipfiremake pciutils
358 ipfiremake pcre
359 ipfiremake readline
360 ipfiremake libxml2
361 ipfiremake berkeley
362 ipfiremake BerkeleyDB ## The Perl module
363 ipfiremake mysql
364 ipfiremake saslauthd PASS=1
365 ipfiremake openldap
366 ipfiremake apache2
367 ipfiremake php
368 ipfiremake subversion
369 ipfiremake apache2 PASS=CONFIG
370 ipfiremake arping
371 ipfiremake beep
372 ipfiremake bind
373 ipfiremake capi4k-utils
374 ipfiremake cdrtools
375 ipfiremake dnsmasq
376 ipfiremake dosfstools
377 ipfiremake ethtool
378 ipfiremake ez-ipupdate
379 ipfiremake fcron
380 ipfiremake perl-GD
381 ipfiremake gnupg
382 ipfiremake hdparm
383 ipfiremake ibod
384 ipfiremake initscripts
385 ipfiremake iptables
386 ipfiremake ipac-ng
387 ipfiremake ipaddr
388 ipfiremake iproute2
389 ipfiremake iptstate
390 ipfiremake iputils
391 ipfiremake l7-protocols
392 ipfiremake isapnptools
393 ipfiremake isdn4k-utils
394 ipfiremake kudzu
395 ipfiremake logrotate
396 ipfiremake logwatch
397 ipfiremake mingetty
398 ipfiremake misc-progs
399 ipfiremake mtools
400 ipfiremake nano
401 ipfiremake nash
402 ipfiremake nasm
403 ipfiremake URI
404 ipfiremake HTML-Tagset
405 ipfiremake HTML-Parser
406 ipfiremake Compress-Zlib
407 ipfiremake Digest
408 ipfiremake Digest-SHA1
409 ipfiremake Digest-HMAC
410 ipfiremake libwww-perl
411 ipfiremake Net-DNS
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
425 ipfiremake GeoIP
426 ipfiremake fwhits
427 ipfiremake noip_updater
428 ipfiremake ntp
429 ipfiremake oinkmaster
430 ipfiremake openssh
431 ipfiremake openswan
432 ipfiremake pptpclient
433 ipfiremake rrdtool
434 ipfiremake setserial
435 ipfiremake setup
436 ipfiremake snort
437 ipfiremake squid
438 ipfiremake squid-graph
439 ipfiremake squidguard
440 ipfiremake tcpdump
441 ipfiremake traceroute
442 ipfiremake vlan
443 ipfiremake wireless
444 ipfiremake libsafe
445 ipfiremake 3c5x9setup
446 ipfiremake pakfire
447 ipfiremake startscripts
448 ipfiremake java
449 ipfiremake bootsplash
450 ipfiremake spandsp
451 ipfiremake lzo
452 ipfiremake openvpn
453 ipfiremake pkg-config
454 ipfiremake glib
455 ipfiremake pam
456 ipfiremake pammysql
457 ipfiremake saslauthd PASS=2
458 ipfiremake xinetd
459 ipfiremake ghostscript
460 ipfiremake cups
461 ipfiremake samba
462 ipfiremake sudo
463 ipfiremake mc
464 ipfiremake wget
465 ipfiremake wput
466 ipfiremake bridge-utils
467 ipfiremake screen
468 ipfiremake hddtemp
469 ipfiremake smartmontools
470 ipfiremake htop
471 ipfiremake lynx
472 ipfiremake postfix
473 ipfiremake procmail
474 ipfiremake fetchmail
475 ipfiremake cyrusimap
476 ipfiremake webcyradm
477 ipfiremake mailx
478 ipfiremake clamav
479 ipfiremake razor
480 ipfiremake spamassassin
481# ipfiremake amavisd
482 ipfiremake stund
483 ipfiremake zaptel
484 ipfiremake libpri
485 ipfiremake bristuff
486 ipfiremake asterisk
487 ipfiremake mpg123
488 ipfiremake libmad
489 ipfiremake libogg
490 ipfiremake libvorbis
491 ipfiremake lame
492 ipfiremake xvid
493 ipfiremake mpeg2dec
494 ipfiremake ffmpeg
495 ipfiremake sox
496 ipfiremake gnump3d
497 ipfiremake videolan
498 ipfiremake applejuice
499 ipfiremake ocaml
500 ipfiremake mldonkey
501 ipfiremake ntop
502 ipfiremake rsync
503 ipfiremake tcpwrapper
504 ipfiremake portmap
505 ipfiremake nfs
506 ipfiremake nmap
507 ipfiremake mbmon
508 ipfiremake iftop
509 ipfiremake ncftp
510 ipfiremake cftp
511 ipfiremake etherwake
512 ipfiremake ethereal
513 ipfiremake tftp-hpa
514 ipfiremake iptraf
515 ipfiremake nagios
516 ipfiremake yasuc
df5e82b3
MT
517}
518
519buildinstaller() {
520 # Run installer scripts one by one
521 LOGFILE="$BASEDIR/log/_build.installer.log"
522 export LOGFILE
15679d9f
MT
523 ipfiremake syslinux
524 ipfiremake as86
525 ipfiremake mbr
526 ipfiremake uClibc
df5e82b3
MT
527 installmake busybox
528 installmake sysvinit
529 installmake e2fsprogs
530 installmake misc-progs
531 installmake slang
532 installmake util-linux
533 installmake newt
534 installmake pciutils
535 installmake pcmcia-cs
536 installmake kbd
537 installmake installer
538 installmake scsi.img
539 installmake driver.img
540 installmake initrd
541 installmake boot.img
542}
543
544buildpackages() {
545 LOGFILE="$BASEDIR/log/_build.packages.log"
546 export LOGFILE
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
549 # Strip files
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' \
90350ff3 553 -exec $LFS/tools/bin/strip --strip-all {} \; >> $LOGFILE 2>&1
df5e82b3
MT
554 # add -ls before -exec if you want to verify what files are stripped
555
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
559
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} \
571 license.txt \
572 var/run/{need-depmod-$KVER,need-depmod-$KVER-smp} >> $LOGFILE 2>&1
573 rm -f $LFS/license.txt >> $LOGFILE 2>&1
574 cd $BASEDIR
575 fi
df5e82b3
MT
576
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
7471f6ab 582 echo "* `basename $i`" >>$BASEDIR/doc/packages-list
df5e82b3
MT
583 fi
584 done
7471f6ab 585 echo "== List of softwares used to build $NAME Version: $VERSION ==" > $BASEDIR/doc/packages-list.txt
f522e307 586 grep -v 'configroot$\|img$\|initrd$\|initscripts$\|installer$\|install$\|ipfire$\|setup$\|pakfire$\|stage2$\|smp$\|tools$\|tools1$\|tools2$\|.tgz$\|-config$' \
df5e82b3
MT
587 $BASEDIR/doc/packages-list | sort >> $BASEDIR/doc/packages-list.txt
588 rm -f $BASEDIR/doc/packages-list
c9673262 589 # packages-list.txt is ready to be displayed for wiki page
df5e82b3 590
f522e307 591 # Create ISO for CDROM
15679d9f 592 ipfiremake cdrom
e67a57fe 593 rm -f $LFS/install/images/*usb*
c3defe9b 594 cp $LFS/install/images/{*.iso,*.tgz} $BASEDIR >> $LOGFILE 2>&1
c9673262 595
e67a57fe
MT
596 ipfirepackages
597
598 # Cleanup
599 stdumount
600 rm -rf $BASEDIR/build/tmp/*
601
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
611 fi
612 done
913668ba 613 cd $BASEDIR/packages; ls -w1 *.ipfire | awk -F ".ipfire" '{ print $1 }' > $BASEDIR/packages/packages_list.txt
5e773594 614 echo -n "###EOF###" >> $BASEDIR/packages/packages_list.txt
e67a57fe
MT
615
616 cd $PWD
617
618}
619
620ipfirepackages() {
013a23e2
MT
621 if [ -d "$BASEDIR/packages" ]; then
622 for i in `ls $BASEDIR/packages`; do
623 touch $BASEDIR/build/install/packages/$i.empty
624 done
625 fi
f1baee3e 626# ipfiredist amavisd
78331e30 627 ipfiredist applejuice
5ac2da9f 628 ipfiredist asterisk
c7acba4a 629 ipfiredist clamav
483f59cd 630 ipfiredist cups
78331e30
MT
631 ipfiredist cyrusimap
632 ipfiredist fetchmail
d1b6aa72 633 ipfiredist ffmpeg
78331e30 634 ipfiredist gnump3d
7a98bae5 635 ipfiredist iptraf
0d0521b6 636 ipfiredist java
78331e30 637 ipfiredist lame
d1b6aa72 638 ipfiredist libmad
ae179f6e 639 ipfiredist libogg
78331e30 640 ipfiredist libtiff
ae179f6e 641 ipfiredist libvorbis
f0ca8c34 642 ipfiredist mailx
3ab910dd 643 ipfiredist mldonkey
d1b6aa72 644 ipfiredist mpeg2dec
2ae94d2d 645 ipfiredist nagios
f0ca8c34
MT
646 ipfiredist nfs
647 ipfiredist nmap
3e45cc09 648 ipfiredist ntop
27ac55bf 649 ipfiredist portmap
78331e30 650 ipfiredist postfix
371d9df0 651 ipfiredist procmail
90350ff3 652 ipfiredist samba
ae179f6e 653 ipfiredist sox
f0ca8c34 654 ipfiredist spamassassin
7a98bae5 655 ipfiredist subversion
d1b6aa72 656 ipfiredist videolan
f1baee3e 657 ipfiredist webcyradm
d1b6aa72 658 ipfiredist xvid
0145f271 659 ipfiredist yasuc
78331e30 660 test -d $BASEDIR/packages || mkdir $BASEDIR/packages
d535503d 661 mv -f $LFS/install/packages/*.{ipfire,md5} $BASEDIR/packages >> $LOGFILE 2>&1
483f59cd 662 rm -rf $BASEDIR/build/install/packages/*
df5e82b3
MT
663}
664
665# See what we're supposed to do
666case "$1" in
667build)
668 BUILDMACHINE=`uname -m`
712d859c 669 PACKAGE=`ls -v -r $BASEDIR/cache/toolchains/$SNAME-$VERSION-toolchain-$BUILDMACHINE.tar.gz 2> /dev/null | head -n 1`
df5e82b3 670 #only restore on a clean disk
15679d9f 671 if [ ! -f log/cleanup-toolchain-tools ]; then
df5e82b3 672 if [ ! -n "$PACKAGE" ]; then
15679d9f 673 beautify build_stage "Full toolchain compilation - Native GCC: `gcc --version | grep GCC | awk {'print $3'}`"
df5e82b3
MT
674 prepareenv
675 buildtoolchain
676 else
677 PACKAGENAME=${PACKAGE%.tar.gz}
15679d9f 678 beautify build_stage "Packaged toolchain compilation"
df5e82b3
MT
679 if [ `md5sum $PACKAGE | awk '{print $1}'` == `cat $PACKAGENAME.md5 | awk '{print $1}'` ]; then
680 tar zxf $PACKAGE
681 prepareenv
682 else
683 exiterror "$PACKAGENAME md5 did not match, check downloaded package"
684 fi
685 fi
686 else
687 echo "`date -u '+%b %e %T'`: Using installed toolchain" | tee -a $LOGFILE
688 prepareenv
689 fi
5cfe86e6 690
15679d9f 691 beautify build_stage "Building base"
df5e82b3 692 buildbase
15679d9f
MT
693
694 beautify build_stage "Building IPFire"
695 buildipfire
5cfe86e6
HS
696
697 # Setzen des IPFire Builds
8af06406 698 if [ "$FIREBUILD" ]; then
e57bc1fd 699 echo "$FIREBUILD" > $BASEDIR/build/var/ipfire/firebuild
5cfe86e6 700 else
e57bc1fd 701 echo "_(OvO)_" > $BASEDIR/build/var/ipfire/firebuild
5cfe86e6
HS
702 fi
703
15679d9f 704 beautify build_stage "Building installer"
df5e82b3 705 buildinstaller
15679d9f
MT
706
707 beautify build_stage "Building packages"
df5e82b3
MT
708 buildpackages
709 ;;
710shell)
711 # enter a shell inside LFS chroot
712 # may be used to changed kernel settings
713 prepareenv
714 entershell
715 ;;
716changelog)
d1dd6669 717 echo -n "Loading new Changelog from SVN: "
f9315063 718 svn log http://svn.ipfire.eu/svn/ipfire > doc/ChangeLog
d1dd6669 719 echo "Finished!"
df5e82b3 720 ;;
df5e82b3
MT
721clean)
722 for i in `mount | grep $BASEDIR | sed 's/^.*loop=\(.*\))/\1/'`; do
723 $LOSETUP -d $i 2>/dev/null
724 done
725 for i in `mount | grep $BASEDIR | cut -d " " -f 1`; do
726 umount $i
727 done
728 stdumount
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;
733 fi;
734 done
735 rm -rf $BASEDIR/build
736 rm -rf $BASEDIR/cdrom
f9315063 737 rm -rf $BASEDIR/packages
df5e82b3 738 rm -rf $BASEDIR/log
df5e82b3
MT
739 if [ -h /tools ]; then
740 rm -f /tools
741 fi
742 ;;
f8e5510c 743newpak)
a9b17001
MT
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"
748 mkdir -p src/paks/$2
749 cd src/paks/$2
f8e5510c 750 echo "`date -u '+%b %e %T'`: Creating files"
a9b17001
MT
751 cp $BASEDIR/lfs/postfix $BASEDIR/lfs/$2
752
f8e5510c 753 touch ROOTFILES
f8e5510c 754 touch {,un}install.sh
a9b17001 755 ## install.sh
f8e5510c
MT
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
a9b17001
MT
766 echo 'cp -f ROOTFILES /opt/pakfire/installed/ROOTFILES.$2' >> install.sh
767 ## uninstall.sh
f8e5510c
MT
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
a9b17001 777 echo 'rm -f /opt/pakfire/installed/ROOTFILES.$2' >> uninstall.sh
f8e5510c 778 echo "`date -u '+%b %e %T'`: Adding files to SVN"
a9b17001
MT
779 cd - && svn add lfs/$2 && svn add src/paks/$2
780
781 echo -n "Do you want to remove the folders? [y/n]"
782 read REM
783 if [ "$REM" == "y" ]; then
784 echo "Removing the folders..."
785 svn del src/paks/$2 --force
786 else
787 echo "Folders are kept."
788 fi
df5e82b3 789 else
a9b17001 790 echo "$2 already exists"
df5e82b3 791 fi
df5e82b3
MT
792 exit 0
793 ;;
794prefetch)
795 if [ ! -d $BASEDIR/cache ]; then
796 mkdir $BASEDIR/cache
797 fi
798 mkdir -p $BASEDIR/log
799 echo "`date -u '+%b %e %T'`:Preload all source files" | tee -a $LOGFILE
800 FINISHED=0
801 cd $BASEDIR/lfs
802 for c in `seq $MAX_RETRIES`; do
803 if (( FINISHED==1 )); then
804 break
805 fi
806 FINISHED=1
807 cd $BASEDIR/lfs
808 for i in *; do
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"
813 FINISHED=0
814 else
815 if [ $c -eq 1 ]; then
816 echo "Prefetch : lfs/$i files loaded"
817 fi
818 fi
819 fi
820 done
821 done
822 echo "Prefetch : verifying md5sum"
823 ERROR=0
824 for i in *; do
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"
829 ERROR=1
830 fi
831 fi
832 done
833 if [ $ERROR -eq 0 ]; then
834 echo "Prefetch : all files md5sum match"
835 fi
836 cd -
837 ;;
df5e82b3
MT
838toolchain)
839 prepareenv
15679d9f 840 beautify build_stage "Toolchain compilation - Native GCC: `gcc --version | grep GCC | awk {'print $3'}`"
df5e82b3
MT
841 buildtoolchain
842 BUILDMACHINE=`uname -m`
843 echo "`date -u '+%b %e %T'`: Create toolchain tar.gz for $BUILDMACHINE" | tee -a $LOGFILE
712d859c
MT
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 \
df5e82b3
MT
846 build/{bin,etc,usr/bin,usr/local} \
847 build/tools/{bin,etc,*-linux-gnu,include,lib,libexec,sbin,share,var} \
848 log >> $LOGFILE
712d859c
MT
849 md5sum cache/toolchains/$SNAME-$VERSION-toolchain-$BUILDMACHINE.tar.gz \
850 > cache/toolchains/$SNAME-$VERSION-toolchain-$BUILDMACHINE.md5
df5e82b3
MT
851 stdumount
852 ;;
853gettoolchain)
854 BUILDMACHINE=`uname -m`
855 # arbitrary name to be updated in case of new toolchain package upload
c6cb9d25 856 PACKAGE=$SNAME-$VERSION-toolchain-$BUILDMACHINE
712d859c
MT
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
40a4ea4c 865 else
712d859c
MT
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
868 else
869 exiterror "$PACKAGE.md5 did not match, check downloaded package"
870 fi
40a4ea4c 871 fi
712d859c
MT
872 else
873 echo "Toolchain is already downloaded. Exiting..."
df5e82b3
MT
874 fi
875 ;;
15679d9f 876othersrc)
ce56e927 877 prepareenv
15679d9f 878 echo -ne "`date -u '+%b %e %T'`: Build sources iso for $MACHINE" | tee -a $LOGFILE
ce56e927
MT
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
15679d9f
MT
885 if [ $? -eq "0" ]; then
886 beautify message DONE
887 else
888 beautify message FAIL
889 fi
ce56e927
MT
890 stdumount
891 ;;
c6cb9d25
MT
892svn)
893 case "$2" in
894 update|up)
cc0e56be 895 # clear
15679d9f 896 echo -ne "Loading the latest source files...\n"
7471f6ab
MT
897 if [ $3 ]; then
898 svn update -r $3 | tee -a $PWD/log/_build.svn.update.log
899 else
900 svn update | tee -a $PWD/log/_build.svn.update.log
901 fi
15679d9f
MT
902 if [ $? -eq "0" ]; then
903 beautify message DONE
c6cb9d25 904 else
15679d9f 905 beautify message FAIL
c6cb9d25
MT
906 exit 1
907 fi
15679d9f 908 echo -ne "Writing the svn-info to a file"
c6cb9d25 909 svn info > $PWD/svn_status
15679d9f
MT
910 if [ $? -eq "0" ]; then
911 beautify message DONE
c6cb9d25 912 else
15679d9f 913 beautify message FAIL
c6cb9d25
MT
914 exit 1
915 fi
712d859c 916 chmod 755 $0
cc0e56be 917 exit 0
c6cb9d25
MT
918 ;;
919 commit|ci)
920 clear
d79b46cb 921 if [ -e /sbin/yast ]; then
028698e8
MT
922 if [ "`echo $SVN_REVISION | cut -c 3`" -eq "0" ]; then
923 $0 changelog
924 fi
d79b46cb
MT
925 fi
926 echo "Upload the changed files..."
c6cb9d25 927 sleep 1
15679d9f 928 svn commit
c6cb9d25
MT
929 $0 svn up
930 ;;
931 dist)
7471f6ab
MT
932 if [ $3 ]; then
933 SVN_REVISION=$3
934 fi
935 if [ -f ipfire-source-r$SVN_REVISION.tar.gz ]; then
936 echo -ne "REV $SVN_REVISION: SKIPPED!\n"
937 exit 0
938 fi
939 echo -en "REV $SVN_REVISION: Downloading..."
c6cb9d25 940 svn export http://svn.ipfire.eu/svn/ipfire ipfire-source/ --force > /dev/null
7471f6ab 941 svn log http://svn.ipfire.eu/svn/ipfire -r 1:$SVN_REVISION > ipfire-source/Changelog
9fa7d717 942 #svn info http://svn.ipfire.eu/svn/ipfire -r $SVN_REVISION > ipfire-source/svn_status
15679d9f
MT
943 evaluate 1
944
7471f6ab
MT
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
948 fi
9dc02b38 949 tar cfz ipfire-source-r$SVN_REVISION.tar.gz ipfire-source
15679d9f 950 evaluate 1
7471f6ab 951 echo -en "REV $SVN_REVISION: Cleaning up..."
c6cb9d25 952 rm ipfire-source/ -r
15679d9f 953 evaluate 1
7471f6ab 954 ;;
028698e8 955 diff|di)
15679d9f 956 echo -ne "Make a local diff to last svn revision"
c6cb9d25 957 svn diff > ipfire-diff-`date +'%Y-%m-%d-%H:%M'`-r`svn info | grep Revision | cut -c 11-`.diff
15679d9f 958 evaluate 1
c6cb9d25
MT
959 echo "Diff was successfully saved to ipfire-diff-`date +'%Y-%m-%d-%H:%M'`-r`svn info | grep Revision | cut -c 11-`.diff"
960 ;;
961 esac
f9315063 962 ;;
15679d9f
MT
963uploadsrc)
964 PWD=`pwd`
965 cd $BASEDIR/cache/
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
968 for i in *; do
969 grep -q $i /var/tmp/ftplist
0eab8e84 970 if [ "$?" -ne "0" ]; then
15679d9f
MT
971 echo -ne "$i"
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
0eab8e84 973 if [ "$?" -eq "0" ]; then
15679d9f 974 beautify message DONE
0eab8e84 975 else
15679d9f 976 beautify message FAIL
0eab8e84 977 fi
15679d9f
MT
978 else
979 echo -ne "$i"
980 beautify message SKIP
0eab8e84
MT
981 fi
982 done
15679d9f
MT
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
987 do
988 UL_TIME=$(expr `date +'%s'` - $UL_TIME_START)
989 echo -ne "\r ${UL_TIME}s : Upload is running..."
990 sleep 1
991 done
992 beautify message DONE
993 cd $PWD
994 exit 0
0eab8e84 995 ;;
cc0e56be
MT
996upload)
997 case "$2" in
998 iso)
999 echo -e "Uploading the iso to $IPFIRE_FTP_URL_EXT."
9dc02b38
MT
1000 cat <<EOF > .ftp-commands
1001mkdir $IPFIRE_FTP_PATH_EXT
1002ls -lah
1003quit
1004EOF
1005 ncftp -u $IPFIRE_FTP_USER_EXT -p $IPFIRE_FTP_PASS_EXT $IPFIRE_FTP_URL_EXT < .ftp-commands
1006 rm -f .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
6aae8d61 1011 ncftpput -u $IPFIRE_FTP_USER_EXT -p $IPFIRE_FTP_PASS_EXT $IPFIRE_FTP_URL_EXT $IPFIRE_FTP_PATH_EXT/ svn_status
9dc02b38
MT
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/."
cc0e56be 1014 else
9dc02b38
MT
1015 echo -e "There was an error while uploading the iso to the ftp server."
1016 exit 1
cc0e56be 1017 fi
6aae8d61
MT
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
1020 fi
cc0e56be
MT
1021 ;;
1022 paks)
9dc02b38
MT
1023 cat <<EOF > .ftp-commands
1024mkdir $IPFIRE_FTP_PATH_PAK
1025ls -lah
1026quit
1027EOF
1028 ncftp -u $IPFIRE_FTP_USER_PAK -p $IPFIRE_FTP_PASS_PAK $IPFIRE_FTP_URL_PAK < .ftp-commands
1029 rm -f .ftp-commands
cc0e56be
MT
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
9dc02b38 1032 echo -e "The packages were successfully uploaded to $IPFIRE_FTP_URL_PAK$IPFIRE_FTP_PATH_PAK/."
cc0e56be
MT
1033 else
1034 echo -e "There was an error while uploading the packages to the ftp server."
712d859c 1035 exit 1
cc0e56be
MT
1036 fi
1037 ;;
1038 esac
0d0521b6 1039 ;;
cc0e56be 1040batch)
15679d9f
MT
1041 if [ "$2" -eq "--background" ]; then
1042 batch_script
1043 exit $?
1044 fi
27ac55bf 1045 if [ `screen -ls | grep -q ipfire` ]; then
712d859c
MT
1046 echo "Build is already running, sorry!"
1047 exit 1
1048 else
27ac55bf
MT
1049 if [ "$2" = "--rebuild" ]; then
1050 export IPFIRE_REBUILD=1
1051 echo "REBUILD!"
1052 else
1053 export IPFIRE_REBUILD=0
1054 fi
15679d9f
MT
1055 echo -en "${BOLD}***IPFire-Batch-Build is starting...${NORMAL}"
1056 screen -dmS ipfire $0 batch --background
1057 evaluate 1
712d859c
MT
1058 exit 0
1059 fi
cc0e56be 1060 ;;
028698e8 1061watch)
15679d9f 1062 watch_screen
028698e8 1063 ;;
df5e82b3 1064*)
24a4a744
MT
1065 clear
1066 svn info
712d859c 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"
24a4a744
MT
1068 do
1069 case $name in
c6cb9d25
MT
1070 "IPFIRE: Prefetch")
1071 $0 prefetch
1072 ;;
1073 "IPFIRE: Build (silent)")
1074 $0 build-silent
1075 ;;
1076 "IPFIRE: Watch Build")
028698e8 1077 $0 watch
c6cb9d25 1078 ;;
712d859c
MT
1079 "IPFIRE: Batch")
1080 $0 batch
1081 ;;
c6cb9d25
MT
1082 "IPFIRE: Clean")
1083 $0 clean
1084 ;;
1085 "SVN: Commit")
15679d9f
MT
1086 if [ -f /usr/bin/mcedit ]; then
1087 export EDITOR=/usr/sbin/mcedit
d63e8889 1088 fi
15679d9f
MT
1089 $0 svn commit
1090 $0 uploadsrc
c6cb9d25
MT
1091 ;;
1092 "SVN: Update")
1093 $0 svn update
1094 ;;
1095 "SVN: Status")
1096 svn status # | grep -v ^?
1097 ;;
1098 "SVN: Diff")
1099 $0 svn diff
1100 ;;
1101 "Help")
1102 echo "Usage: $0 {build|changelog|check|checkclean|clean|gettoolchain|newpak|prefetch|shell|sync|toolchain}"
1103 cat doc/make.sh-usage
1104 ;;
712d859c
MT
1105 "LOG: Tail")
1106 tail -f log/_*
1107 ;;
c6cb9d25
MT
1108 "Exit")
1109 break
1110 ;;
24a4a744
MT
1111 esac
1112 done
df5e82b3 1113 ;;
3ea75603 1114esac