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