]>
Commit | Line | Data |
---|---|---|
1 | #!/bin/bash | |
2 | ############################################################################ | |
3 | # # | |
4 | # This file is part of the IPFire Firewall. # | |
5 | # # | |
6 | # IPFire is free software; you can redistribute it and/or modify # | |
7 | # it under the terms of the GNU General Public License as published by # | |
8 | # the Free Software Foundation; either version 2 of the License, or # | |
9 | # (at your option) any later version. # | |
10 | # # | |
11 | # IPFire is distributed in the hope that it will be useful, # | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # | |
14 | # GNU General Public License for more details. # | |
15 | # # | |
16 | # You should have received a copy of the GNU General Public License # | |
17 | # along with IPFire; if not, write to the Free Software # | |
18 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # | |
19 | # # | |
20 | # Copyright (C) 2006 IPFire-Team <info@ipfire.eu>. # | |
21 | # # | |
22 | ############################################################################ | |
23 | # | |
24 | ||
25 | NAME="IPFire" # Software name | |
26 | SNAME="ipfire" # Short name | |
27 | VERSION="2.0" # Version number | |
28 | SLOGAN="www.ipfire.eu" # Software slogan | |
29 | CONFIG_ROOT=/var/ipfire # Configuration rootdir | |
30 | NICE=10 # Nice level | |
31 | MAX_RETRIES=3 # prefetch/check loop | |
32 | KVER=`grep --max-count=1 VER lfs/linux | awk '{ print $3 }'` | |
33 | MACHINE=`uname -m` | |
34 | SVN_REVISION=`svn info | grep Revision | cut -c 11-` | |
35 | ||
36 | # Setzen des IPFire Builds | |
37 | if [ -e ./.svn ]; then | |
38 | FIREBUILD=`cat .svn/entries |sed -n 's/^[ \t]*revision=\"// p' | sed -n 's/\".*$// p'` | |
39 | fi | |
40 | ||
41 | # Debian specific settings | |
42 | if [ ! -e /etc/debian_version ]; then | |
43 | FULLPATH=`which $0` | |
44 | else | |
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 | |
51 | fi | |
52 | ||
53 | PWD=`pwd` | |
54 | BASENAME=`basename $0` | |
55 | BASEDIR=`echo $FULLPATH | sed "s/\/$BASENAME//g"` | |
56 | LOGFILE=$BASEDIR/log/_build.preparation.log | |
57 | export BASEDIR LOGFILE | |
58 | DIR_CHK=$BASEDIR/cache/check | |
59 | mkdir $BASEDIR/log/ 2>/dev/null | |
60 | ||
61 | # Include funtions | |
62 | . tools/make-functions | |
63 | ||
64 | if [ -f .config ]; then | |
65 | . .config | |
66 | else | |
67 | make_config | |
68 | fi | |
69 | ||
70 | prepareenv() { | |
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 | ############################################################################ | |
98 | echo -ne "`date -u '+%b %e %T'`: Resetting our nice level to $NICE" | tee -a $LOGFILE | |
99 | renice $NICE $$ > /dev/null | |
100 | if [ `nice` != "$NICE" ]; then | |
101 | beautify message FAIL | |
102 | exiterror "Failed to set correct nice level" | |
103 | else | |
104 | beautify message DONE | |
105 | fi | |
106 | ||
107 | ||
108 | ############################################################################ | |
109 | # # | |
110 | # Checking if running as root user # | |
111 | # # | |
112 | ############################################################################ | |
113 | echo -ne "`date -u '+%b %e %T'`: Checking if we're running as root user" | tee -a $LOGFILE | |
114 | if [ `id -u` != 0 ]; then | |
115 | beautify message FAIL | |
116 | exiterror "Not building as root" | |
117 | else | |
118 | beautify message DONE | |
119 | fi | |
120 | ||
121 | ||
122 | ############################################################################ | |
123 | # # | |
124 | # Checking for necessary temporary space # | |
125 | # # | |
126 | ############################################################################ | |
127 | echo -ne "`date -u '+%b %e %T'`: Checking for necessary space on disk $BASE_DEV" | tee -a $LOGFILE | |
128 | BASE_DEV=`df -P -k $BASEDIR | tail -n 1 | awk '{ print $1 }'` | |
129 | BASE_ASPACE=`df -P -k $BASEDIR | tail -n 1 | awk '{ print $4 }'` | |
130 | if (( 2202000 > $BASE_ASPACE )); then | |
131 | BASE_USPACE=`du -skx $BASEDIR | awk '{print $1}'` | |
132 | if (( 2202000 - $BASE_USPACE > $BASE_ASPACE )); then | |
133 | beautify message FAIL | |
134 | exiterror "Not enough temporary space available, need at least 2.1GB on $BASE_DEV" | |
135 | fi | |
136 | else | |
137 | beautify message DONE | |
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 | |
167 | MAKETUNING="-j8" | |
168 | export LFS LC_ALL CFLAGS CXXFLAGS MAKETUNING | |
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 | ||
197 | buildtoolchain() { | |
198 | LOGFILE="$BASEDIR/log/_build.toolchain.log" | |
199 | export LOGFILE | |
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 | |
204 | lfsmake1 binutils PASS=1 | |
205 | lfsmake1 gcc PASS=1 | |
206 | export PATH=$BASEDIR/build/usr/local/bin:$BASEDIR/build/tools/bin:$PATH | |
207 | lfsmake1 linux-libc-header | |
208 | lfsmake1 glibc | |
209 | lfsmake1 tcl | |
210 | lfsmake1 expect | |
211 | lfsmake1 dejagnu | |
212 | lfsmake1 gcc PASS=2 | |
213 | lfsmake1 binutils PASS=2 | |
214 | lfsmake1 ncurses | |
215 | lfsmake1 bash | |
216 | lfsmake1 bzip2 | |
217 | lfsmake1 coreutils | |
218 | lfsmake1 diffutils | |
219 | lfsmake1 findutils | |
220 | lfsmake1 gawk | |
221 | lfsmake1 gettext | |
222 | lfsmake1 grep | |
223 | lfsmake1 gzip | |
224 | lfsmake1 m4 | |
225 | lfsmake1 make | |
226 | lfsmake1 patch | |
227 | lfsmake1 perl | |
228 | lfsmake1 sed | |
229 | lfsmake1 tar | |
230 | lfsmake1 texinfo | |
231 | lfsmake1 util-linux | |
232 | lfsmake1 cleanup-toolchain | |
233 | export PATH=$ORG_PATH | |
234 | } | |
235 | ||
236 | buildbase() { | |
237 | LOGFILE="$BASEDIR/log/_build.base.log" | |
238 | export LOGFILE | |
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 | |
276 | lfsmake2 grub | |
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 | ||
292 | buildipfire() { | |
293 | LOGFILE="$BASEDIR/log/_build.ipfire.log" | |
294 | export LOGFILE | |
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 | |
517 | } | |
518 | ||
519 | buildinstaller() { | |
520 | # Run installer scripts one by one | |
521 | LOGFILE="$BASEDIR/log/_build.installer.log" | |
522 | export LOGFILE | |
523 | ipfiremake syslinux | |
524 | ipfiremake as86 | |
525 | ipfiremake mbr | |
526 | ipfiremake uClibc | |
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 | ||
544 | buildpackages() { | |
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' \ | |
553 | -exec $LFS/tools/bin/strip --strip-all {} \; >> $LOGFILE 2>&1 | |
554 | # add -ls before -exec if you want to verify what files are stripped | |
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 | |
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 | |
582 | echo "* `basename $i`" >>$BASEDIR/doc/packages-list | |
583 | fi | |
584 | done | |
585 | echo "== List of softwares used to build $NAME Version: $VERSION ==" > $BASEDIR/doc/packages-list.txt | |
586 | grep -v 'configroot$\|img$\|initrd$\|initscripts$\|installer$\|install$\|ipfire$\|setup$\|pakfire$\|stage2$\|smp$\|tools$\|tools1$\|tools2$\|.tgz$\|-config$' \ | |
587 | $BASEDIR/doc/packages-list | sort >> $BASEDIR/doc/packages-list.txt | |
588 | rm -f $BASEDIR/doc/packages-list | |
589 | # packages-list.txt is ready to be displayed for wiki page | |
590 | ||
591 | # Create ISO for CDROM | |
592 | ipfiremake cdrom | |
593 | rm -f $LFS/install/images/*usb* | |
594 | cp $LFS/install/images/{*.iso,*.tgz} $BASEDIR >> $LOGFILE 2>&1 | |
595 | ||
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 | |
613 | cd $BASEDIR/packages; ls -w1 *.ipfire | awk -F ".ipfire" '{ print $1 }' > $BASEDIR/packages/packages_list.txt | |
614 | echo -n "###EOF###" >> $BASEDIR/packages/packages_list.txt | |
615 | ||
616 | cd $PWD | |
617 | ||
618 | } | |
619 | ||
620 | ipfirepackages() { | |
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 | |
626 | # ipfiredist amavisd | |
627 | ipfiredist applejuice | |
628 | ipfiredist asterisk | |
629 | ipfiredist clamav | |
630 | ipfiredist cups | |
631 | ipfiredist cyrusimap | |
632 | ipfiredist fetchmail | |
633 | ipfiredist ffmpeg | |
634 | ipfiredist gnump3d | |
635 | ipfiredist iptraf | |
636 | ipfiredist java | |
637 | ipfiredist lame | |
638 | ipfiredist libmad | |
639 | ipfiredist libogg | |
640 | ipfiredist libtiff | |
641 | ipfiredist libvorbis | |
642 | ipfiredist mailx | |
643 | ipfiredist mldonkey | |
644 | ipfiredist mpeg2dec | |
645 | ipfiredist nagios | |
646 | ipfiredist nfs | |
647 | ipfiredist nmap | |
648 | ipfiredist ntop | |
649 | ipfiredist portmap | |
650 | ipfiredist postfix | |
651 | ipfiredist procmail | |
652 | ipfiredist samba | |
653 | ipfiredist sox | |
654 | ipfiredist spamassassin | |
655 | ipfiredist subversion | |
656 | ipfiredist videolan | |
657 | ipfiredist webcyradm | |
658 | ipfiredist xvid | |
659 | ipfiredist yasuc | |
660 | test -d $BASEDIR/packages || mkdir $BASEDIR/packages | |
661 | mv -f $LFS/install/packages/*.{ipfire,md5} $BASEDIR/packages >> $LOGFILE 2>&1 | |
662 | rm -rf $BASEDIR/build/install/packages/* | |
663 | } | |
664 | ||
665 | # See what we're supposed to do | |
666 | case "$1" in | |
667 | build) | |
668 | BUILDMACHINE=`uname -m` | |
669 | PACKAGE=`ls -v -r $BASEDIR/cache/toolchains/$SNAME-$VERSION-toolchain-$BUILDMACHINE.tar.gz 2> /dev/null | head -n 1` | |
670 | #only restore on a clean disk | |
671 | if [ ! -f log/cleanup-toolchain-tools ]; then | |
672 | if [ ! -n "$PACKAGE" ]; then | |
673 | beautify build_stage "Full toolchain compilation - Native GCC: `gcc --version | grep GCC | awk {'print $3'}`" | |
674 | prepareenv | |
675 | buildtoolchain | |
676 | else | |
677 | PACKAGENAME=${PACKAGE%.tar.gz} | |
678 | beautify build_stage "Packaged toolchain compilation" | |
679 | if [ `md5sum $PACKAGE | awk '{print $1}'` == `cat $PACKAGENAME.md5 | awk '{print $1}'` ]; then | |
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 | |
690 | ||
691 | beautify build_stage "Building base" | |
692 | buildbase | |
693 | ||
694 | beautify build_stage "Building IPFire" | |
695 | buildipfire | |
696 | ||
697 | # Setzen des IPFire Builds | |
698 | if [ "$FIREBUILD" ]; then | |
699 | echo "$FIREBUILD" > $BASEDIR/build/var/ipfire/firebuild | |
700 | else | |
701 | echo "_(OvO)_" > $BASEDIR/build/var/ipfire/firebuild | |
702 | fi | |
703 | ||
704 | beautify build_stage "Building installer" | |
705 | buildinstaller | |
706 | ||
707 | beautify build_stage "Building packages" | |
708 | buildpackages | |
709 | ;; | |
710 | shell) | |
711 | # enter a shell inside LFS chroot | |
712 | # may be used to changed kernel settings | |
713 | prepareenv | |
714 | entershell | |
715 | ;; | |
716 | changelog) | |
717 | echo -n "Loading new Changelog from SVN: " | |
718 | svn log http://svn.ipfire.eu/svn/ipfire > doc/ChangeLog | |
719 | echo "Finished!" | |
720 | ;; | |
721 | clean) | |
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 | |
737 | rm -rf $BASEDIR/packages | |
738 | rm -rf $BASEDIR/log | |
739 | if [ -h /tools ]; then | |
740 | rm -f /tools | |
741 | fi | |
742 | ;; | |
743 | newpak) | |
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 | |
750 | echo "`date -u '+%b %e %T'`: Creating files" | |
751 | cp $BASEDIR/lfs/postfix $BASEDIR/lfs/$2 | |
752 | ||
753 | touch ROOTFILES | |
754 | touch {,un}install.sh | |
755 | ## install.sh | |
756 | echo '#!/bin/bash' > install.sh | |
757 | echo '#' >> install.sh | |
758 | echo '#################################################################' >> install.sh | |
759 | echo '# #' >> install.sh | |
760 | echo '# This file belongs to IPFire Firewall - GPLv2 - www.ipfire.org #' >> install.sh | |
761 | echo '# #' >> install.sh | |
762 | echo '#################################################################' >> install.sh | |
763 | echo '#' >> install.sh | |
764 | echo '# Extract the files' >> install.sh | |
765 | echo 'tar xfz files.tgz -C /' >> install.sh | |
766 | echo 'cp -f ROOTFILES /opt/pakfire/installed/ROOTFILES.$2' >> install.sh | |
767 | ## uninstall.sh | |
768 | echo '#!/bin/bash' > uninstall.sh | |
769 | echo '#################################################################' >> uninstall.sh | |
770 | echo '# #' >> uninstall.sh | |
771 | echo '# This file belongs to IPFire Firewall - GPLv2 - www.ipfire.org #' >> uninstall.sh | |
772 | echo '# #' >> uninstall.sh | |
773 | echo '#################################################################' >> uninstall.sh | |
774 | echo '#' >> uninstall.sh | |
775 | echo '# Delete the files' >> uninstall.sh | |
776 | echo '## Befehl fehlt noch' >> uninstall.sh | |
777 | echo 'rm -f /opt/pakfire/installed/ROOTFILES.$2' >> uninstall.sh | |
778 | echo "`date -u '+%b %e %T'`: Adding files to SVN" | |
779 | cd - && svn add lfs/$2 && svn add src/paks/$2 | |
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 | |
789 | else | |
790 | echo "$2 already exists" | |
791 | fi | |
792 | exit 0 | |
793 | ;; | |
794 | prefetch) | |
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 | ;; | |
838 | toolchain) | |
839 | prepareenv | |
840 | beautify build_stage "Toolchain compilation - Native GCC: `gcc --version | grep GCC | awk {'print $3'}`" | |
841 | buildtoolchain | |
842 | BUILDMACHINE=`uname -m` | |
843 | echo "`date -u '+%b %e %T'`: Create toolchain tar.gz for $BUILDMACHINE" | tee -a $LOGFILE | |
844 | test -d $BASEDIR/cache/toolchains || mkdir $BASEDIR/cache/toolchains | |
845 | cd $BASEDIR && tar -zc --exclude='log/_build.*.log' -f cache/toolchains/$SNAME-$VERSION-toolchain-$BUILDMACHINE.tar.gz \ | |
846 | build/{bin,etc,usr/bin,usr/local} \ | |
847 | build/tools/{bin,etc,*-linux-gnu,include,lib,libexec,sbin,share,var} \ | |
848 | log >> $LOGFILE | |
849 | md5sum cache/toolchains/$SNAME-$VERSION-toolchain-$BUILDMACHINE.tar.gz \ | |
850 | > cache/toolchains/$SNAME-$VERSION-toolchain-$BUILDMACHINE.md5 | |
851 | stdumount | |
852 | ;; | |
853 | gettoolchain) | |
854 | BUILDMACHINE=`uname -m` | |
855 | # arbitrary name to be updated in case of new toolchain package upload | |
856 | PACKAGE=$SNAME-$VERSION-toolchain-$BUILDMACHINE | |
857 | if [ ! -f $BASEDIR/cache/toolchains/$PACKAGE.tar.gz ]; then | |
858 | URL_IPFIRE=`grep URL_IPFIRE lfs/Config | awk '{ print $3 }'` | |
859 | test -d $BASEDIR/cache/toolchains || mkdir $BASEDIR/cache/toolchains | |
860 | echo "`date -u '+%b %e %T'`: Load toolchain tar.gz for $BUILDMACHINE" | tee -a $LOGFILE | |
861 | cd $BASEDIR/cache/toolchains | |
862 | wget $URL_IPFIRE/toolchains/$PACKAGE.tar.gz $URL_IPFIRE/toolchains/$PACKAGE.md5 >& /dev/null | |
863 | if [ $? -ne 0 ]; then | |
864 | echo "`date -u '+%b %e %T'`: error downloading toolchain for $BUILDMACHINE machine" | tee -a $LOGFILE | |
865 | else | |
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 | |
871 | fi | |
872 | else | |
873 | echo "Toolchain is already downloaded. Exiting..." | |
874 | fi | |
875 | ;; | |
876 | othersrc) | |
877 | prepareenv | |
878 | echo -ne "`date -u '+%b %e %T'`: Build sources iso for $MACHINE" | tee -a $LOGFILE | |
879 | chroot $LFS /tools/bin/env -i HOME=/root \ | |
880 | TERM=$TERM PS1='\u:\w\$ ' \ | |
881 | PATH=/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin \ | |
882 | VERSION=$VERSION NAME="$NAME" SNAME="$SNAME" MACHINE=$MACHINE \ | |
883 | /bin/bash -x -c "cd /usr/src/lfs && make -f sources-iso LFS_BASEDIR=/usr/src install" >>$LOGFILE 2>&1 | |
884 | mv $LFS/install/images/ipfire-* $BASEDIR >> $LOGFILE 2>&1 | |
885 | if [ $? -eq "0" ]; then | |
886 | beautify message DONE | |
887 | else | |
888 | beautify message FAIL | |
889 | fi | |
890 | stdumount | |
891 | ;; | |
892 | svn) | |
893 | case "$2" in | |
894 | update|up) | |
895 | # clear | |
896 | echo -ne "Loading the latest source files...\n" | |
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 | |
902 | if [ $? -eq "0" ]; then | |
903 | beautify message DONE | |
904 | else | |
905 | beautify message FAIL | |
906 | exit 1 | |
907 | fi | |
908 | echo -ne "Writing the svn-info to a file" | |
909 | svn info > $PWD/svn_status | |
910 | if [ $? -eq "0" ]; then | |
911 | beautify message DONE | |
912 | else | |
913 | beautify message FAIL | |
914 | exit 1 | |
915 | fi | |
916 | chmod 755 $0 | |
917 | exit 0 | |
918 | ;; | |
919 | commit|ci) | |
920 | clear | |
921 | if [ -e /sbin/yast ]; then | |
922 | if [ "`echo $SVN_REVISION | cut -c 3`" -eq "0" ]; then | |
923 | $0 changelog | |
924 | fi | |
925 | fi | |
926 | echo "Upload the changed files..." | |
927 | sleep 1 | |
928 | svn commit | |
929 | $0 svn up | |
930 | ;; | |
931 | dist) | |
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..." | |
940 | svn export http://svn.ipfire.eu/svn/ipfire ipfire-source/ --force > /dev/null | |
941 | svn log http://svn.ipfire.eu/svn/ipfire -r 1:$SVN_REVISION > ipfire-source/Changelog | |
942 | #svn info http://svn.ipfire.eu/svn/ipfire -r $SVN_REVISION > ipfire-source/svn_status | |
943 | evaluate 1 | |
944 | ||
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 | |
949 | tar cfz ipfire-source-r$SVN_REVISION.tar.gz ipfire-source | |
950 | evaluate 1 | |
951 | echo -en "REV $SVN_REVISION: Cleaning up..." | |
952 | rm ipfire-source/ -r | |
953 | evaluate 1 | |
954 | ;; | |
955 | diff|di) | |
956 | echo -ne "Make a local diff to last svn revision" | |
957 | svn diff > ipfire-diff-`date +'%Y-%m-%d-%H:%M'`-r`svn info | grep Revision | cut -c 11-`.diff | |
958 | evaluate 1 | |
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 | |
962 | ;; | |
963 | uploadsrc) | |
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 | |
970 | if [ "$?" -ne "0" ]; then | |
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 | |
973 | if [ "$?" -eq "0" ]; then | |
974 | beautify message DONE | |
975 | else | |
976 | beautify message FAIL | |
977 | fi | |
978 | else | |
979 | echo -ne "$i" | |
980 | beautify message SKIP | |
981 | fi | |
982 | done | |
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 | |
995 | ;; | |
996 | upload) | |
997 | case "$2" in | |
998 | iso) | |
999 | echo -e "Uploading the iso to $IPFIRE_FTP_URL_EXT." | |
1000 | cat <<EOF > .ftp-commands | |
1001 | mkdir $IPFIRE_FTP_PATH_EXT | |
1002 | ls -lah | |
1003 | quit | |
1004 | EOF | |
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 | |
1011 | ncftpput -u $IPFIRE_FTP_USER_EXT -p $IPFIRE_FTP_PASS_EXT $IPFIRE_FTP_URL_EXT $IPFIRE_FTP_PATH_EXT/ svn_status | |
1012 | if [ "$?" -eq "0" ]; then | |
1013 | echo -e "The iso of Revision $SVN_REVISION was successfully uploaded to $IPFIRE_FTP_URL_EXT$IPFIRE_FTP_PATH_EXT/." | |
1014 | else | |
1015 | echo -e "There was an error while uploading the iso to the ftp server." | |
1016 | exit 1 | |
1017 | fi | |
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 | |
1021 | ;; | |
1022 | paks) | |
1023 | cat <<EOF > .ftp-commands | |
1024 | mkdir $IPFIRE_FTP_PATH_PAK | |
1025 | ls -lah | |
1026 | quit | |
1027 | EOF | |
1028 | ncftp -u $IPFIRE_FTP_USER_PAK -p $IPFIRE_FTP_PASS_PAK $IPFIRE_FTP_URL_PAK < .ftp-commands | |
1029 | rm -f .ftp-commands | |
1030 | ncftpput -z -u $IPFIRE_FTP_USER_PAK -p $IPFIRE_FTP_PASS_PAK $IPFIRE_FTP_URL_PAK $IPFIRE_FTP_PATH_PAK/ packages/* | |
1031 | if [ "$?" -eq "0" ]; then | |
1032 | echo -e "The packages were successfully uploaded to $IPFIRE_FTP_URL_PAK$IPFIRE_FTP_PATH_PAK/." | |
1033 | else | |
1034 | echo -e "There was an error while uploading the packages to the ftp server." | |
1035 | exit 1 | |
1036 | fi | |
1037 | ;; | |
1038 | esac | |
1039 | ;; | |
1040 | batch) | |
1041 | if [ "$2" -eq "--background" ]; then | |
1042 | batch_script | |
1043 | exit $? | |
1044 | fi | |
1045 | if [ `screen -ls | grep -q ipfire` ]; then | |
1046 | echo "Build is already running, sorry!" | |
1047 | exit 1 | |
1048 | else | |
1049 | if [ "$2" = "--rebuild" ]; then | |
1050 | export IPFIRE_REBUILD=1 | |
1051 | echo "REBUILD!" | |
1052 | else | |
1053 | export IPFIRE_REBUILD=0 | |
1054 | fi | |
1055 | echo -en "${BOLD}***IPFire-Batch-Build is starting...${NORMAL}" | |
1056 | screen -dmS ipfire $0 batch --background | |
1057 | evaluate 1 | |
1058 | exit 0 | |
1059 | fi | |
1060 | ;; | |
1061 | watch) | |
1062 | watch_screen | |
1063 | ;; | |
1064 | *) | |
1065 | clear | |
1066 | svn info | |
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" | |
1068 | do | |
1069 | case $name in | |
1070 | "IPFIRE: Prefetch") | |
1071 | $0 prefetch | |
1072 | ;; | |
1073 | "IPFIRE: Build (silent)") | |
1074 | $0 build-silent | |
1075 | ;; | |
1076 | "IPFIRE: Watch Build") | |
1077 | $0 watch | |
1078 | ;; | |
1079 | "IPFIRE: Batch") | |
1080 | $0 batch | |
1081 | ;; | |
1082 | "IPFIRE: Clean") | |
1083 | $0 clean | |
1084 | ;; | |
1085 | "SVN: Commit") | |
1086 | if [ -f /usr/bin/mcedit ]; then | |
1087 | export EDITOR=/usr/sbin/mcedit | |
1088 | fi | |
1089 | $0 svn commit | |
1090 | $0 uploadsrc | |
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 | ;; | |
1105 | "LOG: Tail") | |
1106 | tail -f log/_* | |
1107 | ;; | |
1108 | "Exit") | |
1109 | break | |
1110 | ;; | |
1111 | esac | |
1112 | done | |
1113 | ;; | |
1114 | esac |