Zwischencommit fuer LFS. GCC und Binutils fixed.
[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 ############################################################################
9b0ff0a0 98 echo -ne "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 ############################################################################
9b0ff0a0 113 echo -ne "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 ############################################################################
9b0ff0a0 127 echo -ne "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 ############################################################################
df5e82b3
MT
145 # Set umask
146 umask 022
147
148 # Set LFS Directory
149 LFS=$BASEDIR/build
150
151 # Check /tools symlink
152 if [ -h /tools ]; then
153 rm -f /tools
154 fi
155 if [ ! -a /tools ]; then
156 ln -s $BASEDIR/build/tools /
157 fi
158 if [ ! -h /tools ]; then
159 exiterror "Could not create /tools symbolic link."
160 fi
161
162 # Setup environment
163 set +h
164 LC_ALL=POSIX
dd714b8a
MT
165 MAKETUNING="-j8"
166 export LFS LC_ALL CFLAGS CXXFLAGS MAKETUNING
df5e82b3
MT
167 unset CC CXX CPP LD_LIBRARY_PATH LD_PRELOAD
168
169 # Make some extra directories
170 mkdir -p $BASEDIR/build/{tools,etc,usr/src} 2>/dev/null
90d372c4 171 mkdir -p $BASEDIR/build/{dev/{shm,pts},proc,sys}
df5e82b3 172 mkdir -p $BASEDIR/{cache,ccache} 2>/dev/null
90d372c4
MT
173 mkdir -p $BASEDIR/build/usr/src/{cache,config,doc,html,langs,lfs,log,src,ccache}
174
175 mknod -m 600 $BASEDIR/build/dev/console c 5 1 2>/dev/null
176 mknod -m 666 $BASEDIR/build/dev/null c 1 3 2>/dev/null
df5e82b3
MT
177
178 # Make all sources and proc available under lfs build
90d372c4 179 mount --bind /dev $BASEDIR/build/dev
b4b6bcdb
MT
180 mount -t devpts devpts $BASEDIR/build/dev/pts
181 mount -t tmpfs shm $BASEDIR/build/dev/shm
182 mount -t proc proc $BASEDIR/build/proc
183 mount -t sysfs sysfs $BASEDIR/build/sys
df5e82b3
MT
184 mount --bind $BASEDIR/cache $BASEDIR/build/usr/src/cache
185 mount --bind $BASEDIR/ccache $BASEDIR/build/usr/src/ccache
186 mount --bind $BASEDIR/config $BASEDIR/build/usr/src/config
187 mount --bind $BASEDIR/doc $BASEDIR/build/usr/src/doc
188 mount --bind $BASEDIR/html $BASEDIR/build/usr/src/html
189 mount --bind $BASEDIR/langs $BASEDIR/build/usr/src/langs
190 mount --bind $BASEDIR/lfs $BASEDIR/build/usr/src/lfs
191 mount --bind $BASEDIR/log $BASEDIR/build/usr/src/log
192 mount --bind $BASEDIR/src $BASEDIR/build/usr/src/src
193
194 # Run LFS static binary creation scripts one by one
195 export CCACHE_DIR=$BASEDIR/ccache
196 export CCACHE_HASHDIR=1
197
198 # Remove pre-install list of installed files in case user erase some files before rebuild
199 rm -f $BASEDIR/build/usr/src/lsalr 2>/dev/null
200}
201
df5e82b3
MT
202buildtoolchain() {
203 LOGFILE="$BASEDIR/log/_build.toolchain.log"
204 export LOGFILE
df5e82b3
MT
205 ORG_PATH=$PATH
206 NATIVEGCC=`gcc --version | grep GCC | awk {'print $3'}`
207 export NATIVEGCC GCCmajor=${NATIVEGCC:0:1} GCCminor=${NATIVEGCC:2:1} GCCrelease=${NATIVEGCC:4:1}
208 lfsmake1 ccache
15679d9f
MT
209 lfsmake1 binutils PASS=1
210 lfsmake1 gcc PASS=1
df5e82b3 211 export PATH=$BASEDIR/build/usr/local/bin:$BASEDIR/build/tools/bin:$PATH
dd714b8a
MT
212 lfsmake1 linux-libc-header
213 lfsmake1 glibc
9b0ff0a0 214 lfsmake1 cleanup-toolchain PASS=1
df5e82b3
MT
215 lfsmake1 tcl
216 lfsmake1 expect
df5e82b3 217 lfsmake1 dejagnu
15679d9f
MT
218 lfsmake1 gcc PASS=2
219 lfsmake1 binutils PASS=2
dd714b8a
MT
220 lfsmake1 ncurses
221 lfsmake1 bash
df5e82b3 222 lfsmake1 bzip2
dd714b8a 223 lfsmake1 coreutils
df5e82b3
MT
224 lfsmake1 diffutils
225 lfsmake1 findutils
dd714b8a 226 lfsmake1 gawk
df5e82b3 227 lfsmake1 gettext
dd714b8a
MT
228 lfsmake1 grep
229 lfsmake1 gzip
230 lfsmake1 m4
231 lfsmake1 make
df5e82b3 232 lfsmake1 patch
dd714b8a
MT
233 lfsmake1 perl
234 lfsmake1 sed
df5e82b3
MT
235 lfsmake1 tar
236 lfsmake1 texinfo
df5e82b3 237 lfsmake1 util-linux
9b0ff0a0 238 lfsmake1 cleanup-toolchain PASS=2
df5e82b3
MT
239 export PATH=$ORG_PATH
240}
241
242buildbase() {
243 LOGFILE="$BASEDIR/log/_build.base.log"
244 export LOGFILE
df5e82b3 245 lfsmake2 stage2
9b0ff0a0
MT
246# lfsmake2 makedev
247 lfsmake2 linux-libc-header
df5e82b3
MT
248 lfsmake2 man-pages
249 lfsmake2 glibc
9b0ff0a0 250 lfsmake2 cleanup-toolchain PASS=3
df5e82b3
MT
251 lfsmake2 binutils
252 lfsmake2 gcc
9b0ff0a0 253 lfsmake2 berkeley
df5e82b3 254 lfsmake2 coreutils
df5e82b3 255 lfsmake2 iana-etc
df5e82b3
MT
256 lfsmake2 m4
257 lfsmake2 bison
9b0ff0a0
MT
258 lfsmake2 ncurses
259 lfsmake2 procps
df5e82b3 260 lfsmake2 sed
9b0ff0a0 261 lfsmake2 libtool
df5e82b3 262 lfsmake2 perl
9b0ff0a0
MT
263 lfsmake2 readline
264 lfsmake2 zlib
df5e82b3
MT
265 lfsmake2 autoconf
266 lfsmake2 automake
267 lfsmake2 bash
df5e82b3
MT
268 lfsmake2 bzip2
269 lfsmake2 diffutils
df5e82b3 270 lfsmake2 e2fsprogs
9b0ff0a0
MT
271 lfsmake2 file
272 lfsmake2 findutils
273 lfsmake2 flex
15679d9f 274 lfsmake2 grub
9b0ff0a0
MT
275 lfsmake2 gawk
276 lfsmake2 gettext
277 lfsmake2 grep
278 lfsmake2 groff
df5e82b3 279 lfsmake2 gzip
9b0ff0a0
MT
280 lfsmake2 inetutils
281 lfsmake2 iproute2
282 lfsmake2 kbd
283 lfsmake2 less
df5e82b3 284 lfsmake2 make
9b0ff0a0
MT
285 lfsmake2 man
286 lfsmake2 mktemp
df5e82b3
MT
287 lfsmake2 modutils
288 lfsmake2 patch
df5e82b3
MT
289 lfsmake2 psmisc
290 lfsmake2 shadow
291 lfsmake2 sysklogd
292 lfsmake2 sysvinit
293 lfsmake2 tar
90d372c4
MT
294 lfsmake2 texinfo
295 lfsmake2 udev
df5e82b3 296 lfsmake2 util-linux
90d372c4
MT
297 lfsmake2 vim
298####
299# lfsmake2 net-tools
300# lfsmake2 inetutils
301# lfsmake2 ed
302# lfsmake2 procinfo
df5e82b3
MT
303}
304
15679d9f 305buildipfire() {
907cd036 306 LOGFILE="$BASEDIR/log/_build.ipfire.log"
df5e82b3 307 export LOGFILE
15679d9f
MT
308 ipfiremake configroot
309 ipfiremake dhcp
310 ipfiremake dhcpcd
311 ipfiremake libusb
312 ipfiremake libpcap
313 ipfiremake linux-atm
314 ipfiremake ppp
315 ipfiremake rp-pppoe
316 ipfiremake unzip
317 ipfiremake linux PASS=ipfire SMP=installer
318 ipfiremake linux PASS=ipfire SMP=1
319 ipfiremake 3cp4218 SMP=1
320 ipfiremake amedyn SMP=1
321 ipfiremake cxacru SMP=1
322 ipfiremake eagle SMP=1
323 ipfiremake cnx_pci SMP=1
324 ipfiremake fcdsl SMP=1
325 ipfiremake fcdsl2 SMP=1
326 ipfiremake fcdslsl SMP=1
327 ipfiremake fcdslusb SMP=1
328 ipfiremake fcdslslusb SMP=1
329 ipfiremake fcpci SMP=1
330 ipfiremake fcclassic SMP=1
331 ipfiremake pulsar SMP=1
332 ipfiremake unicorn SMP=1
333 ipfiremake promise-sata-300-tx SMP=1
334 ipfiremake linux PASS=ipfire
335 ipfiremake 3cp4218
336 ipfiremake amedyn
337 ipfiremake cxacru
338 ipfiremake eciadsl
339 ipfiremake eagle
340 ipfiremake speedtouch
341 ipfiremake cnx_pci
342 ipfiremake fcdsl
343 ipfiremake fcdsl2
344 ipfiremake fcdslsl
345 ipfiremake fcdslusb
346 ipfiremake fcdslslusb
347 ipfiremake fcpci
348 ipfiremake fcclassic
349 ipfiremake pulsar
350 ipfiremake unicorn
351 ipfiremake promise-sata-300-tx
352 ipfiremake pcmcia-cs
353 ipfiremake expat
354 ipfiremake gdbm
355 ipfiremake gmp
356 ipfiremake openssl
357 ipfiremake python
358 ipfiremake libnet
359 ipfiremake libpng
360 ipfiremake libtiff
361 ipfiremake libjpeg
362 ipfiremake lcms
363 ipfiremake libmng
364 ipfiremake freetype
365 ipfiremake gd
366 ipfiremake popt
367 ipfiremake slang
368 ipfiremake newt
369 ipfiremake libcap
370 ipfiremake pciutils
371 ipfiremake pcre
372 ipfiremake readline
373 ipfiremake libxml2
374 ipfiremake berkeley
375 ipfiremake BerkeleyDB ## The Perl module
376 ipfiremake mysql
377 ipfiremake saslauthd PASS=1
378 ipfiremake openldap
379 ipfiremake apache2
380 ipfiremake php
381 ipfiremake subversion
382 ipfiremake apache2 PASS=CONFIG
383 ipfiremake arping
384 ipfiremake beep
385 ipfiremake bind
386 ipfiremake capi4k-utils
387 ipfiremake cdrtools
388 ipfiremake dnsmasq
389 ipfiremake dosfstools
390 ipfiremake ethtool
391 ipfiremake ez-ipupdate
392 ipfiremake fcron
393 ipfiremake perl-GD
394 ipfiremake gnupg
395 ipfiremake hdparm
396 ipfiremake ibod
397 ipfiremake initscripts
398 ipfiremake iptables
399 ipfiremake ipac-ng
400 ipfiremake ipaddr
401 ipfiremake iproute2
402 ipfiremake iptstate
403 ipfiremake iputils
404 ipfiremake l7-protocols
405 ipfiremake isapnptools
406 ipfiremake isdn4k-utils
407 ipfiremake kudzu
408 ipfiremake logrotate
409 ipfiremake logwatch
410 ipfiremake mingetty
411 ipfiremake misc-progs
412 ipfiremake mtools
413 ipfiremake nano
414 ipfiremake nash
415 ipfiremake nasm
416 ipfiremake URI
417 ipfiremake HTML-Tagset
418 ipfiremake HTML-Parser
419 ipfiremake Compress-Zlib
420 ipfiremake Digest
421 ipfiremake Digest-SHA1
422 ipfiremake Digest-HMAC
423 ipfiremake libwww-perl
424 ipfiremake Net-DNS
425 ipfiremake Net-IPv4Addr
426 ipfiremake Net_SSLeay
427 ipfiremake IO-Stringy
428 ipfiremake Unix-Syslog
429 ipfiremake Mail-Tools
430 ipfiremake MIME-Tools
431 ipfiremake Net-Server
432 ipfiremake Convert-TNEF
433 ipfiremake Convert-UUlib
434 ipfiremake Archive-Tar
435 ipfiremake Archive-Zip
436 ipfiremake Text-Tabs+Wrap
437 ipfiremake Locale-Country
438 ipfiremake GeoIP
439 ipfiremake fwhits
440 ipfiremake noip_updater
441 ipfiremake ntp
442 ipfiremake oinkmaster
443 ipfiremake openssh
444 ipfiremake openswan
445 ipfiremake pptpclient
446 ipfiremake rrdtool
447 ipfiremake setserial
448 ipfiremake setup
449 ipfiremake snort
450 ipfiremake squid
451 ipfiremake squid-graph
452 ipfiremake squidguard
453 ipfiremake tcpdump
454 ipfiremake traceroute
455 ipfiremake vlan
456 ipfiremake wireless
457 ipfiremake libsafe
458 ipfiremake 3c5x9setup
459 ipfiremake pakfire
460 ipfiremake startscripts
461 ipfiremake java
462 ipfiremake bootsplash
463 ipfiremake spandsp
464 ipfiremake lzo
465 ipfiremake openvpn
466 ipfiremake pkg-config
467 ipfiremake glib
468 ipfiremake pam
469 ipfiremake pammysql
470 ipfiremake saslauthd PASS=2
471 ipfiremake xinetd
472 ipfiremake ghostscript
473 ipfiremake cups
474 ipfiremake samba
475 ipfiremake sudo
476 ipfiremake mc
477 ipfiremake wget
478 ipfiremake wput
479 ipfiremake bridge-utils
480 ipfiremake screen
481 ipfiremake hddtemp
482 ipfiremake smartmontools
483 ipfiremake htop
484 ipfiremake lynx
485 ipfiremake postfix
486 ipfiremake procmail
487 ipfiremake fetchmail
488 ipfiremake cyrusimap
489 ipfiremake webcyradm
490 ipfiremake mailx
491 ipfiremake clamav
492 ipfiremake razor
493 ipfiremake spamassassin
494# ipfiremake amavisd
495 ipfiremake stund
496 ipfiremake zaptel
497 ipfiremake libpri
498 ipfiremake bristuff
499 ipfiremake asterisk
500 ipfiremake mpg123
501 ipfiremake libmad
502 ipfiremake libogg
503 ipfiremake libvorbis
504 ipfiremake lame
505 ipfiremake xvid
506 ipfiremake mpeg2dec
507 ipfiremake ffmpeg
508 ipfiremake sox
509 ipfiremake gnump3d
510 ipfiremake videolan
511 ipfiremake applejuice
512 ipfiremake ocaml
513 ipfiremake mldonkey
514 ipfiremake ntop
515 ipfiremake rsync
516 ipfiremake tcpwrapper
517 ipfiremake portmap
518 ipfiremake nfs
519 ipfiremake nmap
520 ipfiremake mbmon
521 ipfiremake iftop
522 ipfiremake ncftp
523 ipfiremake cftp
524 ipfiremake etherwake
525 ipfiremake ethereal
526 ipfiremake tftp-hpa
527 ipfiremake iptraf
528 ipfiremake nagios
529 ipfiremake yasuc
df5e82b3
MT
530}
531
532buildinstaller() {
533 # Run installer scripts one by one
534 LOGFILE="$BASEDIR/log/_build.installer.log"
535 export LOGFILE
15679d9f
MT
536 ipfiremake syslinux
537 ipfiremake as86
538 ipfiremake mbr
539 ipfiremake uClibc
df5e82b3
MT
540 installmake busybox
541 installmake sysvinit
542 installmake e2fsprogs
543 installmake misc-progs
544 installmake slang
545 installmake util-linux
546 installmake newt
547 installmake pciutils
548 installmake pcmcia-cs
549 installmake kbd
550 installmake installer
551 installmake scsi.img
552 installmake driver.img
553 installmake initrd
554 installmake boot.img
555}
556
557buildpackages() {
558 LOGFILE="$BASEDIR/log/_build.packages.log"
559 export LOGFILE
560 echo "... see detailed log in _build.*.log files" >> $LOGFILE
561 echo -ne "`date -u '+%b %e %T'`: Stage5 packages build \n" | tee -a $LOGFILE
562 # Strip files
563 echo "`date -u '+%b %e %T'`: Stripping files" | tee -a $LOGFILE
564 find $LFS/lib $LFS/usr/lib $LFS/usr/share/rrdtool-* $LFS/install ! -type l \( -name '*.so' -o -name '*.so[\.0-9]*' \) \
565 ! -name 'libc.so' ! -name 'libpthread.so' ! -name 'libcrypto.so.0.9.7.sha1' \
90350ff3 566 -exec $LFS/tools/bin/strip --strip-all {} \; >> $LOGFILE 2>&1
df5e82b3
MT
567 # add -ls before -exec if you want to verify what files are stripped
568
569 find $LFS/{,s}bin $LFS/usr/{,s}bin $LFS/usr/local/{,s}bin ! -type l \
570 -exec file {} \; | grep " ELF " | cut -f1 -d ':' | xargs $LFS/tools/bin/strip --strip-all >> $LOGFILE 2>&1
571 # there add -v to strip to verify
572
573 if [ 'i386' = $MACHINE ]; then
574 # Create fcdsl packages
575 echo "`date -u '+%b %e %T'`: Building fcdsl tgz" | tee -a $LOGFILE
576 cp $LFS/install/images/fcdsl/license.txt $LFS >> $LOGFILE 2>&1
577 touch $LFS/var/run/{need-depmod-$KVER,need-depmod-$KVER-smp}
578 cd $LFS && tar cvfz $LFS/install/images/$SNAME-fcdsl-$VERSION.$MACHINE.tgz \
579 lib/modules/$KVER/misc/fcdsl*.o.gz \
580 lib/modules/$KVER-smp/misc/fcdsl*.o.gz \
581 usr/lib/isdn/{fds?base.bin,fd?ubase.frm} \
582 etc/fcdsl/fcdsl*.conf \
583 etc/drdsl/{drdsl,drdsl.ini} \
584 license.txt \
585 var/run/{need-depmod-$KVER,need-depmod-$KVER-smp} >> $LOGFILE 2>&1
586 rm -f $LFS/license.txt >> $LOGFILE 2>&1
587 cd $BASEDIR
588 fi
df5e82b3
MT
589
590 # Generating list of packages used
591 echo "`date -u '+%b %e %T'`: Generating packages list from logs" | tee -a $LOGFILE
592 rm -f $BASEDIR/doc/packages-list
593 for i in `ls -1tr $BASEDIR/log/[^_]*`; do
594 if [ "$i" != "$BASEDIR/log/FILES" -a -n $i ]; then
7471f6ab 595 echo "* `basename $i`" >>$BASEDIR/doc/packages-list
df5e82b3
MT
596 fi
597 done
7471f6ab 598 echo "== List of softwares used to build $NAME Version: $VERSION ==" > $BASEDIR/doc/packages-list.txt
f522e307 599 grep -v 'configroot$\|img$\|initrd$\|initscripts$\|installer$\|install$\|ipfire$\|setup$\|pakfire$\|stage2$\|smp$\|tools$\|tools1$\|tools2$\|.tgz$\|-config$' \
df5e82b3
MT
600 $BASEDIR/doc/packages-list | sort >> $BASEDIR/doc/packages-list.txt
601 rm -f $BASEDIR/doc/packages-list
c9673262 602 # packages-list.txt is ready to be displayed for wiki page
df5e82b3 603
f522e307 604 # Create ISO for CDROM
15679d9f 605 ipfiremake cdrom
e67a57fe 606 rm -f $LFS/install/images/*usb*
c3defe9b 607 cp $LFS/install/images/{*.iso,*.tgz} $BASEDIR >> $LOGFILE 2>&1
c9673262 608
e67a57fe
MT
609 ipfirepackages
610
611 # Cleanup
612 stdumount
613 rm -rf $BASEDIR/build/tmp/*
614
615 # Generating total list of files
616 echo "`date -u '+%b %e %T'`: Generating files list from logs" | tee -a $LOGFILE
617 rm -f $BASEDIR/log/FILES
618 for i in `ls -1tr $BASEDIR/log/[^_]*`; do
619 if [ "$i" != "$BASEDIR/log/FILES" -a -n $i ]; then
620 echo "##" >>$BASEDIR/log/FILES
621 echo "## `basename $i`" >>$BASEDIR/log/FILES
622 echo "##" >>$BASEDIR/log/FILES
623 cat $i | sed "s%^\./%#%" | sort >> $BASEDIR/log/FILES
624 fi
625 done
913668ba 626 cd $BASEDIR/packages; ls -w1 *.ipfire | awk -F ".ipfire" '{ print $1 }' > $BASEDIR/packages/packages_list.txt
5e773594 627 echo -n "###EOF###" >> $BASEDIR/packages/packages_list.txt
e67a57fe
MT
628
629 cd $PWD
630
631}
632
633ipfirepackages() {
013a23e2
MT
634 if [ -d "$BASEDIR/packages" ]; then
635 for i in `ls $BASEDIR/packages`; do
636 touch $BASEDIR/build/install/packages/$i.empty
637 done
638 fi
f1baee3e 639# ipfiredist amavisd
78331e30 640 ipfiredist applejuice
5ac2da9f 641 ipfiredist asterisk
c7acba4a 642 ipfiredist clamav
483f59cd 643 ipfiredist cups
78331e30
MT
644 ipfiredist cyrusimap
645 ipfiredist fetchmail
d1b6aa72 646 ipfiredist ffmpeg
78331e30 647 ipfiredist gnump3d
7a98bae5 648 ipfiredist iptraf
0d0521b6 649 ipfiredist java
78331e30 650 ipfiredist lame
d1b6aa72 651 ipfiredist libmad
ae179f6e 652 ipfiredist libogg
78331e30 653 ipfiredist libtiff
ae179f6e 654 ipfiredist libvorbis
f0ca8c34 655 ipfiredist mailx
3ab910dd 656 ipfiredist mldonkey
d1b6aa72 657 ipfiredist mpeg2dec
2ae94d2d 658 ipfiredist nagios
f0ca8c34
MT
659 ipfiredist nfs
660 ipfiredist nmap
3e45cc09 661 ipfiredist ntop
27ac55bf 662 ipfiredist portmap
78331e30 663 ipfiredist postfix
371d9df0 664 ipfiredist procmail
90350ff3 665 ipfiredist samba
ae179f6e 666 ipfiredist sox
f0ca8c34 667 ipfiredist spamassassin
7a98bae5 668 ipfiredist subversion
d1b6aa72 669 ipfiredist videolan
f1baee3e 670 ipfiredist webcyradm
d1b6aa72 671 ipfiredist xvid
0145f271 672 ipfiredist yasuc
78331e30 673 test -d $BASEDIR/packages || mkdir $BASEDIR/packages
d535503d 674 mv -f $LFS/install/packages/*.{ipfire,md5} $BASEDIR/packages >> $LOGFILE 2>&1
483f59cd 675 rm -rf $BASEDIR/build/install/packages/*
df5e82b3
MT
676}
677
678# See what we're supposed to do
679case "$1" in
680build)
9729e787 681 clear
df5e82b3 682 BUILDMACHINE=`uname -m`
712d859c 683 PACKAGE=`ls -v -r $BASEDIR/cache/toolchains/$SNAME-$VERSION-toolchain-$BUILDMACHINE.tar.gz 2> /dev/null | head -n 1`
df5e82b3 684 #only restore on a clean disk
9b0ff0a0 685 if [ ! -f log/cleanup-toolchain-2-tools ]; then
df5e82b3 686 if [ ! -n "$PACKAGE" ]; then
15679d9f 687 beautify build_stage "Full toolchain compilation - Native GCC: `gcc --version | grep GCC | awk {'print $3'}`"
df5e82b3
MT
688 prepareenv
689 buildtoolchain
690 else
691 PACKAGENAME=${PACKAGE%.tar.gz}
15679d9f 692 beautify build_stage "Packaged toolchain compilation"
df5e82b3
MT
693 if [ `md5sum $PACKAGE | awk '{print $1}'` == `cat $PACKAGENAME.md5 | awk '{print $1}'` ]; then
694 tar zxf $PACKAGE
695 prepareenv
696 else
697 exiterror "$PACKAGENAME md5 did not match, check downloaded package"
698 fi
699 fi
700 else
9729e787
MT
701 echo -n "Using installed toolchain" | tee -a $LOGFILE
702 beautify message SKIP
df5e82b3
MT
703 prepareenv
704 fi
5cfe86e6 705
15679d9f 706 beautify build_stage "Building base"
df5e82b3 707 buildbase
15679d9f
MT
708
709 beautify build_stage "Building IPFire"
710 buildipfire
5cfe86e6
HS
711
712 # Setzen des IPFire Builds
8af06406 713 if [ "$FIREBUILD" ]; then
e57bc1fd 714 echo "$FIREBUILD" > $BASEDIR/build/var/ipfire/firebuild
5cfe86e6 715 else
e57bc1fd 716 echo "_(OvO)_" > $BASEDIR/build/var/ipfire/firebuild
5cfe86e6
HS
717 fi
718
15679d9f 719 beautify build_stage "Building installer"
df5e82b3 720 buildinstaller
15679d9f
MT
721
722 beautify build_stage "Building packages"
df5e82b3
MT
723 buildpackages
724 ;;
725shell)
726 # enter a shell inside LFS chroot
727 # may be used to changed kernel settings
728 prepareenv
729 entershell
730 ;;
731changelog)
d1dd6669 732 echo -n "Loading new Changelog from SVN: "
f9315063 733 svn log http://svn.ipfire.eu/svn/ipfire > doc/ChangeLog
d1dd6669 734 echo "Finished!"
df5e82b3 735 ;;
df5e82b3
MT
736clean)
737 for i in `mount | grep $BASEDIR | sed 's/^.*loop=\(.*\))/\1/'`; do
738 $LOSETUP -d $i 2>/dev/null
739 done
740 for i in `mount | grep $BASEDIR | cut -d " " -f 1`; do
741 umount $i
742 done
743 stdumount
744 for i in `seq 0 7`; do
745 if ( losetup /dev/loop${i} 2>/dev/null | grep -q "/install/images" ); then
746 umount /dev/loop${i} 2>/dev/null;
747 losetup -d /dev/loop${i} 2>/dev/null;
748 fi;
749 done
750 rm -rf $BASEDIR/build
751 rm -rf $BASEDIR/cdrom
f9315063 752 rm -rf $BASEDIR/packages
df5e82b3 753 rm -rf $BASEDIR/log
df5e82b3
MT
754 if [ -h /tools ]; then
755 rm -f /tools
756 fi
757 ;;
f8e5510c 758newpak)
a9b17001
MT
759 # create structure for a new package
760 echo -e "Name of the new package: $2"
761 if [ ! -f "lfs/$2" ]; then
762 echo "`date -u '+%b %e %T'`: Creating directory src/paks/$2"
763 mkdir -p src/paks/$2
764 cd src/paks/$2
f8e5510c 765 echo "`date -u '+%b %e %T'`: Creating files"
a9b17001
MT
766 cp $BASEDIR/lfs/postfix $BASEDIR/lfs/$2
767
f8e5510c 768 touch ROOTFILES
f8e5510c 769 touch {,un}install.sh
a9b17001 770 ## install.sh
f8e5510c
MT
771 echo '#!/bin/bash' > install.sh
772 echo '#' >> install.sh
773 echo '#################################################################' >> install.sh
774 echo '# #' >> install.sh
775 echo '# This file belongs to IPFire Firewall - GPLv2 - www.ipfire.org #' >> install.sh
776 echo '# #' >> install.sh
777 echo '#################################################################' >> install.sh
778 echo '#' >> install.sh
779 echo '# Extract the files' >> install.sh
780 echo 'tar xfz files.tgz -C /' >> install.sh
a9b17001
MT
781 echo 'cp -f ROOTFILES /opt/pakfire/installed/ROOTFILES.$2' >> install.sh
782 ## uninstall.sh
f8e5510c
MT
783 echo '#!/bin/bash' > uninstall.sh
784 echo '#################################################################' >> uninstall.sh
785 echo '# #' >> uninstall.sh
786 echo '# This file belongs to IPFire Firewall - GPLv2 - www.ipfire.org #' >> uninstall.sh
787 echo '# #' >> uninstall.sh
788 echo '#################################################################' >> uninstall.sh
789 echo '#' >> uninstall.sh
790 echo '# Delete the files' >> uninstall.sh
791 echo '## Befehl fehlt noch' >> uninstall.sh
a9b17001 792 echo 'rm -f /opt/pakfire/installed/ROOTFILES.$2' >> uninstall.sh
f8e5510c 793 echo "`date -u '+%b %e %T'`: Adding files to SVN"
a9b17001
MT
794 cd - && svn add lfs/$2 && svn add src/paks/$2
795
796 echo -n "Do you want to remove the folders? [y/n]"
797 read REM
798 if [ "$REM" == "y" ]; then
799 echo "Removing the folders..."
800 svn del src/paks/$2 --force
801 else
802 echo "Folders are kept."
803 fi
df5e82b3 804 else
a9b17001 805 echo "$2 already exists"
df5e82b3 806 fi
df5e82b3
MT
807 exit 0
808 ;;
809prefetch)
810 if [ ! -d $BASEDIR/cache ]; then
811 mkdir $BASEDIR/cache
812 fi
813 mkdir -p $BASEDIR/log
814 echo "`date -u '+%b %e %T'`:Preload all source files" | tee -a $LOGFILE
815 FINISHED=0
816 cd $BASEDIR/lfs
817 for c in `seq $MAX_RETRIES`; do
818 if (( FINISHED==1 )); then
819 break
820 fi
821 FINISHED=1
822 cd $BASEDIR/lfs
823 for i in *; do
824 if [ -f "$i" -a "$i" != "Config" ]; then
e22c7973 825 echo -ne "Loading $i"
df5e82b3
MT
826 make -s -f $i LFS_BASEDIR=$BASEDIR MESSAGE="$i\t ($c/$MAX_RETRIES)" download >> $LOGFILE 2>&1
827 if [ $? -ne 0 ]; then
e22c7973 828 beautify message FAIL
df5e82b3
MT
829 FINISHED=0
830 else
831 if [ $c -eq 1 ]; then
e22c7973 832 beautify message DONE
df5e82b3
MT
833 fi
834 fi
835 fi
836 done
837 done
e22c7973 838 echo -e "${BOLD}***Verifying md5sums${NORMAL}"
df5e82b3
MT
839 ERROR=0
840 for i in *; do
841 if [ -f "$i" -a "$i" != "Config" ]; then
842 make -s -f $i LFS_BASEDIR=$BASEDIR MESSAGE="$i\t " md5 >> $LOGFILE 2>&1
843 if [ $? -ne 0 ]; then
e22c7973
MT
844 echo -ne "MD5 difference in lfs/$i"
845 beautify message FAIL
df5e82b3
MT
846 ERROR=1
847 fi
848 fi
849 done
850 if [ $ERROR -eq 0 ]; then
e22c7973
MT
851 echo -ne "${BOLD}all files md5sum match${NORMAL}"
852 beautify message DONE
853 else
854 echo -ne "${BOLD}not all files were correctly download${NORMAL}"
855 beautify message FAIL
df5e82b3 856 fi
e22c7973 857 cd - >/dev/null 2>&1
df5e82b3 858 ;;
df5e82b3 859toolchain)
9729e787 860 clear
df5e82b3 861 prepareenv
15679d9f 862 beautify build_stage "Toolchain compilation - Native GCC: `gcc --version | grep GCC | awk {'print $3'}`"
df5e82b3
MT
863 buildtoolchain
864 BUILDMACHINE=`uname -m`
865 echo "`date -u '+%b %e %T'`: Create toolchain tar.gz for $BUILDMACHINE" | tee -a $LOGFILE
712d859c
MT
866 test -d $BASEDIR/cache/toolchains || mkdir $BASEDIR/cache/toolchains
867 cd $BASEDIR && tar -zc --exclude='log/_build.*.log' -f cache/toolchains/$SNAME-$VERSION-toolchain-$BUILDMACHINE.tar.gz \
df5e82b3
MT
868 build/{bin,etc,usr/bin,usr/local} \
869 build/tools/{bin,etc,*-linux-gnu,include,lib,libexec,sbin,share,var} \
870 log >> $LOGFILE
712d859c
MT
871 md5sum cache/toolchains/$SNAME-$VERSION-toolchain-$BUILDMACHINE.tar.gz \
872 > cache/toolchains/$SNAME-$VERSION-toolchain-$BUILDMACHINE.md5
df5e82b3
MT
873 stdumount
874 ;;
875gettoolchain)
876 BUILDMACHINE=`uname -m`
877 # arbitrary name to be updated in case of new toolchain package upload
c6cb9d25 878 PACKAGE=$SNAME-$VERSION-toolchain-$BUILDMACHINE
712d859c
MT
879 if [ ! -f $BASEDIR/cache/toolchains/$PACKAGE.tar.gz ]; then
880 URL_IPFIRE=`grep URL_IPFIRE lfs/Config | awk '{ print $3 }'`
881 test -d $BASEDIR/cache/toolchains || mkdir $BASEDIR/cache/toolchains
882 echo "`date -u '+%b %e %T'`: Load toolchain tar.gz for $BUILDMACHINE" | tee -a $LOGFILE
883 cd $BASEDIR/cache/toolchains
884 wget $URL_IPFIRE/toolchains/$PACKAGE.tar.gz $URL_IPFIRE/toolchains/$PACKAGE.md5 >& /dev/null
885 if [ $? -ne 0 ]; then
886 echo "`date -u '+%b %e %T'`: error downloading toolchain for $BUILDMACHINE machine" | tee -a $LOGFILE
40a4ea4c 887 else
712d859c
MT
888 if [ "`md5sum $PACKAGE.tar.gz | awk '{print $1}'`" = "`cat $PACKAGE.md5 | awk '{print $1}'`" ]; then
889 echo "`date -u '+%b %e %T'`: toolchain md5 ok" | tee -a $LOGFILE
890 else
891 exiterror "$PACKAGE.md5 did not match, check downloaded package"
892 fi
40a4ea4c 893 fi
712d859c
MT
894 else
895 echo "Toolchain is already downloaded. Exiting..."
df5e82b3
MT
896 fi
897 ;;
15679d9f 898othersrc)
ce56e927 899 prepareenv
15679d9f 900 echo -ne "`date -u '+%b %e %T'`: Build sources iso for $MACHINE" | tee -a $LOGFILE
ce56e927
MT
901 chroot $LFS /tools/bin/env -i HOME=/root \
902 TERM=$TERM PS1='\u:\w\$ ' \
903 PATH=/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin \
904 VERSION=$VERSION NAME="$NAME" SNAME="$SNAME" MACHINE=$MACHINE \
905 /bin/bash -x -c "cd /usr/src/lfs && make -f sources-iso LFS_BASEDIR=/usr/src install" >>$LOGFILE 2>&1
906 mv $LFS/install/images/ipfire-* $BASEDIR >> $LOGFILE 2>&1
15679d9f
MT
907 if [ $? -eq "0" ]; then
908 beautify message DONE
909 else
910 beautify message FAIL
911 fi
ce56e927
MT
912 stdumount
913 ;;
c6cb9d25
MT
914svn)
915 case "$2" in
916 update|up)
cc0e56be 917 # clear
15679d9f 918 echo -ne "Loading the latest source files...\n"
7471f6ab
MT
919 if [ $3 ]; then
920 svn update -r $3 | tee -a $PWD/log/_build.svn.update.log
921 else
922 svn update | tee -a $PWD/log/_build.svn.update.log
923 fi
15679d9f
MT
924 if [ $? -eq "0" ]; then
925 beautify message DONE
c6cb9d25 926 else
15679d9f 927 beautify message FAIL
c6cb9d25
MT
928 exit 1
929 fi
15679d9f 930 echo -ne "Writing the svn-info to a file"
c6cb9d25 931 svn info > $PWD/svn_status
15679d9f
MT
932 if [ $? -eq "0" ]; then
933 beautify message DONE
c6cb9d25 934 else
15679d9f 935 beautify message FAIL
c6cb9d25
MT
936 exit 1
937 fi
712d859c 938 chmod 755 $0
cc0e56be 939 exit 0
c6cb9d25
MT
940 ;;
941 commit|ci)
942 clear
d79b46cb 943 if [ -e /sbin/yast ]; then
028698e8
MT
944 if [ "`echo $SVN_REVISION | cut -c 3`" -eq "0" ]; then
945 $0 changelog
946 fi
d79b46cb
MT
947 fi
948 echo "Upload the changed files..."
c6cb9d25 949 sleep 1
15679d9f 950 svn commit
c6cb9d25
MT
951 $0 svn up
952 ;;
953 dist)
7471f6ab
MT
954 if [ $3 ]; then
955 SVN_REVISION=$3
956 fi
957 if [ -f ipfire-source-r$SVN_REVISION.tar.gz ]; then
958 echo -ne "REV $SVN_REVISION: SKIPPED!\n"
959 exit 0
960 fi
961 echo -en "REV $SVN_REVISION: Downloading..."
9729e787
MT
962 svn export http://svn.ipfire.eu/svn/ipfire/trunk ipfire-source/ --force > /dev/null
963 svn log http://svn.ipfire.eu/svn/ipfire/trunk -r 1:$SVN_REVISION > ipfire-source/Changelog
964 #svn info http://svn.ipfire.eu/svn/ipfire/trunk -r $SVN_REVISION > ipfire-source/svn_status
15679d9f
MT
965 evaluate 1
966
7471f6ab
MT
967 echo -en "REV $SVN_REVISION: Compressing files..."
968 if [ -e ipfire-source/trunk/make.sh ]; then
969 chmod 755 ipfire-source/trunk/make.sh
970 fi
9dc02b38 971 tar cfz ipfire-source-r$SVN_REVISION.tar.gz ipfire-source
15679d9f 972 evaluate 1
7471f6ab 973 echo -en "REV $SVN_REVISION: Cleaning up..."
c6cb9d25 974 rm ipfire-source/ -r
15679d9f 975 evaluate 1
7471f6ab 976 ;;
028698e8 977 diff|di)
15679d9f 978 echo -ne "Make a local diff to last svn revision"
c6cb9d25 979 svn diff > ipfire-diff-`date +'%Y-%m-%d-%H:%M'`-r`svn info | grep Revision | cut -c 11-`.diff
15679d9f 980 evaluate 1
c6cb9d25
MT
981 echo "Diff was successfully saved to ipfire-diff-`date +'%Y-%m-%d-%H:%M'`-r`svn info | grep Revision | cut -c 11-`.diff"
982 ;;
983 esac
f9315063 984 ;;
15679d9f
MT
985uploadsrc)
986 PWD=`pwd`
987 cd $BASEDIR/cache/
988 echo -e "Uploading cache to ftp server:"
989 ncftpls -u $IPFIRE_FTP_USER_INT -p $IPFIRE_FTP_PASS_INT ftp://$IPFIRE_FTP_URL_INT$IPFIRE_FTP_PATH_INT/ > /var/tmp/ftplist
990 for i in *; do
991 grep -q $i /var/tmp/ftplist
0eab8e84 992 if [ "$?" -ne "0" ]; then
15679d9f
MT
993 echo -ne "$i"
994 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 995 if [ "$?" -eq "0" ]; then
15679d9f 996 beautify message DONE
0eab8e84 997 else
15679d9f 998 beautify message FAIL
0eab8e84
MT
999 fi
1000 fi
1001 done
15679d9f
MT
1002 rm -f /var/tmp/ftplist
1003 UL_TIME_START=`date +'%s'`
1004 ncftpbatch -d > /dev/null 2>&1
1005 while ps acx | grep -q ncftpbatch
1006 do
1007 UL_TIME=$(expr `date +'%s'` - $UL_TIME_START)
1008 echo -ne "\r ${UL_TIME}s : Upload is running..."
1009 sleep 1
1010 done
1011 beautify message DONE
1012 cd $PWD
1013 exit 0
0eab8e84 1014 ;;
cc0e56be
MT
1015upload)
1016 case "$2" in
1017 iso)
1018 echo -e "Uploading the iso to $IPFIRE_FTP_URL_EXT."
9dc02b38
MT
1019 cat <<EOF > .ftp-commands
1020mkdir $IPFIRE_FTP_PATH_EXT
1021ls -lah
1022quit
1023EOF
1024 ncftp -u $IPFIRE_FTP_USER_EXT -p $IPFIRE_FTP_PASS_EXT $IPFIRE_FTP_URL_EXT < .ftp-commands
1025 rm -f .ftp-commands
1026 md5sum ipfire-install-$VERSION.i386.iso > ipfire-install-$VERSION.i386.iso.md5
1027 ncftpput -u $IPFIRE_FTP_USER_EXT -p $IPFIRE_FTP_PASS_EXT $IPFIRE_FTP_URL_EXT $IPFIRE_FTP_PATH_EXT/ ipfire-install-$VERSION.i386.iso
1028 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
1029 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 1030 ncftpput -u $IPFIRE_FTP_USER_EXT -p $IPFIRE_FTP_PASS_EXT $IPFIRE_FTP_URL_EXT $IPFIRE_FTP_PATH_EXT/ svn_status
9dc02b38
MT
1031 if [ "$?" -eq "0" ]; then
1032 echo -e "The iso of Revision $SVN_REVISION was successfully uploaded to $IPFIRE_FTP_URL_EXT$IPFIRE_FTP_PATH_EXT/."
cc0e56be 1033 else
9dc02b38
MT
1034 echo -e "There was an error while uploading the iso to the ftp server."
1035 exit 1
cc0e56be 1036 fi
6aae8d61
MT
1037 if [ "$3" = "--with-sources-cd" ]; then
1038 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
1039 fi
cc0e56be
MT
1040 ;;
1041 paks)
9dc02b38
MT
1042 cat <<EOF > .ftp-commands
1043mkdir $IPFIRE_FTP_PATH_PAK
1044ls -lah
1045quit
1046EOF
1047 ncftp -u $IPFIRE_FTP_USER_PAK -p $IPFIRE_FTP_PASS_PAK $IPFIRE_FTP_URL_PAK < .ftp-commands
1048 rm -f .ftp-commands
cc0e56be
MT
1049 ncftpput -z -u $IPFIRE_FTP_USER_PAK -p $IPFIRE_FTP_PASS_PAK $IPFIRE_FTP_URL_PAK $IPFIRE_FTP_PATH_PAK/ packages/*
1050 if [ "$?" -eq "0" ]; then
9dc02b38 1051 echo -e "The packages were successfully uploaded to $IPFIRE_FTP_URL_PAK$IPFIRE_FTP_PATH_PAK/."
cc0e56be
MT
1052 else
1053 echo -e "There was an error while uploading the packages to the ftp server."
712d859c 1054 exit 1
cc0e56be
MT
1055 fi
1056 ;;
1057 esac
0d0521b6 1058 ;;
cc0e56be 1059batch)
15679d9f
MT
1060 if [ "$2" -eq "--background" ]; then
1061 batch_script
1062 exit $?
1063 fi
27ac55bf 1064 if [ `screen -ls | grep -q ipfire` ]; then
712d859c
MT
1065 echo "Build is already running, sorry!"
1066 exit 1
1067 else
27ac55bf
MT
1068 if [ "$2" = "--rebuild" ]; then
1069 export IPFIRE_REBUILD=1
1070 echo "REBUILD!"
1071 else
1072 export IPFIRE_REBUILD=0
1073 fi
15679d9f
MT
1074 echo -en "${BOLD}***IPFire-Batch-Build is starting...${NORMAL}"
1075 screen -dmS ipfire $0 batch --background
1076 evaluate 1
712d859c
MT
1077 exit 0
1078 fi
cc0e56be 1079 ;;
028698e8 1080watch)
15679d9f 1081 watch_screen
028698e8 1082 ;;
df5e82b3 1083*)
24a4a744
MT
1084 clear
1085 svn info
712d859c 1086 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
1087 do
1088 case $name in
c6cb9d25
MT
1089 "IPFIRE: Prefetch")
1090 $0 prefetch
1091 ;;
1092 "IPFIRE: Build (silent)")
1093 $0 build-silent
1094 ;;
1095 "IPFIRE: Watch Build")
028698e8 1096 $0 watch
c6cb9d25 1097 ;;
712d859c
MT
1098 "IPFIRE: Batch")
1099 $0 batch
1100 ;;
c6cb9d25
MT
1101 "IPFIRE: Clean")
1102 $0 clean
1103 ;;
1104 "SVN: Commit")
15679d9f 1105 if [ -f /usr/bin/mcedit ]; then
9b0ff0a0
MT
1106 export EDITOR=/usr/bin/mcedit
1107 fi
1108 if [ -f /usr/bin/nano ]; then
1109 export EDITOR=/usr/bin/nano
d63e8889 1110 fi
15679d9f
MT
1111 $0 svn commit
1112 $0 uploadsrc
c6cb9d25
MT
1113 ;;
1114 "SVN: Update")
1115 $0 svn update
1116 ;;
1117 "SVN: Status")
1118 svn status # | grep -v ^?
1119 ;;
1120 "SVN: Diff")
1121 $0 svn diff
1122 ;;
1123 "Help")
9b0ff0a0 1124 echo "Usage: $0 {build|changelog|clean|gettoolchain|newpak|prefetch|shell|sync|toolchain}"
c6cb9d25
MT
1125 cat doc/make.sh-usage
1126 ;;
712d859c
MT
1127 "LOG: Tail")
1128 tail -f log/_*
1129 ;;
c6cb9d25
MT
1130 "Exit")
1131 break
1132 ;;
24a4a744
MT
1133 esac
1134 done
df5e82b3 1135 ;;
3ea75603 1136esac