Kleine Fixes an den Graphs und dem MenĂ¼!
[ipfire-2.x.git] / make.sh
CommitLineData
df5e82b3
MT
1#!/bin/bash
2#
3############################################################################
4# #
5# This file is part of the IPCop Firewall. #
6# #
7# IPCop is free software; you can redistribute it and/or modify #
8# it under the terms of the GNU General Public License as published by #
9# the Free Software Foundation; either version 2 of the License, or #
10# (at your option) any later version. #
11# #
12# IPCop is distributed in the hope that it will be useful, #
13# but WITHOUT ANY WARRANTY; without even the implied warranty of #
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15# GNU General Public License for more details. #
16# #
17# You should have received a copy of the GNU General Public License #
18# along with IPCop; if not, write to the Free Software #
19# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
20# #
21# Copyright (C) 2001 Mark Wormgoor <mark@wormgoor.com>. #
22# #
23# (c) 2001 Eric S. Johansson <esj@harvee.billerica.ma.us> Check for Bash #
24# (c) 2002 Thorsten Fischer <frosch@cs.tu-berlin.de> MD5Sum checking #
25# #
26############################################################################
27#
28# $Id: make.sh,v 1.129.2.145 2006/02/01 07:04:09 gespinasse Exp $
29#
30
94025eea 31 NAME="IPFire" # Software name
3ea75603 32 SNAME="ipfire" # Short name
df5e82b3 33 VERSION="1.4" # Version number
3ea75603
MT
34# PREVIOUSTAG=IPCOP_v1_4_10_FINAL
35 SLOGAN="We secure your network" # Software slogan
36 CONFIG_ROOT=/var/ipfire # Configuration rootdir
df5e82b3 37 NICE=10
94025eea 38 MAX_RETRIES=3 # prefetch/check loop
df5e82b3
MT
39 KVER=`grep --max-count=1 VER lfs/linux | awk '{ print $3 }'`
40 MACHINE=`uname -m`
41
42 # Debian specific settings
43 if [ ! -e /etc/debian_version ]; then
44 FULLPATH=`which $0`
45 else
46 if [ -x /usr/bin/realpath ]; then
47 FULLPATH=`/usr/bin/realpath $0`
48 else
49 echo "ERROR: Need to do apt-get install realpath"
50 exit 1
51 fi
52 fi
53
54
55 PWD=`pwd`
56 BASENAME=`basename $0`
57 BASEDIR=`echo $FULLPATH | sed "s/\/$BASENAME//g"`
58 LOGFILE=$BASEDIR/log/_build.preparation.log
59 export BASEDIR LOGFILE
60 DIR_CHK=$BASEDIR/cache/check
61 mkdir $BASEDIR/log/ 2>/dev/null
62
63 if [ 'x86_64' = $MACHINE -o 'i686' = $MACHINE -o 'i586' = $MACHINE -o 'i486' = $MACHINE -o 'i386' = $MACHINE ]; then
64 echo "`date -u '+%b %e %T'`: Machine is ix86 (or equivalent)" | tee -a $LOGFILE
65 MACHINE=i386
66 BUILDTARGET=i386-pc-linux-gnu
67 CFLAGS="-O2 -mcpu=i386 -march=i386 -pipe -fomit-frame-pointer"
68 CXXFLAGS="-O2 -mcpu=i386 -march=i386 -pipe -fomit-frame-pointer"
69 elif [ 'alpha' = $MACHINE ]; then
70 echo "`date -u '+%b %e %T'`: Machine is Alpha AXP" | tee -a $LOGFILE
71 BUILDTARGET=alpha-unknown-linux-gnu
72 CFLAGS="-O2 -mcpu=ev4 -mieee -pipe"
73 CXXFLAGS="-O2 -mcpu=ev4 -mieee -pipe"
74 else
75 echo "`date -u '+%b %e %T'`: Can't determine your architecture - $MACHINE" | tee -a $LOGFILE
76 exit 1
77 fi
78
79# Define immediately
80stdumount() {
81 umount $BASEDIR/build/dev/pts 2>/dev/null;
94025eea
MT
82 umount $BASEDIR/build/proc 2>/dev/null;
83 umount $BASEDIR/build/install/mnt 2>/dev/null;
df5e82b3
MT
84 umount $BASEDIR/build/usr/src/cache 2>/dev/null;
85 umount $BASEDIR/build/usr/src/ccache 2>/dev/null;
86 umount $BASEDIR/build/usr/src/config 2>/dev/null;
94025eea
MT
87 umount $BASEDIR/build/usr/src/doc 2>/dev/null;
88 umount $BASEDIR/build/usr/src/html 2>/dev/null;
df5e82b3 89 umount $BASEDIR/build/usr/src/langs 2>/dev/null;
94025eea
MT
90 umount $BASEDIR/build/usr/src/lfs 2>/dev/null;
91 umount $BASEDIR/build/usr/src/log 2>/dev/null;
92 umount $BASEDIR/build/usr/src/src 2>/dev/null;
df5e82b3
MT
93}
94
95exiterror() {
96 stdumount
97 for i in `seq 0 7`; do
98 if ( losetup /dev/loop${i} 2>/dev/null | grep -q "/install/images" ); then
99 losetup -d /dev/loop${i} 2>/dev/null
100 fi;
101 done
102 echo "ERROR: $*"
103 echo " Check $LOGFILE for errors if applicable"
104 exit 1
105}
106
107entershell() {
108 if [ ! -e $BASEDIR/build/usr/src/lfs/ ]; then
109 exiterror "No such file or directory: $BASEDIR/build/usr/src/lfs/"
110 fi
111 echo "Entering to a shell inside LFS chroot, go out with exit"
112 chroot $LFS /tools/bin/env -i HOME=/root TERM=$TERM PS1='\u:\w\$ ' \
113 PATH=/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
114 VERSION=$VERSION CONFIG_ROOT=$CONFIG_ROOT \
115 NAME="$NAME" SNAME="$SNAME" SLOGAN="$SLOGAN" \
116 CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" \
117 CCACHE_DIR=/usr/src/ccache \
118 CCACHE_HASHDIR=1 \
119 KVER=$KVER \
120 BUILDTARGET="$BUILDTARGET" MACHINE="$MACHINE" \
121 KGCC="ccache /usr/bin/gcc" \
122 /tools/bin/bash
123 if [ $? -ne 0 ]; then
124 exiterror "chroot error"
125 else
126 stdumount
127 fi
128}
129
130prepareenv() {
131 ############################################################################
132 # #
133 # Are we running the right shell? #
134 # #
135 ############################################################################
136 if [ ! "$BASH" ]; then
137 exiterror "BASH environment variable is not set. You're probably running the wrong shell."
138 fi
139
140 if [ -z "${BASH_VERSION}" ]; then
141 exiterror "Not running BASH shell."
142 fi
143
144
145 ############################################################################
146 # #
147 # Trap on emergency exit #
148 # #
149 ############################################################################
150 trap "exiterror 'Build process interrupted'" SIGINT SIGTERM SIGKILL SIGSTOP SIGQUIT
151
152
153 ############################################################################
154 # #
155 # Resetting our nice level #
156 # #
157 ############################################################################
158 echo "`date -u '+%b %e %T'`: Resetting our nice level to $NICE" | tee -a $LOGFILE
159 renice $NICE $$ > /dev/null
160 if [ `nice` != "$NICE" ]; then
161 exiterror "Failed to set correct nice level"
162 fi
163
164 ############################################################################
165 # #
166 # Checking if running as root user #
167 # #
168 ############################################################################
169 echo "`date -u '+%b %e %T'`: Checking if we're running as root user" | tee -a $LOGFILE
170 if [ `id -u` != 0 ]; then
171 exiterror "Not building as root"
172 fi
173
174
175 ############################################################################
176 # #
177 # Checking for necessary temporary space #
178 # #
179 ############################################################################
180 echo "`date -u '+%b %e %T'`: Checking for necessary space on disk $BASE_DEV" | tee -a $LOGFILE
181 BASE_DEV=`df -P -k $BASEDIR | tail -n 1 | awk '{ print $1 }'`
182 BASE_ASPACE=`df -P -k $BASEDIR | tail -n 1 | awk '{ print $4 }'`
183 if (( 2202000 > $BASE_ASPACE )); then
184 BASE_USPACE=`du -skx $BASEDIR | awk '{print $1}'`
185 if (( 2202000 - $BASE_USPACE > $BASE_ASPACE )); then
186 exiterror "Not enough temporary space available, need at least 2.1GB on $BASE_DEV"
187 fi
188 fi
189
190 ############################################################################
191 # #
192 # Building Linux From Scratch system #
193 # #
194 ############################################################################
195 echo "`date -u '+%b %e %T'`: Building Linux From Scratch system" | tee -a $LOGFILE
196
197 # Set umask
198 umask 022
199
200 # Set LFS Directory
201 LFS=$BASEDIR/build
202
203 # Check /tools symlink
204 if [ -h /tools ]; then
205 rm -f /tools
206 fi
207 if [ ! -a /tools ]; then
208 ln -s $BASEDIR/build/tools /
209 fi
210 if [ ! -h /tools ]; then
211 exiterror "Could not create /tools symbolic link."
212 fi
213
214 # Setup environment
215 set +h
216 LC_ALL=POSIX
217 export LFS LC_ALL CFLAGS CXXFLAGS
218 unset CC CXX CPP LD_LIBRARY_PATH LD_PRELOAD
219
220 # Make some extra directories
221 mkdir -p $BASEDIR/build/{tools,etc,usr/src} 2>/dev/null
222 mkdir -p $BASEDIR/{cache,ccache} 2>/dev/null
223 mkdir -p $BASEDIR/build/dev/pts $BASEDIR/build/proc $BASEDIR/build/usr/src/{cache,config,doc,html,langs,lfs,log,src,ccache}
224
225 # Make all sources and proc available under lfs build
226 mount --bind /dev/pts $BASEDIR/build/dev/pts
227 mount --bind /proc $BASEDIR/build/proc
228 mount --bind $BASEDIR/cache $BASEDIR/build/usr/src/cache
229 mount --bind $BASEDIR/ccache $BASEDIR/build/usr/src/ccache
230 mount --bind $BASEDIR/config $BASEDIR/build/usr/src/config
231 mount --bind $BASEDIR/doc $BASEDIR/build/usr/src/doc
232 mount --bind $BASEDIR/html $BASEDIR/build/usr/src/html
233 mount --bind $BASEDIR/langs $BASEDIR/build/usr/src/langs
234 mount --bind $BASEDIR/lfs $BASEDIR/build/usr/src/lfs
235 mount --bind $BASEDIR/log $BASEDIR/build/usr/src/log
236 mount --bind $BASEDIR/src $BASEDIR/build/usr/src/src
237
238 # Run LFS static binary creation scripts one by one
239 export CCACHE_DIR=$BASEDIR/ccache
240 export CCACHE_HASHDIR=1
241
242 # Remove pre-install list of installed files in case user erase some files before rebuild
243 rm -f $BASEDIR/build/usr/src/lsalr 2>/dev/null
244}
245
246
247############################################################################
248# #
249# Necessary shell functions #
250# #
251############################################################################
252lfsmake1() {
253 if [ -f $BASEDIR/lfs/$1 ]; then
254 echo "`date -u '+%b %e %T'`: Building $*" | tee -a $LOGFILE
255 cd $BASEDIR/lfs && make -s -f $* LFS_BASEDIR=$BASEDIR MESSAGE="$1\t " download >> $LOGFILE 2>&1
256 if [ $? -ne 0 ]; then
257 exiterror "Download error in $1"
258 fi
259 cd $BASEDIR/lfs && make -s -f $* LFS_BASEDIR=$BASEDIR MESSAGE="$1\t md5sum" md5 >> $LOGFILE 2>&1
260 if [ $? -ne 0 ]; then
261 exiterror "md5sum error in $1, check file in cache or signature"
262 fi
263 cd $BASEDIR/lfs && make -f $* BUILDTARGET=$BUILDTARGET \
264 MACHINE=$MACHINE \
265 LFS_BASEDIR=$BASEDIR \
266 ROOT=$LFS \
267 KVER=$KVER \
268 install >> $LOGFILE 2>&1
269 if [ $? -ne 0 ]; then
270 exiterror "Building $*";
271 fi
272 else
273 exiterror "No such file or directory: $BASEDIR/$1"
274 fi
275 return 0
276}
277
278lfsmake2() {
279 if [ -f $BASEDIR/build/usr/src/lfs/$1 ]; then
280 echo "`date -u '+%b %e %T'`: Building $*" | tee -a $LOGFILE
281 cd $BASEDIR/lfs && make -s -f $* LFS_BASEDIR=$BASEDIR MESSAGE="$1\t " download >> $LOGFILE 2>&1
282 if [ $? -ne 0 ]; then
283 exiterror "Download error in $1"
284 fi
285 cd $BASEDIR/lfs && make -s -f $* LFS_BASEDIR=$BASEDIR MESSAGE="$1\t md5sum" md5 >> $LOGFILE 2>&1
286 if [ $? -ne 0 ]; then
287 exiterror "md5sum error in $1, check file in cache or signature"
288 fi
289 chroot $LFS /tools/bin/env -i HOME=/root \
290 TERM=$TERM PS1='\u:\w\$ ' \
291 PATH=/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
292 VERSION=$VERSION \
293 CONFIG_ROOT=$CONFIG_ROOT \
294 NAME="$NAME" SNAME="$SNAME" SLOGAN="$SLOGAN" \
295 CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" \
296 CCACHE_DIR=/usr/src/ccache CCACHE_HASHDIR=1 \
297 KVER=$KVER \
298 BUILDTARGET="$BUILDTARGET" MACHINE="$MACHINE" \
299 /tools/bin/bash -x -c "cd /usr/src/lfs && \
300 make -f $* LFS_BASEDIR=/usr/src install" >>$LOGFILE 2>&1
301 if [ $? -ne 0 ]; then
302 exiterror "Building $*"
303 fi
304 else
305 exiterror "No such file or directory: $BASEDIR/build/usr/src/lfs/$1"
306 fi
307 return 0
308}
309
310ipcopmake() {
311 if [ -f $BASEDIR/build/usr/src/lfs/$1 ]; then
312 echo "`date -u '+%b %e %T'`: Building $*" | tee -a $LOGFILE
313 cd $BASEDIR/lfs && make -s -f $* LFS_BASEDIR=$BASEDIR MESSAGE="$1\t " download >> $LOGFILE 2>&1
314 if [ $? -ne 0 ]; then
315 exiterror "Download error in $1"
316 fi
317 cd $BASEDIR/lfs && make -s -f $* LFS_BASEDIR=$BASEDIR MESSAGE="$1\t md5sum" md5 >> $LOGFILE 2>&1
318 if [ $? -ne 0 ]; then
319 exiterror "md5sum error in $1, check file in cache or signature"
320 fi
321 chroot $LFS /tools/bin/env -i HOME=/root \
322 TERM=$TERM PS1='\u:\w\$ ' \
323 PATH=/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin \
324 VERSION=$VERSION \
325 CONFIG_ROOT=$CONFIG_ROOT \
326 NAME="$NAME" SNAME="$SNAME" SLOGAN="$SLOGAN" \
327 CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" \
328 CCACHE_DIR=/usr/src/ccache CCACHE_HASHDIR=1 \
329 KVER=$KVER \
330 BUILDTARGET="$BUILDTARGET" MACHINE="$MACHINE" \
331 /bin/bash -x -c "cd /usr/src/lfs && \
332 make -f $* LFS_BASEDIR=/usr/src install" >>$LOGFILE 2>&1
333 if [ $? -ne 0 ]; then
334 exiterror "Building $*"
335 fi
336 else
337 exiterror "No such file or directory: $BASEDIR/build/usr/src/lfs/$1"
338 fi
339 return 0
340}
341
e7164bb4
MT
342ipfiredist() {
343 if [ -f $BASEDIR/build/usr/src/lfs/$1 ]; then
344 echo "`date -u '+%b %e %T'`: Packaging $1" | tee -a $LOGFILE
345 cp -f $BASEDIR/src/scripts/make-packages.sh $BASEDIR/build/usr/sbin/
346 chroot $LFS /tools/bin/env -i HOME=/root \
347 TERM=$TERM PS1='\u:\w\$ ' \
348 PATH=/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin \
349 VERSION=$VERSION \
350 CONFIG_ROOT=$CONFIG_ROOT \
351 NAME="$NAME" SNAME="$SNAME" SLOGAN="$SLOGAN" \
352 CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" \
353 CCACHE_DIR=/usr/src/ccache CCACHE_HASHDIR=1 \
354 KVER=$KVER \
355 BUILDTARGET="$BUILDTARGET" MACHINE="$MACHINE" \
356 /bin/bash -x -c "cd /usr/src/lfs && \
357 make -f $1 LFS_BASEDIR=/usr/src dist" >>$LOGFILE 2>&1
358 if [ $? -ne 0 ]; then
359 exiterror "Packaging $1"
360 fi
361 else
362 exiterror "No such file or directory: $BASEDIR/build/usr/src/lfs/$1"
363 fi
364 if [ -e $BASEDIR/packages ]; then
365 mv -f $BASEDIR/build/paks/* $BASEDIR/packages/
366 else
367 mkdir -p $BASEDIR/packages
368 mv -f $BASEDIR/build/paks/* $BASEDIR/packages/
369 fi
370 return 0
371}
372
df5e82b3
MT
373
374installmake() {
375 if [ -f $BASEDIR/build/usr/src/lfs/$1 ]; then
376 echo "`date -u '+%b %e %T'`: Building $*" | tee -a $LOGFILE
377 cd $BASEDIR/lfs && make -s -f $* LFS_BASEDIR=$BASEDIR MESSAGE="$1\t " download >> $LOGFILE 2>&1
378 if [ $? -ne 0 ]; then
379 exiterror "Download error in $1"
380 fi
381 cd $BASEDIR/lfs && make -s -f $* LFS_BASEDIR=$BASEDIR MESSAGE="$1\t md5sum" md5 >> $LOGFILE 2>&1
382 if [ $? -ne 0 ]; then
383 exiterror "md5sum error in $1, check file in cache or signature"
384 fi
385 chroot $LFS /tools/bin/env -i HOME=/root \
386 TERM=$TERM PS1='\u:\w\$ ' \
387 PATH=/usr/local/bin:/opt/$MACHINE-uClibc/usr/bin:/bin:/usr/bin:/sbin:/usr/sbin \
388 VERSION=$VERSION \
389 CONFIG_ROOT=$CONFIG_ROOT \
390 LFS_PASS="install" \
391 NAME="$NAME" SNAME="$SNAME" SLOGAN="$SLOGAN" \
392 CFLAGS="-Os" CXXFLAGS="-Os" \
393 CCACHE_DIR=/usr/src/ccache CCACHE_HASHDIR=1 \
394 KVER=$KVER \
395 BUILDTARGET="$BUILDTARGET" MACHINE="$MACHINE" \
396 /bin/bash -x -c "cd /usr/src/lfs && \
397 make -f $* LFS_BASEDIR=/usr/src install" >>$LOGFILE 2>&1
398 if [ $? -ne 0 ]; then
399 exiterror "Building $*"
400 fi
401 else
402 exiterror "No such file or directory: $BASEDIR/build/usr/src/lfs/$1"
403 fi
404 return 0
405}
406
407buildtoolchain() {
408 LOGFILE="$BASEDIR/log/_build.toolchain.log"
409 export LOGFILE
410 echo -ne "`date -u '+%b %e %T'`: Stage1 toolchain build \n" | tee -a $LOGFILE
411 # Build sed now, as we use some extensions
412 ORG_PATH=$PATH
413 NATIVEGCC=`gcc --version | grep GCC | awk {'print $3'}`
414 export NATIVEGCC GCCmajor=${NATIVEGCC:0:1} GCCminor=${NATIVEGCC:2:1} GCCrelease=${NATIVEGCC:4:1}
415 lfsmake1 ccache
416 lfsmake1 sed LFS_PASS=1
417 lfsmake1 m4 LFS_PASS=1
418 lfsmake1 bison LFS_PASS=1
419 lfsmake1 flex LFS_PASS=1
420 lfsmake1 binutils LFS_PASS=1
421 lfsmake1 gcc LFS_PASS=1
422 export PATH=$BASEDIR/build/usr/local/bin:$BASEDIR/build/tools/bin:$PATH
423
424 lfsmake1 linux
425 lfsmake1 tcl
426 lfsmake1 expect
427 lfsmake1 glibc
428 lfsmake1 dejagnu
429 lfsmake1 gcc LFS_PASS=2
430 lfsmake1 binutils LFS_PASS=2
431 lfsmake1 gawk
432 lfsmake1 coreutils
433 lfsmake1 bzip2
434 lfsmake1 gzip
435 lfsmake1 diffutils
436 lfsmake1 findutils
437 lfsmake1 make
438 lfsmake1 grep
439 lfsmake1 sed LFS_PASS=2
440 lfsmake1 m4 LFS_PASS=2
441 lfsmake1 bison LFS_PASS=2
442 lfsmake1 flex LFS_PASS=2
443 lfsmake1 gettext
444 lfsmake1 ncurses
445 lfsmake1 patch
446 lfsmake1 tar
447 lfsmake1 texinfo
448 lfsmake1 bash
449 lfsmake1 util-linux
450 lfsmake1 perl
451 export PATH=$ORG_PATH
452}
453
454buildbase() {
455 LOGFILE="$BASEDIR/log/_build.base.log"
456 export LOGFILE
457 echo -ne "`date -u '+%b %e %T'`: Stage2 linux base build \n" | tee -a $LOGFILE
458 # Run LFS dynamic binary creation scripts one by one
459 lfsmake2 stage2
460 lfsmake2 makedev
461 lfsmake2 linux
462 lfsmake2 man-pages
463 lfsmake2 glibc
464 lfsmake2 binutils
465 lfsmake2 gcc
466 lfsmake2 coreutils
467 lfsmake2 zlib
468 lfsmake2 mktemp
469 lfsmake2 iana-etc
470 lfsmake2 findutils
471 lfsmake2 gawk
472 lfsmake2 ncurses
473 lfsmake2 vim
474 lfsmake2 m4
475 lfsmake2 bison
476 lfsmake2 less
477 lfsmake2 groff
478 lfsmake2 sed
479 lfsmake2 flex
480 lfsmake2 gettext
481 lfsmake2 net-tools
482 lfsmake2 inetutils
483 lfsmake2 perl
484 lfsmake2 texinfo
485 lfsmake2 autoconf
486 lfsmake2 automake
487 lfsmake2 bash
488 lfsmake2 file
489 lfsmake2 libtool
490 lfsmake2 bzip2
491 lfsmake2 diffutils
492 lfsmake2 ed
493 lfsmake2 kbd
494 lfsmake2 e2fsprogs
495 lfsmake2 grep
496 if [ 'i386' = $MACHINE ]; then
497 lfsmake2 grub
498 elif [ 'alpha' = $MACHINE ]; then
499 lfsmake2 aboot
500 fi
501 lfsmake2 gzip
502 lfsmake2 man
503 lfsmake2 make
504 lfsmake2 modutils
505 lfsmake2 patch
506 lfsmake2 procinfo
507 lfsmake2 procps
508 lfsmake2 psmisc
509 lfsmake2 shadow
510 lfsmake2 sysklogd
511 lfsmake2 sysvinit
512 lfsmake2 tar
513 lfsmake2 util-linux
514}
515
516buildipcop() {
517 # Run IPCop make scripts one by one
518 LOGFILE="$BASEDIR/log/_build.ipcop.log"
519 export LOGFILE
520 echo -ne "`date -u '+%b %e %T'`: Stage3 $NAME build \n" | tee -a $LOGFILE
521
522 # Build these first as some of the kernel packages below rely on
523 # these for some of their client program functionality
524 ipcopmake configroot
525 ipcopmake dhcp
526 ipcopmake dhcpcd
527 ipcopmake libusb
528 ipcopmake libpcap
529 ipcopmake linux-atm
530 ipcopmake ppp
531 ipcopmake rp-pppoe
532 ipcopmake unzip
533 # Do SMP now
534 if [ 'i386' = $MACHINE ]; then
535 # abuse the SMP flag, and make an minimal installer kernel first
536 # so that the boot floppy always works.....
537 ipcopmake linux LFS_PASS=ipcop SMP=installer
538 ipcopmake linux LFS_PASS=ipcop SMP=1
539 ipcopmake 3cp4218 SMP=1
540 ipcopmake amedyn SMP=1
541 ipcopmake cxacru SMP=1
542 ipcopmake eagle SMP=1
543
544 # These are here because they have i386 only binary libraries
545 # included in the package.
546 ipcopmake cnx_pci SMP=1
547 ipcopmake fcdsl SMP=1
548 ipcopmake fcdsl2 SMP=1
549 ipcopmake fcdslsl SMP=1
550 ipcopmake fcdslusb SMP=1
551 ipcopmake fcdslslusb SMP=1
552 ipcopmake pulsar SMP=1
553 ipcopmake unicorn SMP=1
554 fi
555
556 ipcopmake linux LFS_PASS=ipcop
557 ipcopmake 3cp4218
558 ipcopmake amedyn
559 ipcopmake cxacru
560 ipcopmake eciadsl
561 ipcopmake eagle
562 ipcopmake speedtouch
563 if [ 'i386' = $MACHINE ]; then
564 # These are here because they have i386 only binary libraries
565 # included in the package.
566 ipcopmake cnx_pci
567 ipcopmake fcdsl
568 ipcopmake fcdsl2
569 ipcopmake fcdslsl
570 ipcopmake fcdslusb
571 ipcopmake fcdslslusb
572 ipcopmake pulsar
573 ipcopmake unicorn
574 fi
575
576 ipcopmake pcmcia-cs
577 ipcopmake expat
578 ipcopmake gdbm
579 ipcopmake gmp
580 ipcopmake openssl
581 ipcopmake python
582 ipcopmake libnet
583 ipcopmake libpng
584 ipcopmake gd
585 ipcopmake popt
586 ipcopmake slang
587 ipcopmake newt
588 ipcopmake libcap
589 ipcopmake pciutils
590 ipcopmake pcre
591 ipcopmake apache
592 ipcopmake arping
593 ipcopmake beep
594 ipcopmake bind
595 ipcopmake capi4k-utils
596 ipcopmake cdrtools
597 ipcopmake dnsmasq
598 ipcopmake dosfstools
599 ipcopmake ethtool
600 ipcopmake ez-ipupdate
601 ipcopmake fcron
602 ipcopmake perl-GD
603 ipcopmake gnupg
604 ipcopmake hdparm
605 ipcopmake ibod
606 ipcopmake initscripts
607 ipcopmake iptables
608 ipcopmake ipac-ng
609 ipcopmake ipaddr
610 ipcopmake iproute2
611 ipcopmake iptstate
612 ipcopmake iputils
613 ipcopmake isapnptools
614 ipcopmake isdn4k-utils
615 ipcopmake kudzu
616 ipcopmake logrotate
617 ipcopmake logwatch
618 ipcopmake mingetty
619 ipcopmake misc-progs
620 ipcopmake mtools
621 ipcopmake nano
622 ipcopmake nash
623 ipcopmake nasm
624 ipcopmake URI
625 ipcopmake HTML-Tagset
626 ipcopmake HTML-Parser
627 ipcopmake Compress-Zlib
628 ipcopmake Digest
629 ipcopmake Digest-SHA1
630 ipcopmake Digest-HMAC
631 ipcopmake libwww-perl
632 ipcopmake Net-DNS
633 ipcopmake Net-IPv4Addr
634 ipcopmake Net_SSLeay
635 ipcopmake noip_updater
636 ipcopmake ntp
637 ipcopmake oinkmaster
638 ipcopmake openssh
639 ipcopmake openswan
640 ipcopmake pptpclient
641 ipcopmake rrdtool
642 ipcopmake setserial
643 ipcopmake setup
644 ipcopmake snort
645 #ipcopmake speedycgi
646 ipcopmake squid
647 ipcopmake squid-graph
648 ipcopmake tcpdump
649 ipcopmake traceroute
650 ipcopmake vlan
651 ipcopmake wireless
652 ipcopmake libsafe
653 ipcopmake 3c5x9setup
56daf5bb 654 echo -ne "`date -u '+%b %e %T'`: Building IPFire modules \n" | tee -a $LOGFILE
1fe6c87b 655 ipcopmake wget
56daf5bb 656 ipcopmake berkeley-DB
df5e82b3 657 ipcopmake xampp
1fe6c87b 658 ipcopmake bridge-utils
df5e82b3 659 ipcopmake pam
56daf5bb 660 ipcopmake pammysql
052ad1cd
MT
661 ipcopmake saslauthd PASS=1
662 ipcopmake openldap
663 ipcopmake saslauthd PASS=2
94025eea
MT
664 ipcopmake postfix
665 ipcopmake stund
666 ipcopmake lpd
6233f08f
MT
667 ipcopmake pwlib
668 ipcopmake openh323
052ad1cd 669# wget http://www.guzu.net/linux/hddtemp.db && mv hddtemp.db $BASEDIR/build/etc/hddtemp.db
1fe6c87b 670 ipcopmake hddtemp
94025eea 671
df5e82b3
MT
672}
673
674buildinstaller() {
675 # Run installer scripts one by one
676 LOGFILE="$BASEDIR/log/_build.installer.log"
677 export LOGFILE
678 echo -ne "`date -u '+%b %e %T'`: Stage4 installer build \n" | tee -a $LOGFILE
679 if [ 'i386' = $MACHINE ]; then
680 ipcopmake syslinux
681 ipcopmake as86
682 ipcopmake mbr
683 ipcopmake uClibc
684 fi
685 installmake busybox
686 installmake sysvinit
687 installmake e2fsprogs
688 installmake misc-progs
689 installmake slang
690 installmake util-linux
691 installmake newt
692 installmake pciutils
693 installmake pcmcia-cs
694 installmake kbd
695 installmake installer
696 installmake scsi.img
697 installmake driver.img
698 installmake initrd
699 installmake boot.img
700}
701
702buildpackages() {
703 LOGFILE="$BASEDIR/log/_build.packages.log"
704 export LOGFILE
705 echo "... see detailed log in _build.*.log files" >> $LOGFILE
706 echo -ne "`date -u '+%b %e %T'`: Stage5 packages build \n" | tee -a $LOGFILE
707 # Strip files
708 echo "`date -u '+%b %e %T'`: Stripping files" | tee -a $LOGFILE
709 find $LFS/lib $LFS/usr/lib $LFS/usr/share/rrdtool-* $LFS/install ! -type l \( -name '*.so' -o -name '*.so[\.0-9]*' \) \
710 ! -name 'libc.so' ! -name 'libpthread.so' ! -name 'libcrypto.so.0.9.7.sha1' \
94025eea 711 -ls -exec $LFS/tools/bin/strip --strip-all {} \; >> $LOGFILE 2>&1
df5e82b3
MT
712 # add -ls before -exec if you want to verify what files are stripped
713
714 find $LFS/{,s}bin $LFS/usr/{,s}bin $LFS/usr/local/{,s}bin ! -type l \
715 -exec file {} \; | grep " ELF " | cut -f1 -d ':' | xargs $LFS/tools/bin/strip --strip-all >> $LOGFILE 2>&1
716 # there add -v to strip to verify
717
718 if [ 'i386' = $MACHINE ]; then
719 # Create fcdsl packages
720 echo "`date -u '+%b %e %T'`: Building fcdsl tgz" | tee -a $LOGFILE
721 cp $LFS/install/images/fcdsl/license.txt $LFS >> $LOGFILE 2>&1
722 touch $LFS/var/run/{need-depmod-$KVER,need-depmod-$KVER-smp}
723 cd $LFS && tar cvfz $LFS/install/images/$SNAME-fcdsl-$VERSION.$MACHINE.tgz \
724 lib/modules/$KVER/misc/fcdsl*.o.gz \
725 lib/modules/$KVER-smp/misc/fcdsl*.o.gz \
726 usr/lib/isdn/{fds?base.bin,fd?ubase.frm} \
727 etc/fcdsl/fcdsl*.conf \
728 etc/drdsl/{drdsl,drdsl.ini} \
729 license.txt \
730 var/run/{need-depmod-$KVER,need-depmod-$KVER-smp} >> $LOGFILE 2>&1
731 rm -f $LFS/license.txt >> $LOGFILE 2>&1
732 cd $BASEDIR
733 fi
734
c2b15814 735# Create update for this version
df5e82b3
MT
736# echo "`date -u '+%b %e %T'`: Building update $VERSION tgz" | tee -a $LOGFILE
737# tar -cz -C $BASEDIR/build --files-from=$BASEDIR/updates/$VERSION/ROOTFILES.$MACHINE-$VERSION -f $BASEDIR/updates/$VERSION/patch.tar.gz --exclude='#*';
738# chmod 755 $BASEDIR/updates/$VERSION/setup
739# tar -cz -C $BASEDIR/updates/$VERSION -f $LFS/install/images/$SNAME-update-$VERSION.$MACHINE.tgz patch.tar.gz setup information
740# rm -f $LFS/var/run/{need-depmod-$KVER,need-depmod-$KVER-smp}
741
742 # Generating list of packages used
743 echo "`date -u '+%b %e %T'`: Generating packages list from logs" | tee -a $LOGFILE
744 rm -f $BASEDIR/doc/packages-list
745 for i in `ls -1tr $BASEDIR/log/[^_]*`; do
746 if [ "$i" != "$BASEDIR/log/FILES" -a -n $i ]; then
3ea75603 747 echo " * `basename $i`" >>$BASEDIR/doc/packages-list
df5e82b3
MT
748 fi
749 done
3ea75603 750 echo "====== List of softwares used to build $NAME Version: $VERSION ======" > $BASEDIR/doc/packages-list.txt
df5e82b3
MT
751 grep -v 'configroot$\|img$\|initrd$\|initscripts$\|installer$\|install$\|ipcop$\|setup$\|stage2$\|smp$\|tools$\|tools1$\|tools2$' \
752 $BASEDIR/doc/packages-list | sort >> $BASEDIR/doc/packages-list.txt
753 rm -f $BASEDIR/doc/packages-list
754 # packages-list.txt is ready to be displayed for wiki page IPCopSoftwares
755
756 # Create ISO for CDRom and USB-superfloppy
757 ipcopmake cdrom
758 cp $LFS/install/images/{*.iso,*.tgz} $BASEDIR >> $LOGFILE 2>&1
e7164bb4
MT
759
760 # Build IPFire packages
761 ipfiredist postfix
df5e82b3
MT
762
763 # Cleanup
764 stdumount
765 rm -rf $BASEDIR/build/tmp/*
766
767 # Generating total list of files
768 echo "`date -u '+%b %e %T'`: Generating files list from logs" | tee -a $LOGFILE
769 rm -f $BASEDIR/log/FILES
770 for i in `ls -1tr $BASEDIR/log/[^_]*`; do
771 if [ "$i" != "$BASEDIR/log/FILES" -a -n $i ]; then
772 echo "##" >>$BASEDIR/log/FILES
773 echo "## `basename $i`" >>$BASEDIR/log/FILES
774 echo "##" >>$BASEDIR/log/FILES
775 cat $i | sed "s%^\./%#%" | sort >> $BASEDIR/log/FILES
776 fi
777 done
778
779 cd $PWD
780
781}
782
783# See what we're supposed to do
784case "$1" in
785build)
786 BUILDMACHINE=`uname -m`
787 PACKAGE=`ls -v -r $BASEDIR/cache/$SNAME-1.4.*-toolchain-$BUILDMACHINE.tar.gz 2> /dev/null | head -n 1`
788 #only restore on a clean disk
789 if [ ! -f log/perl-*-tools ]; then
790 if [ ! -n "$PACKAGE" ]; then
791 echo "`date -u '+%b %e %T'`: Full toolchain compilation" | tee -a $LOGFILE
792 prepareenv
793 buildtoolchain
794 else
795 PACKAGENAME=${PACKAGE%.tar.gz}
796 echo "`date -u '+%b %e %T'`: Restore from $PACKAGE" | tee -a $LOGFILE
797 if [ `md5sum $PACKAGE | awk '{print $1}'` == `cat $PACKAGENAME.md5 | awk '{print $1}'` ]; then
798 tar zxf $PACKAGE
799 prepareenv
800 else
801 exiterror "$PACKAGENAME md5 did not match, check downloaded package"
802 fi
803 fi
804 else
805 echo "`date -u '+%b %e %T'`: Using installed toolchain" | tee -a $LOGFILE
806 prepareenv
807 fi
808 buildbase
809 buildipcop
810 buildinstaller
811 buildpackages
812 ;;
813shell)
814 # enter a shell inside LFS chroot
815 # may be used to changed kernel settings
816 prepareenv
817 entershell
818 ;;
819changelog)
820 echo "Building doc/Changelog from CVS"
821 # cv2cl script come from http://www.red-bean.com/cvs2cl/
822 if [ ! -s $BASEDIR/doc/CVS/Tag ]; then
823 BRANCHOPTS=""
824 else
825 BRANCH=`cat $BASEDIR/doc/CVS/Tag`
826 BRANCH=${BRANCH:1}
827 BRANCHOPTS="--follow-only $BRANCH"
828 fi
829
830 $BASEDIR/tools/cvs2cl.pl --gmt --show-dead $BRANCHOPTS -f $BASEDIR/doc/ChangeLog
831 rm -f $BASEDIR/doc/ChangeLog.bak
832 echo
833 echo "Commit the change now to update CVS"
834 ;;
835check)
836 echo "Checking sources files availability on the web"
837 if [ ! -d $DIR_CHK ]; then
838 mkdir -p $DIR_CHK
839 fi
840 FINISHED=0
841 cd $BASEDIR/lfs
842 for c in `seq $MAX_RETRIES`; do
843 if (( FINISHED==1 )); then
844 break
845 fi
846 FINISHED=1
847 cd $BASEDIR/lfs
848 for i in *; do
849 if [ -f "$i" -a "$i" != "Config" ]; then
850 make -s -f $i MACHINE=$MACHINE LFS_BASEDIR=$BASEDIR ROOT=$BASEDIR/build \
851 MESSAGE="$i\t ($c/$MAX_RETRIES)" check
852 if [ $? -ne 0 ]; then
853 echo "Check : wget error in lfs/$i"
854 FINISHED=0
855 fi
856 fi
857 done
858 done
859 cd -
860 ;;
861checkclean)
862 echo "Erasing sources files availability tags"
863 rm -rf $DIR_CHK/*
864 ;;
865clean)
866 for i in `mount | grep $BASEDIR | sed 's/^.*loop=\(.*\))/\1/'`; do
867 $LOSETUP -d $i 2>/dev/null
868 done
869 for i in `mount | grep $BASEDIR | cut -d " " -f 1`; do
870 umount $i
871 done
872 stdumount
873 for i in `seq 0 7`; do
874 if ( losetup /dev/loop${i} 2>/dev/null | grep -q "/install/images" ); then
875 umount /dev/loop${i} 2>/dev/null;
876 losetup -d /dev/loop${i} 2>/dev/null;
877 fi;
878 done
879 rm -rf $BASEDIR/build
880 rm -rf $BASEDIR/cdrom
881 rm -rf $BASEDIR/log
882 rm -f $BASEDIR/updates/$VERSION/patch.tar.gz;
883 if [ -h /tools ]; then
884 rm -f /tools
885 fi
886 ;;
887dist)
888 echo "Building source package from CVS, list of changed files, MD5 of release files"
889 if [ ! -s $BASEDIR/doc/CVS/Tag ]; then
890 BRANCH=""
891 BRANCHOPTS="-D `date +'%Y-%m-%d'`"
892 else
893 BRANCH=`cat $BASEDIR/doc/CVS/Tag`
894 BRANCH=${BRANCH:1}
895 BRANCHOPTS="-r $BRANCH"
896 fi
897
898 rm -rf $BASEDIR/build/tmp/$SNAME-$VERSION $BASEDIR/doc/release.txt
899 cd $BASEDIR/build/tmp
900 # build sources tgz
901 echo "Export tree $BRANCH $SNAME-$VERSION"
902 cvs -z3 -d `cat $BASEDIR/CVS/Root` export $BRANCHOPTS ipcop
903 if [ $? -eq 0 ]; then
904 mv ipcop $SNAME-$VERSION
905 tar cfz $BASEDIR/$SNAME-sources-$VERSION.tgz $SNAME-$VERSION
906 cd $BASEDIR
907
908 if [ ! -d $BASEDIR/build/tmp/$PREVIOUSTAG ]; then
909 # export previous version to be compared with actual, this help to check wich files need to go in update
910 cd $BASEDIR/build/tmp
911 echo "Export tree $PREVIOUSTAG"
912 cvs -z3 -d `cat $BASEDIR/CVS/Root` export -r $PREVIOUSTAG ipcop
913 mv ipcop $PREVIOUSTAG
914 fi
915 if [ -d $BASEDIR/build/tmp/$PREVIOUSTAG -o -d $BASEDIR/build/tmp/$SNAME-$VERSION ]; then
916 cd $BASEDIR/build/tmp
917 echo "diff $PREVIOUSTAG <> $BRANCH $SNAME-$VERSION >doc/updated-sources.txt"
918 diff -rq $PREVIOUSTAG $SNAME-$VERSION > $BASEDIR/doc/updated-sources.txt
919 mv $BASEDIR/doc/updated-sources.txt $BASEDIR/doc/updated-sources.bak
920 sed -e "s+Files $PREVIOUSTAG\/++" \
921 -e "s+ and .*$++" \
922 -e "s+src/rc.d+etc/rc.d+" \
923 -e "s+^langs/+var/ipcop/langs/+" \
924 -e "s+html/cgi-bin+home/httpd/cgi-bin+" $BASEDIR/doc/updated-sources.bak \
925 > $BASEDIR/doc/updated-sources.txt
926 rm -f $BASEDIR/doc/updated-sources.bak
927 fi
928 fi
929 ;;
930newupdate)
931 # create structure for $VERSION update
932 if [ ! -f "updates/$VERSION" ]; then
933 mkdir -p updates/$VERSION
934 cd updates/$VERSION
935 touch information
936 echo 'etc/issue' > ROOTFILES.alpha-$VERSION
937 echo 'etc/issue' > ROOTFILES.i386-$VERSION
938 echo 'patch.tar.gz' > .cvsignore
939 sed -e "s+^UPGRADEVERSION.*$+UPGRADEVERSION=$VERSION+" $BASEDIR/src/scripts/updatesetup > setup
940 chmod 755 setup
941 cd ..
942 echo "Adding directory $VERSION to cvs"
943 cvs add $VERSION
944 echo "Adding files to cvs"
945 cvs add $VERSION/ROOTFILES.alpha-$VERSION \
946 $VERSION/ROOTFILES.i386-$VERSION \
947 $VERSION/information \
948 $VERSION/setup \
949 $VERSION/.cvsignore
950 else
951 echo "update/$VERSION already exist"
952 fi
953 cd -
954 exit 0
955 ;;
956prefetch)
957 if [ ! -d $BASEDIR/cache ]; then
958 mkdir $BASEDIR/cache
959 fi
960 mkdir -p $BASEDIR/log
961 echo "`date -u '+%b %e %T'`:Preload all source files" | tee -a $LOGFILE
962 FINISHED=0
963 cd $BASEDIR/lfs
964 for c in `seq $MAX_RETRIES`; do
965 if (( FINISHED==1 )); then
966 break
967 fi
968 FINISHED=1
969 cd $BASEDIR/lfs
970 for i in *; do
971 if [ -f "$i" -a "$i" != "Config" ]; then
972 make -s -f $i LFS_BASEDIR=$BASEDIR MESSAGE="$i\t ($c/$MAX_RETRIES)" download >> $LOGFILE 2>&1
973 if [ $? -ne 0 ]; then
974 echo "Prefetch : wget error in lfs/$i"
975 FINISHED=0
976 else
977 if [ $c -eq 1 ]; then
978 echo "Prefetch : lfs/$i files loaded"
979 fi
980 fi
981 fi
982 done
983 done
984 echo "Prefetch : verifying md5sum"
985 ERROR=0
986 for i in *; do
987 if [ -f "$i" -a "$i" != "Config" ]; then
988 make -s -f $i LFS_BASEDIR=$BASEDIR MESSAGE="$i\t " md5 >> $LOGFILE 2>&1
989 if [ $? -ne 0 ]; then
990 echo "md5 difference in lfs/$i"
991 ERROR=1
992 fi
993 fi
994 done
995 if [ $ERROR -eq 0 ]; then
996 echo "Prefetch : all files md5sum match"
997 fi
998 cd -
999 ;;
1000rootfiles)
1001 PREVIOUSVERSION=`echo $PREVIOUSTAG | sed -e 's/IPCOP_v//' -e 's/_FINAL//' -e 's/_/\./g'`
1002 # make md5 list of actual build
1003 # some packages include a timestamp (kernel/perl/python/vim and more), so md5 vary at each build
1004 # anyway, it is sometime usable after a patch or a minor upgrade to know wich files include in update
1005 if [ ! -f "$BASEDIR/build/install/cdrom/$SNAME-$VERSION.tgz" ]; then
1006 echo "need cdrom be build to read include files list, use ./make.sh build before."
1007 else
1008 tar tzf $BASEDIR/build/install/cdrom/$SNAME-$VERSION.tgz > $BASEDIR/updates/$VERSION/FILES.tmp
1009 cd $BASEDIR/build
1010 rm -f $BASEDIR/updates/$VERSION/FILES-$MACHINE-$VERSION.md5
1011 for line in `cat $BASEDIR/updates/$VERSION/FILES.tmp`; do
1012 if [ -f "$line" -a ! -L "$line" ]; then
1013 md5sum "$line" >> $BASEDIR/updates/$VERSION/FILES-$MACHINE-$VERSION.md5
1014 fi
1015 done
1016 diff $BASEDIR/updates/$PREVIOUSVERSION/FILES-$MACHINE-$PREVIOUSVERSION.md5 \
1017 $BASEDIR/updates/$VERSION/FILES-$MACHINE-$VERSION.md5 \
1018 > $BASEDIR/updates/$VERSION/FILES-$MACHINE.diff
1019 awk '$1==">" {print $3}' $BASEDIR/updates/$VERSION/FILES-$MACHINE.diff \
1020 > $BASEDIR/updates/$VERSION/ROOTFILES.add.$MACHINE
1021 awk '$1=="<" {print $3}' $BASEDIR/updates/$VERSION/FILES-$MACHINE.diff \
1022 > $BASEDIR/updates/$VERSION/ROOTFILES.remove.$MACHINE.tmp
1023 rm -f $BASEDIR/updates/$VERSION/ROOTFILES.remove.$MACHINE
1024 for line in `cat $BASEDIR/updates/$VERSION/ROOTFILES.remove.$MACHINE.tmp`; do
1025 # a file is only removed when not in add file
1026 if ( ! grep -q "^$line$" $BASEDIR/updates/$VERSION/ROOTFILES.add.$MACHINE ); then
1027 echo $line >> $BASEDIR/updates/$VERSION/ROOTFILES.remove.$MACHINE
1028 fi
1029 done
1030 rm -f $BASEDIR/updates/$VERSION/{FILES.tmp,FILES-*.diff,ROOTFILES.remove.*.tmp}
1031 fi
1032 exit 0
1033 ;;
1034toolchain)
1035 prepareenv
1036 buildtoolchain
1037 BUILDMACHINE=`uname -m`
1038 echo "`date -u '+%b %e %T'`: Create toolchain tar.gz for $BUILDMACHINE" | tee -a $LOGFILE
1039 cd $BASEDIR && tar -zc --exclude='log/_build.*.log' -f cache/$SNAME-$VERSION-toolchain-$BUILDMACHINE.tar.gz \
1040 build/{bin,etc,usr/bin,usr/local} \
1041 build/tools/{bin,etc,*-linux-gnu,include,lib,libexec,sbin,share,var} \
1042 log >> $LOGFILE
1043 md5sum cache/$SNAME-$VERSION-toolchain-$BUILDMACHINE.tar.gz \
1044 > cache/$SNAME-$VERSION-toolchain-$BUILDMACHINE.md5
1045 stdumount
1046 ;;
1047gettoolchain)
1048 BUILDMACHINE=`uname -m`
1049 # arbitrary name to be updated in case of new toolchain package upload
e29556d8
MT
1050 PACKAGE=$SNAME-1.4-toolchain-$BUILDMACHINE
1051 URL_IPFIRE=`grep URL_IPFIRE lfs/Config | awk '{ print $3 }'`
df5e82b3
MT
1052 echo "`date -u '+%b %e %T'`: Load toolchain tar.gz for $BUILDMACHINE" | tee -a $LOGFILE
1053 cd $BASEDIR/cache
e29556d8 1054 wget -c $URL_IPFIRE/toolchains/$PACKAGE.tar.gz $URL_IPFIRE/toolchains/$PACKAGE.md5
df5e82b3
MT
1055 if [ $? -ne 0 ]; then
1056 echo "`date -u '+%b %e %T'`: error downloading toolchain for $BUILDMACHINE machine" | tee -a $LOGFILE
1057 else
1058 if [ "`md5sum $PACKAGE.tar.gz | awk '{print $1}'`" = "`cat $PACKAGE.md5 | awk '{print $1}'`" ]; then
1059 echo "`date -u '+%b %e %T'`: toolchain md5 ok" | tee -a $LOGFILE
e29556d8
MT
1060 echo "`date -u '+%b %e %T'`: Uncompressing toolchain" | tee -a $LOGFILE
1061 cd $BASEDIR && tar xvfz cache/$PACKAGE.tar.gz -C .
df5e82b3
MT
1062 else
1063 exiterror "$PACKAGE.md5 did not match, check downloaded package"
1064 fi
1065 fi
1066 ;;
1067*)
1068 echo "Usage: $0 {build|changelog|check|checkclean|clean|dist|gettoolchain|newupdate|prefetch|rootfiles|shell|toolchain}"
1069 cat doc/make.sh-usage
1070 exit 1
1071 ;;
3ea75603 1072esac