2 ############################################################################
4 # This file is part of the IPFire Firewall. #
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. #
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. #
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 #
20 # Copyright (C) 2006 IPFire-Team <info@ipfire.eu>. #
22 ############################################################################
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
31 MAX_RETRIES
=1 # prefetch/check loop
32 KVER
=`grep --max-count=1 VER lfs/linux | awk '{ print $3 }'`
34 SVN_REVISION
=`svn info | grep Revision | cut -c 11-`
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'`
41 # Debian specific settings
42 if [ ! -e /etc
/debian_version
]; then
45 if [ -x /usr
/bin
/realpath
]; then
46 FULLPATH
=`/usr/bin/realpath $0`
48 echo "ERROR: Need to do apt-get install realpath"
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
62 . tools
/make-functions
64 if [ -f .config
]; then
71 ############################################################################
73 # Are we running the right shell? #
75 ############################################################################
76 if [ ! "$BASH" ]; then
77 exiterror
"BASH environment variable is not set. You're probably running the wrong shell."
80 if [ -z "${BASH_VERSION}" ]; then
81 exiterror
"Not running BASH shell."
85 ############################################################################
87 # Trap on emergency exit #
89 ############################################################################
90 trap "exiterror 'Build process interrupted'" SIGINT SIGTERM SIGKILL SIGSTOP SIGQUIT
93 ############################################################################
95 # Resetting our nice level #
97 ############################################################################
98 echo -ne "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"
104 beautify message DONE
108 ############################################################################
110 # Checking if running as root user #
112 ############################################################################
113 echo -ne "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"
118 beautify message DONE
122 ############################################################################
124 # Checking for necessary temporary space #
126 ############################################################################
127 echo -ne "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"
137 beautify message DONE
140 ############################################################################
142 # Building Linux From Scratch system #
144 ############################################################################
151 # Check /tools symlink
152 if [ -h /tools
]; then
155 if [ ! -a /tools
]; then
156 ln -s $BASEDIR/build
/tools
/
158 if [ ! -h /tools
]; then
159 exiterror
"Could not create /tools symbolic link."
166 export LFS LC_ALL CFLAGS CXXFLAGS MAKETUNING
167 unset CC CXX CPP LD_LIBRARY_PATH LD_PRELOAD
169 # Make some extra directories
170 mkdir
-p $BASEDIR/build
/{tools
,etc
,usr
/src
} 2>/dev
/null
171 mkdir
-p $BASEDIR/build
/{dev
/{shm
,pts
},proc
,sys
}
172 mkdir
-p $BASEDIR/{cache
,ccache
} 2>/dev
/null
173 mkdir
-p $BASEDIR/build
/usr
/src
/{cache
,config
,doc
,html
,langs
,lfs
,log
,src
,ccache
}
175 mknod
-m 600 $BASEDIR/build
/dev
/console c
5 1 2>/dev
/null
176 mknod
-m 666 $BASEDIR/build
/dev
/null c
1 3 2>/dev
/null
178 # Make all sources and proc available under lfs build
179 mount
--bind /dev
$BASEDIR/build
/dev
180 mount
--bind /dev
/pts
$BASEDIR/build
/dev
/pts
181 mount
--bind /dev
/shm
$BASEDIR/build
/dev
/shm
182 mount
--bind /proc
$BASEDIR/build
/proc
183 mount
--bind /sys
$BASEDIR/build
/sys
184 mount
--bind $BASEDIR/cache
$BASEDIR/build
/usr
/src
/cache
185 mount
--bind $BASEDIR/ccache
$BASEDIR/build
/usr
/src
/ccache
186 mount
--bind $BASEDIR/config
$BASEDIR/build
/usr
/src
/config
187 mount
--bind $BASEDIR/doc
$BASEDIR/build
/usr
/src
/doc
188 mount
--bind $BASEDIR/html
$BASEDIR/build
/usr
/src
/html
189 mount
--bind $BASEDIR/langs
$BASEDIR/build
/usr
/src
/langs
190 mount
--bind $BASEDIR/lfs
$BASEDIR/build
/usr
/src
/lfs
191 mount
--bind $BASEDIR/log
$BASEDIR/build
/usr
/src
/log
192 mount
--bind $BASEDIR/src
$BASEDIR/build
/usr
/src
/src
194 # This is a temporary hack!!!
195 cp -f /bin
/hostname
/tools
/bin
/hostname
2>/dev
/null
197 # Run LFS static binary creation scripts one by one
198 export CCACHE_DIR
=$BASEDIR/ccache
199 export CCACHE_HASHDIR
=1
201 # Remove pre-install list of installed files in case user erase some files before rebuild
202 rm -f $BASEDIR/build
/usr
/src
/lsalr
2>/dev
/null
206 LOGFILE
="$BASEDIR/log/_build.toolchain.log"
209 NATIVEGCC
=`gcc --version | grep GCC | awk {'print $3'}`
210 export NATIVEGCC GCCmajor
=${NATIVEGCC:0:1} GCCminor=${NATIVEGCC:2:1} GCCrelease=${NATIVEGCC:4:1}
212 lfsmake1 binutils PASS
=1
214 export PATH
=$BASEDIR/build
/usr
/local
/bin
:$BASEDIR/build
/tools
/bin
:$PATH
215 lfsmake1 linux-libc-header
217 lfsmake1 cleanup-toolchain PASS
=1
222 lfsmake1 binutils PASS
=2
241 lfsmake1 cleanup-toolchain PASS
=2
242 export PATH
=$ORG_PATH
246 LOGFILE
="$BASEDIR/log/_build.base.log"
250 lfsmake2 linux-libc-header
253 lfsmake2 cleanup-toolchain PASS
=3
309 LOGFILE
="$BASEDIR/log/_build.ipfire.log"
311 ipfiremake configroot
316 # Temporary disabled.
317 # ipfiremake linux-atm
321 ipfiremake linux PASS
=ipfire SMP
=installer
322 ipfiremake linux PASS
=ipfire SMP
=1
323 # ipfiremake 3cp4218 SMP=1
324 # ipfiremake amedyn SMP=1
325 # ipfiremake cxacru SMP=1
326 # ipfiremake eagle SMP=1
327 # ipfiremake cnx_pci SMP=1
328 # ipfiremake fcdsl SMP=1
329 # ipfiremake fcdsl2 SMP=1
330 # ipfiremake fcdslsl SMP=1
331 # ipfiremake fcdslusb SMP=1
332 # ipfiremake fcdslslusb SMP=1
333 # ipfiremake fcpci SMP=1
334 # ipfiremake fcclassic SMP=1
335 # ipfiremake pulsar SMP=1
336 # ipfiremake unicorn SMP=1
337 # ipfiremake promise-sata-300-tx SMP=1
338 ipfiremake linux PASS
=ipfire
344 # ipfiremake speedtouch
349 # ipfiremake fcdslusb
350 # ipfiremake fcdslslusb
352 # ipfiremake fcclassic
355 # ipfiremake promise-sata-300-tx
379 ipfiremake BerkeleyDB
## The Perl module
381 ipfiremake saslauthd PASS
=1
385 ipfiremake subversion
386 ipfiremake apache2 PASS
=CONFIG
390 ipfiremake capi4k-utils
393 ipfiremake dosfstools
395 ipfiremake ez-ipupdate
401 ipfiremake initscripts
408 ipfiremake l7-protocols
409 ipfiremake isapnptools
410 ipfiremake isdn4k-utils
415 ipfiremake misc-progs
421 ipfiremake HTML-Tagset
422 ipfiremake HTML-Parser
423 ipfiremake Compress-Zlib
425 ipfiremake Digest-SHA1
426 ipfiremake Digest-HMAC
427 ipfiremake libwww-perl
429 ipfiremake Net-IPv4Addr
430 ipfiremake Net_SSLeay
431 ipfiremake IO-Stringy
432 ipfiremake Unix-Syslog
433 ipfiremake Mail-Tools
434 ipfiremake MIME-Tools
435 ipfiremake Net-Server
436 ipfiremake Convert-TNEF
437 ipfiremake Convert-UUlib
438 ipfiremake Archive-Tar
439 ipfiremake Archive-Zip
440 ipfiremake Text-Tabs
+Wrap
441 ipfiremake Locale-Country
444 ipfiremake noip_updater
446 ipfiremake oinkmaster
449 ipfiremake pptpclient
455 ipfiremake squid-graph
456 ipfiremake squidguard
458 ipfiremake
traceroute
462 ipfiremake
3c5x9setup
464 ipfiremake startscripts
466 ipfiremake bootsplash
470 ipfiremake pkg-config
474 ipfiremake saslauthd PASS
=2
476 ipfiremake ghostscript
483 ipfiremake bridge-utils
486 ipfiremake smartmontools
497 ipfiremake spamassassin
515 ipfiremake applejuice
520 ipfiremake tcpwrapper
537 # Run installer scripts one by one
538 LOGFILE
="$BASEDIR/log/_build.installer.log"
546 installmake e2fsprogs
547 installmake misc-progs
549 installmake util-linux
552 installmake pcmcia-cs
554 installmake installer
556 installmake driver.img
562 LOGFILE
="$BASEDIR/log/_build.packages.log"
564 echo "... see detailed log in _build.*.log files" >> $LOGFILE
565 echo -ne "`date -u '+%b %e %T'`: Stage5 packages build \n" |
tee -a $LOGFILE
567 echo "`date -u '+%b %e %T'`: Stripping files" |
tee -a $LOGFILE
568 find $LFS/lib
$LFS/usr
/lib
$LFS/usr
/share
/rrdtool-
* $LFS/install ! -type l \
( -name '*.so' -o -name '*.so[\.0-9]*' \
) \
569 ! -name 'libc.so' ! -name 'libpthread.so' ! -name 'libcrypto.so.0.9.7.sha1' \
570 -exec $LFS/tools
/bin
/strip
--strip-all {} \
; >> $LOGFILE 2>&1
571 # add -ls before -exec if you want to verify what files are stripped
573 find $LFS/{,s
}bin
$LFS/usr
/{,s
}bin
$LFS/usr
/local
/{,s
}bin
! -type l \
574 -exec file {} \
; |
grep " ELF " | cut
-f1 -d ':' |
xargs $LFS/tools
/bin
/strip
--strip-all >> $LOGFILE 2>&1
575 # there add -v to strip to verify
577 if [ 'i386' = $MACHINE ]; then
578 # Create fcdsl packages
579 echo "`date -u '+%b %e %T'`: Building fcdsl tgz" |
tee -a $LOGFILE
580 cp $LFS/install
/images
/fcdsl
/license.txt
$LFS >> $LOGFILE 2>&1
581 touch $LFS/var
/run
/{need-depmod-
$KVER,need-depmod-
$KVER-smp}
582 cd $LFS && tar cvfz
$LFS/install
/images
/$SNAME-fcdsl-$VERSION.
$MACHINE.tgz \
583 lib
/modules
/$KVER/misc
/fcdsl
*.o.gz \
584 lib
/modules
/$KVER-smp/misc
/fcdsl
*.o.gz \
585 usr
/lib
/isdn
/{fds?base.bin
,fd?ubase.frm
} \
586 etc
/fcdsl
/fcdsl
*.conf \
587 etc
/drdsl
/{drdsl
,drdsl.ini
} \
589 var
/run
/{need-depmod-
$KVER,need-depmod-
$KVER-smp} >> $LOGFILE 2>&1
590 rm -f $LFS/license.txt
>> $LOGFILE 2>&1
594 # Generating list of packages used
595 echo "`date -u '+%b %e %T'`: Generating packages list from logs" |
tee -a $LOGFILE
596 rm -f $BASEDIR/doc
/packages-list
597 for i
in `ls -1tr $BASEDIR/log/[^_]*`; do
598 if [ "$i" != "$BASEDIR/log/FILES" -a -n $i ]; then
599 echo "* `basename $i`" >>$BASEDIR/doc
/packages-list
602 echo "== List of softwares used to build $NAME Version: $VERSION ==" > $BASEDIR/doc
/packages-list.txt
603 grep -v 'configroot$\|img$\|initrd$\|initscripts$\|installer$\|install$\|ipfire$\|setup$\|pakfire$\|stage2$\|smp$\|tools$\|tools1$\|tools2$\|.tgz$\|-config$' \
604 $BASEDIR/doc
/packages-list |
sort >> $BASEDIR/doc
/packages-list.txt
605 rm -f $BASEDIR/doc
/packages-list
606 # packages-list.txt is ready to be displayed for wiki page
608 # Create ISO for CDROM
610 rm -f $LFS/install
/images
/*usb
*
611 cp $LFS/install
/images
/{*.iso
,*.tgz
} $BASEDIR >> $LOGFILE 2>&1
617 rm -rf $BASEDIR/build
/tmp
/*
619 # Generating total list of files
620 echo "`date -u '+%b %e %T'`: Generating files list from logs" |
tee -a $LOGFILE
621 rm -f $BASEDIR/log
/FILES
622 for i
in `ls -1tr $BASEDIR/log/[^_]*`; do
623 if [ "$i" != "$BASEDIR/log/FILES" -a -n $i ]; then
624 echo "##" >>$BASEDIR/log
/FILES
625 echo "## `basename $i`" >>$BASEDIR/log
/FILES
626 echo "##" >>$BASEDIR/log
/FILES
627 cat $i |
sed "s%^\./%#%" |
sort >> $BASEDIR/log
/FILES
630 cd $BASEDIR/packages
; ls -w1 *.ipfire |
awk -F ".ipfire" '{ print $1 }' > $BASEDIR/packages
/packages_list.txt
631 echo -n "###EOF###" >> $BASEDIR/packages
/packages_list.txt
638 if [ -d "$BASEDIR/packages" ]; then
639 for i
in `ls $BASEDIR/packages`; do
640 touch $BASEDIR/build
/install
/packages
/$i.empty
644 ipfiredist applejuice
671 ipfiredist spamassassin
672 ipfiredist subversion
677 test -d $BASEDIR/packages || mkdir
$BASEDIR/packages
678 mv -f $LFS/install
/packages
/*.
{ipfire
,md5
} $BASEDIR/packages
>> $LOGFILE 2>&1
679 rm -rf $BASEDIR/build
/install
/packages
/*
682 # See what we're supposed to do
686 BUILDMACHINE
=`uname -m`
687 PACKAGE
=`ls -v -r $BASEDIR/cache/toolchains/$SNAME-$VERSION-toolchain-$BUILDMACHINE.tar.gz 2> /dev/null | head -n 1`
688 #only restore on a clean disk
689 if [ ! -f log
/cleanup-toolchain-2-tools
]; then
690 if [ ! -n "$PACKAGE" ]; then
691 beautify build_stage
"Full toolchain compilation - Native GCC: `gcc --version | grep GCC | awk {'print $3'}`"
695 PACKAGENAME
=${PACKAGE%.tar.gz}
696 beautify build_stage
"Packaged toolchain compilation"
697 if [ `md5sum $PACKAGE | awk '{print $1}'` == `cat $PACKAGENAME.md5 | awk '{print $1}'` ]; then
701 exiterror
"$PACKAGENAME md5 did not match, check downloaded package"
705 echo -n "Using installed toolchain" |
tee -a $LOGFILE
706 beautify message SKIP
710 beautify build_stage
"Building base"
713 beautify build_stage
"Building IPFire"
716 # Setzen des IPFire Builds
717 if [ "$FIREBUILD" ]; then
718 echo "$FIREBUILD" > $BASEDIR/build
/var
/ipfire
/firebuild
720 echo "_(OvO)_" > $BASEDIR/build
/var
/ipfire
/firebuild
723 beautify build_stage
"Building installer"
726 beautify build_stage
"Building packages"
730 # enter a shell inside LFS chroot
731 # may be used to changed kernel settings
736 echo -n "Loading new Changelog from SVN: "
737 svn log http
://svn.ipfire.eu
/svn
/ipfire
> doc
/ChangeLog
741 for i
in `mount | grep $BASEDIR | sed 's/^.*loop=\(.*\))/\1/'`; do
742 $LOSETUP -d $i 2>/dev
/null
744 for i
in `mount | grep $BASEDIR | cut -d " " -f 1`; do
748 for i
in `seq 0 7`; do
749 if ( losetup
/dev
/loop
${i} 2>/dev
/null |
grep -q "/install/images" ); then
750 umount
/dev
/loop
${i} 2>/dev
/null
;
751 losetup
-d /dev
/loop
${i} 2>/dev
/null
;
754 rm -rf $BASEDIR/build
755 rm -rf $BASEDIR/cdrom
756 rm -rf $BASEDIR/packages
758 if [ -h /tools
]; then
763 # create structure for a new package
764 echo -e "Name of the new package: $2"
765 if [ ! -f "lfs/$2" ]; then
766 echo "`date -u '+%b %e %T'`: Creating directory src/paks/$2"
769 echo "`date -u '+%b %e %T'`: Creating files"
770 cp $BASEDIR/lfs
/postfix
$BASEDIR/lfs
/$2
773 touch {,un
}install.sh
775 echo '#!/bin/bash' > install.sh
776 echo '#' >> install.sh
777 echo '#################################################################' >> install.sh
778 echo '# #' >> install.sh
779 echo '# This file belongs to IPFire Firewall - GPLv2 - www.ipfire.org #' >> install.sh
780 echo '# #' >> install.sh
781 echo '#################################################################' >> install.sh
782 echo '#' >> install.sh
783 echo '# Extract the files' >> install.sh
784 echo 'tar xfz files.tgz -C /' >> install.sh
785 echo 'cp -f ROOTFILES /opt/pakfire/installed/ROOTFILES.$2' >> install.sh
787 echo '#!/bin/bash' > uninstall.sh
788 echo '#################################################################' >> uninstall.sh
789 echo '# #' >> uninstall.sh
790 echo '# This file belongs to IPFire Firewall - GPLv2 - www.ipfire.org #' >> uninstall.sh
791 echo '# #' >> uninstall.sh
792 echo '#################################################################' >> uninstall.sh
793 echo '#' >> uninstall.sh
794 echo '# Delete the files' >> uninstall.sh
795 echo '## Befehl fehlt noch' >> uninstall.sh
796 echo 'rm -f /opt/pakfire/installed/ROOTFILES.$2' >> uninstall.sh
797 echo "`date -u '+%b %e %T'`: Adding files to SVN"
798 cd - && svn add lfs
/$2 && svn add src
/paks
/$2
800 echo -n "Do you want to remove the folders? [y/n]"
802 if [ "$REM" == "y" ]; then
803 echo "Removing the folders..."
804 svn del src
/paks
/$2 --force
806 echo "Folders are kept."
809 echo "$2 already exists"
814 if [ ! -d $BASEDIR/cache
]; then
817 mkdir
-p $BASEDIR/log
818 echo -e "${BOLD}Preload all source files${NORMAL}" |
tee -a $LOGFILE
821 for c
in `seq $MAX_RETRIES`; do
822 if (( FINISHED
==1 )); then
828 if [ -f "$i" -a "$i" != "Config" ]; then
829 echo -ne "Loading $i"
830 make -s -f $i LFS_BASEDIR
=$BASEDIR MESSAGE
="$i\t ($c/$MAX_RETRIES)" download
>> $LOGFILE 2>&1
831 if [ $?
-ne 0 ]; then
832 beautify message FAIL
835 if [ $c -eq 1 ]; then
836 beautify message DONE
842 echo -e "${BOLD}***Verifying md5sums${NORMAL}"
845 if [ -f "$i" -a "$i" != "Config" ]; then
846 make -s -f $i LFS_BASEDIR
=$BASEDIR MESSAGE
="$i\t " md5
>> $LOGFILE 2>&1
847 if [ $?
-ne 0 ]; then
848 echo -ne "MD5 difference in lfs/$i"
849 beautify message FAIL
854 if [ $ERROR -eq 0 ]; then
855 echo -ne "${BOLD}all files md5sum match${NORMAL}"
856 beautify message DONE
858 echo -ne "${BOLD}not all files were correctly download${NORMAL}"
859 beautify message FAIL
866 beautify build_stage
"Toolchain compilation - Native GCC: `gcc --version | grep GCC | awk {'print $3'}`"
868 BUILDMACHINE
=`uname -m`
869 echo "`date -u '+%b %e %T'`: Create toolchain tar.gz for $BUILDMACHINE" |
tee -a $LOGFILE
870 test -d $BASEDIR/cache
/toolchains || mkdir
$BASEDIR/cache
/toolchains
871 cd $BASEDIR && tar -zc --exclude='log/_build.*.log' -f cache
/toolchains
/$SNAME-$VERSION-toolchain-$BUILDMACHINE.
tar.gz \
872 build
/{bin
,etc
,usr
/bin
,usr
/local} \
873 build
/tools
/{bin
,etc
,*-linux-gnu,include
,lib
,libexec
,sbin
,share
,var
} \
875 md5sum cache
/toolchains
/$SNAME-$VERSION-toolchain-$BUILDMACHINE.
tar.gz \
876 > cache
/toolchains
/$SNAME-$VERSION-toolchain-$BUILDMACHINE.md5
880 BUILDMACHINE
=`uname -m`
881 # arbitrary name to be updated in case of new toolchain package upload
882 PACKAGE
=$SNAME-$VERSION-toolchain-$BUILDMACHINE
883 if [ ! -f $BASEDIR/cache
/toolchains
/$PACKAGE.
tar.gz
]; then
884 URL_IPFIRE
=`grep URL_IPFIRE lfs/Config | awk '{ print $3 }'`
885 test -d $BASEDIR/cache
/toolchains || mkdir
$BASEDIR/cache
/toolchains
886 echo "`date -u '+%b %e %T'`: Load toolchain tar.gz for $BUILDMACHINE" |
tee -a $LOGFILE
887 cd $BASEDIR/cache
/toolchains
888 wget
$URL_IPFIRE/toolchains
/$PACKAGE.
tar.gz
$URL_IPFIRE/toolchains
/$PACKAGE.md5
>& /dev
/null
889 if [ $?
-ne 0 ]; then
890 echo "`date -u '+%b %e %T'`: error downloading toolchain for $BUILDMACHINE machine" |
tee -a $LOGFILE
892 if [ "`md5sum $PACKAGE.tar.gz | awk '{print $1}'`" = "`cat $PACKAGE.md5 | awk '{print $1}'`" ]; then
893 echo "`date -u '+%b %e %T'`: toolchain md5 ok" |
tee -a $LOGFILE
895 exiterror
"$PACKAGE.md5 did not match, check downloaded package"
899 echo "Toolchain is already downloaded. Exiting..."
904 echo -ne "`date -u '+%b %e %T'`: Build sources iso for $MACHINE" |
tee -a $LOGFILE
905 chroot
$LFS /tools
/bin
/env
-i HOME
=/root \
906 TERM
=$TERM PS1
='\u:\w\$ ' \
907 PATH
=/usr
/local
/bin
:/bin
:/usr
/bin
:/sbin
:/usr
/sbin \
908 VERSION
=$VERSION NAME
="$NAME" SNAME
="$SNAME" MACHINE
=$MACHINE \
909 /bin
/bash
-x -c "cd /usr/src/lfs && make -f sources-iso LFS_BASEDIR=/usr/src install" >>$LOGFILE 2>&1
910 mv $LFS/install
/images
/ipfire-
* $BASEDIR >> $LOGFILE 2>&1
911 if [ $?
-eq "0" ]; then
912 beautify message DONE
914 beautify message FAIL
922 echo -ne "Loading the latest source files...\n"
924 svn update
-r $3 |
tee -a $PWD/log
/_build.svn.update.log
926 svn update |
tee -a $PWD/log
/_build.svn.update.log
928 if [ $?
-eq "0" ]; then
929 beautify message DONE
931 beautify message FAIL
934 echo -ne "Writing the svn-info to a file"
935 svn info
> $PWD/svn_status
936 if [ $?
-eq "0" ]; then
937 beautify message DONE
939 beautify message FAIL
947 if [ -e /sbin
/yast
]; then
948 if [ "`echo $SVN_REVISION | cut -c 3`" -eq "0" ]; then
952 echo "Upload the changed files..."
961 if [ -f ipfire-source-r
$SVN_REVISION.
tar.gz
]; then
962 echo -ne "REV $SVN_REVISION: SKIPPED!\n"
965 echo -en "REV $SVN_REVISION: Downloading..."
966 svn
export http
://svn.ipfire.eu
/svn
/ipfire
/trunk ipfire-source
/ --force > /dev
/null
967 svn log http
://svn.ipfire.eu
/svn
/ipfire
/trunk
-r 1:$SVN_REVISION > ipfire-source
/Changelog
968 #svn info http://svn.ipfire.eu/svn/ipfire/trunk -r $SVN_REVISION > ipfire-source/svn_status
971 echo -en "REV $SVN_REVISION: Compressing files..."
972 if [ -e ipfire-source
/trunk
/make.sh
]; then
973 chmod 755 ipfire-source
/trunk
/make.sh
975 tar cfz ipfire-source-r
$SVN_REVISION.
tar.gz ipfire-source
977 echo -en "REV $SVN_REVISION: Cleaning up..."
982 echo -ne "Make a local diff to last svn revision"
983 svn
diff > ipfire-diff-
`date +'%Y-%m-%d-%H:%M'`-r`svn info | grep Revision | cut -c 11-`.
diff
985 echo "Diff was successfully saved to ipfire-diff-`date +'%Y-%m-%d-%H:%M'`-r`svn info | grep Revision | cut -c 11-`.diff"
992 echo -e "Uploading cache to ftp server:"
993 ncftpls
-u $IPFIRE_FTP_USER_INT -p $IPFIRE_FTP_PASS_INT ftp://$IPFIRE_FTP_URL_INT$IPFIRE_FTP_PATH_INT/ > /var
/tmp
/ftplist
995 if [ "$i" == "toolchains" ]; then continue; fi
996 grep -q $i /var
/tmp
/ftplist
997 if [ "$?" -ne "0" ]; then
999 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
1000 if [ "$?" -eq "0" ]; then
1001 beautify message DONE
1003 beautify message FAIL
1007 rm -f /var
/tmp
/ftplist
1008 UL_TIME_START
=`date +'%s'`
1009 ncftpbatch
-d > /dev
/null
2>&1
1010 while ps acx |
grep -q ncftpbatch
1012 UL_TIME
=$
(expr `date +'%s'` - $UL_TIME_START)
1013 echo -ne "\r ${UL_TIME}s : Upload is running..."
1016 beautify message DONE
1023 echo -e "Uploading the iso to $IPFIRE_FTP_URL_EXT."
1024 cat <<EOF > .ftp-commands
1025 mkdir $IPFIRE_FTP_PATH_EXT
1029 ncftp
-u $IPFIRE_FTP_USER_EXT -p $IPFIRE_FTP_PASS_EXT $IPFIRE_FTP_URL_EXT < .ftp-commands
1031 md5sum ipfire-install-
$VERSION.i386.iso
> ipfire-install-
$VERSION.i386.iso.md5
1032 ncftpput
-u $IPFIRE_FTP_USER_EXT -p $IPFIRE_FTP_PASS_EXT $IPFIRE_FTP_URL_EXT $IPFIRE_FTP_PATH_EXT/ ipfire-install-
$VERSION.i386.iso
1033 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
1034 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
1035 ncftpput
-u $IPFIRE_FTP_USER_EXT -p $IPFIRE_FTP_PASS_EXT $IPFIRE_FTP_URL_EXT $IPFIRE_FTP_PATH_EXT/ svn_status
1036 if [ "$?" -eq "0" ]; then
1037 echo -e "The iso of Revision $SVN_REVISION was successfully uploaded to $IPFIRE_FTP_URL_EXT$IPFIRE_FTP_PATH_EXT/."
1039 echo -e "There was an error while uploading the iso to the ftp server."
1042 if [ "$3" = "--with-sources-cd" ]; then
1043 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
1047 cat <<EOF > .ftp-commands
1048 mkdir $IPFIRE_FTP_PATH_PAK
1052 ncftp
-u $IPFIRE_FTP_USER_PAK -p $IPFIRE_FTP_PASS_PAK $IPFIRE_FTP_URL_PAK < .ftp-commands
1054 ncftpput
-z -u $IPFIRE_FTP_USER_PAK -p $IPFIRE_FTP_PASS_PAK $IPFIRE_FTP_URL_PAK $IPFIRE_FTP_PATH_PAK/ packages
/*
1055 if [ "$?" -eq "0" ]; then
1056 echo -e "The packages were successfully uploaded to $IPFIRE_FTP_URL_PAK$IPFIRE_FTP_PATH_PAK/."
1058 echo -e "There was an error while uploading the packages to the ftp server."
1065 if [ "$2" -eq "--background" ]; then
1069 if [ `screen -ls | grep -q ipfire` ]; then
1070 echo "Build is already running, sorry!"
1073 if [ "$2" = "--rebuild" ]; then
1074 export IPFIRE_REBUILD
=1
1077 export IPFIRE_REBUILD
=0
1079 echo -en "${BOLD}***IPFire-Batch-Build is starting...${NORMAL}"
1080 screen
-dmS ipfire
$0 batch --background
1091 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"
1097 "IPFIRE: Build (silent)")
1100 "IPFIRE: Watch Build")
1110 if [ -f /usr
/bin
/mcedit
]; then
1111 export EDITOR
=/usr
/bin
/mcedit
1113 if [ -f /usr
/bin
/nano
]; then
1114 export EDITOR
=/usr
/bin
/nano
1123 svn status
# | grep -v ^?
1129 echo "Usage: $0 {build|changelog|clean|gettoolchain|newpak|prefetch|shell|sync|toolchain}"
1130 cat doc
/make.sh-usage