]> git.ipfire.org Git - ipfire-2.x.git/blame_incremental - make.sh
fuse: Update to 2.9.7
[ipfire-2.x.git] / make.sh
... / ...
CommitLineData
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) 2007-2017 IPFire Team <info@ipfire.org>. #
21# #
22############################################################################
23#
24
25NAME="IPFire" # Software name
26SNAME="ipfire" # Short name
27VERSION="2.19" # Version number
28CORE="110" # Core Level (Filename)
29PAKFIRE_CORE="110" # Core Level (PAKFIRE)
30GIT_BRANCH=`git rev-parse --abbrev-ref HEAD` # Git Branch
31SLOGAN="www.ipfire.org" # Software slogan
32CONFIG_ROOT=/var/ipfire # Configuration rootdir
33NICE=10 # Nice level
34MAX_RETRIES=1 # prefetch/check loop
35BUILD_IMAGES=1 # Flash and Xen Downloader
36KVER=`grep --max-count=1 VER lfs/linux | awk '{ print $3 }'`
37GIT_TAG=$(git tag | tail -1) # Git Tag
38GIT_LASTCOMMIT=$(git log | head -n1 | cut -d" " -f2 |head -c8) # Last commit
39TOOLCHAINVER=12
40
41# New architecture variables
42HOST_ARCH="$(uname -m)"
43
44# Debian specific settings
45if [ ! -e /etc/debian_version ]; then
46 FULLPATH=`which $0`
47else
48 if [ -x /usr/bin/realpath ]; then
49 FULLPATH=`/usr/bin/realpath $0`
50 else
51 echo "ERROR: Need to do apt-get install realpath"
52 exit 1
53 fi
54fi
55
56PWD=`pwd`
57BASENAME=`basename $0`
58BASEDIR=`echo $FULLPATH | sed "s/\/$BASENAME//g"`
59LOGFILE=$BASEDIR/log/_build.preparation.log
60export BASEDIR LOGFILE
61DIR_CHK=$BASEDIR/cache/check
62mkdir $BASEDIR/log/ 2>/dev/null
63
64# Include funtions
65. tools/make-functions
66
67if [ -f .config ]; then
68 . .config
69fi
70
71if [ -n "${BUILD_ARCH}" ]; then
72 configure_build "${BUILD_ARCH}"
73elif [ -n "${TARGET_ARCH}" ]; then
74 configure_build "${TARGET_ARCH}"
75 unset TARGET_ARCH
76else
77 configure_build "default"
78fi
79
80if [ -z $EDITOR ]; then
81 for i in nano emacs vi; do
82 EDITOR=$(which $i 2>/dev/null)
83 if ! [ -z $EDITOR ]; then
84 export EDITOR=$EDITOR
85 break
86 fi
87 done
88 [ -z $EDITOR ] && exiterror "You should have installed an editor."
89fi
90
91
92prepareenv() {
93 ############################################################################
94 # #
95 # Are we running the right shell? #
96 # #
97 ############################################################################
98 if [ ! "$BASH" ]; then
99 exiterror "BASH environment variable is not set. You're probably running the wrong shell."
100 fi
101
102 if [ -z "${BASH_VERSION}" ]; then
103 exiterror "Not running BASH shell."
104 fi
105
106
107 ############################################################################
108 # #
109 # Trap on emergency exit #
110 # #
111 ############################################################################
112 trap "exiterror 'Build process interrupted'" SIGINT SIGTERM SIGKILL SIGSTOP SIGQUIT
113
114
115 ############################################################################
116 # #
117 # Resetting our nice level #
118 # #
119 ############################################################################
120 echo -ne "Resetting our nice level to $NICE" | tee -a $LOGFILE
121 renice $NICE $$ > /dev/null
122 if [ `nice` != "$NICE" ]; then
123 beautify message FAIL
124 exiterror "Failed to set correct nice level"
125 else
126 beautify message DONE
127 fi
128
129
130 ############################################################################
131 # #
132 # Checking if running as root user #
133 # #
134 ############################################################################
135 echo -ne "Checking if we're running as root user" | tee -a $LOGFILE
136 if [ `id -u` != 0 ]; then
137 beautify message FAIL
138 exiterror "Not building as root"
139 else
140 beautify message DONE
141 fi
142
143
144 ############################################################################
145 # #
146 # Checking for necessary temporary space #
147 # #
148 ############################################################################
149 echo -ne "Checking for necessary space on disk $BASE_DEV" | tee -a $LOGFILE
150 BASE_DEV=`df -P -k $BASEDIR | tail -n 1 | awk '{ print $1 }'`
151 BASE_ASPACE=`df -P -k $BASEDIR | tail -n 1 | awk '{ print $4 }'`
152 if (( 2048000 > $BASE_ASPACE )); then
153 BASE_USPACE=`du -skx $BASEDIR | awk '{print $1}'`
154 if (( 2048000 - $BASE_USPACE > $BASE_ASPACE )); then
155 beautify message FAIL
156 exiterror "Not enough temporary space available, need at least 2GB on $BASE_DEV"
157 fi
158 else
159 beautify message DONE
160 fi
161
162 ############################################################################
163 # #
164 # Building Linux From Scratch system #
165 # #
166 ############################################################################
167 # Set umask
168 umask 022
169
170 # Set LFS Directory
171 LFS=$BASEDIR/build
172
173 # Check /tools symlink
174 if [ -h /tools ]; then
175 rm -f /tools
176 fi
177 if [ ! -a /tools ]; then
178 ln -s $BASEDIR/build/tools /
179 fi
180 if [ ! -h /tools ]; then
181 exiterror "Could not create /tools symbolic link."
182 fi
183
184 # Setup environment
185 set +h
186 LC_ALL=POSIX
187 if [ -z $MAKETUNING ]; then
188 CPU_COUNT="$(getconf _NPROCESSORS_ONLN 2>/dev/null)"
189 if [ -z "${CPU_COUNT}" ]; then
190 CPU_COUNT=1
191 fi
192
193 MAKETUNING="-j$(( ${CPU_COUNT} * 2 + 1 ))"
194 fi
195 export LFS LC_ALL CFLAGS CXXFLAGS MAKETUNING
196 unset CC CXX CPP LD_LIBRARY_PATH LD_PRELOAD
197
198 # Make some extra directories
199 mkdir -p $BASEDIR/build/{tools,etc,usr/src} 2>/dev/null
200 mkdir -p $BASEDIR/build/{dev/{shm,pts},proc,sys}
201 mkdir -p $BASEDIR/{cache,ccache} 2>/dev/null
202 mkdir -p $BASEDIR/build/usr/src/{cache,config,doc,html,langs,lfs,log,src,ccache}
203
204 mknod -m 600 $BASEDIR/build/dev/console c 5 1 2>/dev/null
205 mknod -m 666 $BASEDIR/build/dev/null c 1 3 2>/dev/null
206
207 # Make all sources and proc available under lfs build
208 mount --bind /dev $BASEDIR/build/dev
209 mount --bind /dev/pts $BASEDIR/build/dev/pts
210 mount --bind /dev/shm $BASEDIR/build/dev/shm
211 mount --bind /proc $BASEDIR/build/proc
212 mount --bind /sys $BASEDIR/build/sys
213 mount --bind $BASEDIR/cache $BASEDIR/build/usr/src/cache
214 mount --bind $BASEDIR/ccache $BASEDIR/build/usr/src/ccache
215 mount --bind $BASEDIR/config $BASEDIR/build/usr/src/config
216 mount --bind $BASEDIR/doc $BASEDIR/build/usr/src/doc
217 mount --bind $BASEDIR/html $BASEDIR/build/usr/src/html
218 mount --bind $BASEDIR/langs $BASEDIR/build/usr/src/langs
219 mount --bind $BASEDIR/lfs $BASEDIR/build/usr/src/lfs
220 mount --bind $BASEDIR/log $BASEDIR/build/usr/src/log
221 mount --bind $BASEDIR/src $BASEDIR/build/usr/src/src
222
223 # Run LFS static binary creation scripts one by one
224 export CCACHE_DIR=$BASEDIR/ccache
225 export CCACHE_COMPRESS=1
226 export CCACHE_COMPILERCHECK="string:toolchain-${TOOLCHAINVER} ${BUILD_ARCH}"
227
228 # Remove pre-install list of installed files in case user erase some files before rebuild
229 rm -f $BASEDIR/build/usr/src/lsalr 2>/dev/null
230
231 # Prepare string for /etc/system-release.
232 SYSTEM_RELEASE="${NAME} ${VERSION} (${BUILD_ARCH})"
233 if [ "$(git status -s | wc -l)" == "0" ]; then
234 GIT_STATUS=""
235 else
236 GIT_STATUS="-dirty"
237 fi
238 case "$GIT_BRANCH" in
239 core*|beta?|rc?)
240 SYSTEM_RELEASE="${SYSTEM_RELEASE} - $GIT_BRANCH$GIT_STATUS"
241 ;;
242 *)
243 SYSTEM_RELEASE="${SYSTEM_RELEASE} - Development Build: $GIT_BRANCH/$GIT_LASTCOMMIT$GIT_STATUS"
244 ;;
245 esac
246}
247
248buildtoolchain() {
249 local error=false
250 case "${BUILD_ARCH}:${HOST_ARCH}" in
251 # x86_64
252 x86_64:x86_64)
253 # This is working.
254 ;;
255
256 # x86
257 i586:i586|i586:i686|i586:x86_64)
258 # These are working.
259 ;;
260 i586:*)
261 error=true
262 ;;
263
264 # ARM
265 arvm7hl:armv7hl|armv7hl:armv7l)
266 # These are working.
267 ;;
268
269 armv5tel:armv5tel|armv5tel:armv5tejl|armv5tel:armv6l|armv5tel:armv7l|armv5tel:aarch64)
270 # These are working.
271 ;;
272 armv5tel:*)
273 error=true
274 ;;
275 esac
276
277 ${error} && \
278 exiterror "Cannot build ${BUILD_ARCH} toolchain on $(uname -m). Please use the download if any."
279
280 local gcc=$(type -p gcc)
281 if [ -z "${gcc}" ]; then
282 exiterror "Could not find GCC. You will need a working build enviroment in order to build the toolchain."
283 fi
284
285 LOGFILE="$BASEDIR/log/_build.toolchain.log"
286 export LOGFILE
287
288 lfsmake1 stage1
289 lfsmake1 ccache PASS=1
290 lfsmake1 binutils PASS=1
291 lfsmake1 gcc PASS=1
292 lfsmake1 linux KCFG="-headers"
293 lfsmake1 glibc
294 lfsmake1 gcc PASS=L
295 lfsmake1 binutils PASS=2
296 lfsmake1 gcc PASS=2
297 lfsmake1 ccache PASS=2
298 lfsmake1 tcl
299 lfsmake1 expect
300 lfsmake1 dejagnu
301 lfsmake1 pkg-config
302 lfsmake1 ncurses
303 lfsmake1 bash
304 lfsmake1 bzip2
305 lfsmake1 automake
306 lfsmake1 coreutils
307 lfsmake1 diffutils
308 lfsmake1 findutils
309 lfsmake1 gawk
310 lfsmake1 gettext
311 lfsmake1 grep
312 lfsmake1 gzip
313 lfsmake1 m4
314 lfsmake1 make
315 lfsmake1 patch
316 lfsmake1 perl
317 lfsmake1 sed
318 lfsmake1 tar
319 lfsmake1 texinfo
320 lfsmake1 xz
321 lfsmake1 fake-environ
322 lfsmake1 cleanup-toolchain
323}
324
325buildbase() {
326 LOGFILE="$BASEDIR/log/_build.base.log"
327 export LOGFILE
328 lfsmake2 stage2
329 lfsmake2 linux KCFG="-headers"
330 lfsmake2 man-pages
331 lfsmake2 glibc
332 lfsmake2 tzdata
333 lfsmake2 cleanup-toolchain
334 lfsmake2 zlib
335 lfsmake2 binutils
336 lfsmake2 gmp
337 lfsmake2 gmp-compat
338 lfsmake2 mpfr
339 lfsmake2 libmpc
340 lfsmake2 file
341 lfsmake2 gcc
342 lfsmake2 sed
343 lfsmake2 berkeley
344 lfsmake2 autoconf
345 lfsmake2 automake
346 lfsmake2 coreutils
347 lfsmake2 iana-etc
348 lfsmake2 m4
349 lfsmake2 bison
350 lfsmake2 ncurses-compat
351 lfsmake2 ncurses
352 lfsmake2 procps
353 lfsmake2 libtool
354 lfsmake2 perl
355 lfsmake2 readline
356 lfsmake2 readline-compat
357 lfsmake2 bzip2
358 lfsmake2 pcre
359 lfsmake2 pcre-compat
360 lfsmake2 bash
361 lfsmake2 diffutils
362 lfsmake2 e2fsprogs
363 lfsmake2 ed
364 lfsmake2 findutils
365 lfsmake2 flex
366 lfsmake2 gawk
367 lfsmake2 gettext
368 lfsmake2 grep
369 lfsmake2 groff
370 lfsmake2 gperf
371 lfsmake2 gzip
372 lfsmake2 hostname
373 lfsmake2 iproute2
374 lfsmake2 jwhois
375 lfsmake2 kbd
376 lfsmake2 less
377 lfsmake2 make
378 lfsmake2 man
379 lfsmake2 kmod
380 lfsmake2 net-tools
381 lfsmake2 patch
382 lfsmake2 psmisc
383 lfsmake2 shadow
384 lfsmake2 sysklogd
385 lfsmake2 sysvinit
386 lfsmake2 tar
387 lfsmake2 texinfo
388 lfsmake2 util-linux
389 lfsmake2 udev
390 lfsmake2 vim
391 lfsmake2 xz
392}
393
394buildipfire() {
395 LOGFILE="$BASEDIR/log/_build.ipfire.log"
396 export LOGFILE
397 ipfiremake configroot
398 ipfiremake initscripts
399 ipfiremake backup
400 ipfiremake pkg-config
401 ipfiremake libusb
402 ipfiremake libusb-compat
403 ipfiremake libpcap
404 ipfiremake ppp
405 ipfiremake pptp
406 ipfiremake unzip
407 ipfiremake which
408 ipfiremake linux-firmware
409 ipfiremake ath10k-firmware
410 ipfiremake dvb-firmwares
411 ipfiremake mt7601u-firmware
412 ipfiremake zd1211-firmware
413 ipfiremake rpi-firmware
414 ipfiremake bc
415 ipfiremake u-boot
416 ipfiremake cpio
417 ipfiremake mdadm
418 ipfiremake dracut
419 ipfiremake lvm2
420 ipfiremake multipath-tools
421 ipfiremake freetype
422 ipfiremake grub
423 ipfiremake libmnl
424 ipfiremake libnfnetlink
425 ipfiremake libnetfilter_queue
426 ipfiremake libnetfilter_conntrack
427 ipfiremake libnetfilter_cthelper
428 ipfiremake libnetfilter_cttimeout
429 ipfiremake iptables
430
431 case "${BUILD_ARCH}" in
432 x86_64)
433 ipfiremake linux KCFG=""
434 ipfiremake backports KCFG=""
435 ipfiremake e1000e KCFG=""
436 ipfiremake igb KCFG=""
437 ipfiremake ixgbe KCFG=""
438 ipfiremake xtables-addons KCFG=""
439 ipfiremake linux-initrd KCFG=""
440 ;;
441 i586)
442 # x86-pae (Native and new XEN) kernel build
443 ipfiremake linux KCFG="-pae"
444 ipfiremake backports KCFG="-pae"
445 ipfiremake e1000e KCFG="-pae"
446 ipfiremake igb KCFG="-pae"
447 ipfiremake ixgbe KCFG="-pae"
448 ipfiremake xtables-addons KCFG="-pae"
449 ipfiremake linux-initrd KCFG="-pae"
450
451 # x86 kernel build
452 ipfiremake linux KCFG=""
453 ipfiremake backports KCFG=""
454 ipfiremake e1000e KCFG=""
455 ipfiremake igb KCFG=""
456 ipfiremake ixgbe KCFG=""
457 ipfiremake xtables-addons KCFG=""
458 ipfiremake linux-initrd KCFG=""
459 ;;
460
461 armv5tel)
462 # arm-rpi (Raspberry Pi) kernel build
463 ipfiremake linux KCFG="-rpi"
464 ipfiremake backports KCFG="-rpi"
465 ipfiremake xtables-addons KCFG="-rpi"
466 ipfiremake linux-initrd KCFG="-rpi"
467
468 # arm multi platform (Panda, Wandboard ...) kernel build
469 ipfiremake linux KCFG="-multi"
470 ipfiremake backports KCFG="-multi"
471 ipfiremake e1000e KCFG="-multi"
472 ipfiremake igb KCFG="-multi"
473 ipfiremake ixgbe KCFG="-multi"
474 ipfiremake xtables-addons KCFG="-multi"
475 ipfiremake linux-initrd KCFG="-multi"
476
477 # arm-kirkwood (Dreamplug, ICY-Box ...) kernel build
478 ipfiremake linux KCFG="-kirkwood"
479 ipfiremake backports KCFG="-kirkwood"
480 ipfiremake e1000e KCFG="-kirkwood"
481 ipfiremake igb KCFG="-kirkwood"
482 ipfiremake ixgbe KCFG="-kirkwood"
483 ipfiremake xtables-addons KCFG="-kirkwood"
484 ipfiremake linux-initrd KCFG="-kirkwood"
485 ;;
486 esac
487 ipfiremake xtables-addons USPACE="1"
488 ipfiremake openssl
489 [ "${BUILD_ARCH}" = "i586" ] && ipfiremake openssl KCFG='-sse2'
490 ipfiremake libgpg-error
491 ipfiremake libgcrypt
492 ipfiremake libassuan
493 ipfiremake nettle
494 ipfiremake libevent
495 ipfiremake libevent2
496 ipfiremake libevent2-compat
497 ipfiremake expat
498 ipfiremake unbound
499 ipfiremake gnutls
500 ipfiremake bind
501 ipfiremake dhcp
502 ipfiremake dhcpcd
503 ipfiremake boost
504 ipfiremake linux-atm
505 ipfiremake gdbm
506 ipfiremake pam
507 ipfiremake curl
508 ipfiremake tcl
509 ipfiremake sqlite
510 ipfiremake libffi
511 ipfiremake python
512 ipfiremake python3
513 ipfiremake ca-certificates
514 ipfiremake fireinfo
515 ipfiremake libnet
516 ipfiremake libnl
517 ipfiremake libnl-3
518 ipfiremake libidn
519 ipfiremake nasm
520 ipfiremake libjpeg
521 ipfiremake libjpeg-compat
522 ipfiremake libexif
523 ipfiremake libpng
524 ipfiremake libtiff
525 ipfiremake libart
526 ipfiremake gd
527 ipfiremake popt
528 ipfiremake pcre
529 ipfiremake slang
530 ipfiremake newt
531 ipfiremake libsmooth
532 ipfiremake attr
533 ipfiremake acl
534 ipfiremake libcap
535 ipfiremake pciutils
536 ipfiremake usbutils
537 ipfiremake libxml2
538 ipfiremake libxslt
539 ipfiremake BerkeleyDB
540 ipfiremake mysql
541 ipfiremake cyrus-sasl
542 ipfiremake openldap
543 ipfiremake apache2
544 ipfiremake php
545 ipfiremake web-user-interface
546 ipfiremake flag-icons
547 ipfiremake jquery
548 ipfiremake arping
549 ipfiremake beep
550 ipfiremake dvdrtools
551 ipfiremake dosfstools
552 ipfiremake reiserfsprogs
553 ipfiremake xfsprogs
554 ipfiremake sysfsutils
555 ipfiremake fuse
556 ipfiremake ntfs-3g
557 ipfiremake ethtool
558 ipfiremake ez-ipupdate
559 ipfiremake fcron
560 ipfiremake perl-GD
561 ipfiremake GD-Graph
562 ipfiremake GD-TextUtil
563 ipfiremake perl-Device-SerialPort
564 ipfiremake perl-Device-Modem
565 ipfiremake perl-Apache-Htpasswd
566 ipfiremake gnupg
567 ipfiremake hdparm
568 ipfiremake sdparm
569 ipfiremake mtools
570 ipfiremake whatmask
571 ipfiremake conntrack-tools
572 ipfiremake libupnp
573 ipfiremake ipaddr
574 ipfiremake iputils
575 ipfiremake l7-protocols
576 ipfiremake mISDNuser
577 ipfiremake capi4k-utils
578 ipfiremake hwdata
579 ipfiremake logrotate
580 ipfiremake logwatch
581 ipfiremake misc-progs
582 ipfiremake nano
583 ipfiremake URI
584 ipfiremake HTML-Tagset
585 ipfiremake HTML-Parser
586 ipfiremake HTML-Template
587 ipfiremake Compress-Zlib
588 ipfiremake Digest
589 ipfiremake Digest-SHA1
590 ipfiremake Digest-HMAC
591 ipfiremake libwww-perl
592 ipfiremake Net-DNS
593 ipfiremake Net-IPv4Addr
594 ipfiremake Net_SSLeay
595 ipfiremake IO-Stringy
596 ipfiremake IO-Socket-SSL
597 ipfiremake Unix-Syslog
598 ipfiremake Mail-Tools
599 ipfiremake MIME-Tools
600 ipfiremake Net-Server
601 ipfiremake Convert-TNEF
602 ipfiremake Convert-UUlib
603 ipfiremake Archive-Tar
604 ipfiremake Archive-Zip
605 ipfiremake Text-Tabs+Wrap
606 ipfiremake Locale-Country
607 ipfiremake XML-Parser
608 ipfiremake Crypt-PasswdMD5
609 ipfiremake Net-Telnet
610 ipfiremake python-setuptools
611 ipfiremake python-clientform
612 ipfiremake python-mechanize
613 ipfiremake python-feedparser
614 ipfiremake python-rssdler
615 ipfiremake python-inotify
616 ipfiremake python-docutils
617 ipfiremake python-daemon
618 ipfiremake python-ipaddress
619 ipfiremake glib
620 ipfiremake GeoIP
621 ipfiremake fwhits
622 ipfiremake noip_updater
623 ipfiremake ntp
624 ipfiremake openssh
625 ipfiremake fontconfig
626 ipfiremake dejavu-fonts-ttf
627 ipfiremake freefont
628 ipfiremake pixman
629 ipfiremake cairo
630 ipfiremake pango
631 ipfiremake rrdtool
632 ipfiremake setserial
633 ipfiremake setup
634 ipfiremake libdnet
635 ipfiremake daq
636 ipfiremake snort
637 ipfiremake oinkmaster
638 ipfiremake squid
639 ipfiremake squidguard
640 ipfiremake calamaris
641 ipfiremake tcpdump
642 ipfiremake traceroute
643 ipfiremake vlan
644 ipfiremake wireless
645 ipfiremake pakfire
646 ipfiremake spandsp
647 ipfiremake lzo
648 ipfiremake openvpn
649 ipfiremake pammysql
650 ipfiremake mpage
651 ipfiremake dbus
652 ipfiremake intltool
653 ipfiremake libdaemon
654 ipfiremake cups
655 ipfiremake ghostscript
656 ipfiremake lcms2
657 ipfiremake qpdf
658 ipfiremake poppler
659 ipfiremake cups-filters
660 ipfiremake epson-inkjet-printer-escpr
661 ipfiremake foomatic
662 ipfiremake hplip
663 ipfiremake cifs-utils
664 ipfiremake krb5
665 ipfiremake samba
666 ipfiremake sudo
667 ipfiremake mc
668 ipfiremake wget
669 ipfiremake bridge-utils
670 ipfiremake screen
671 ipfiremake smartmontools
672 ipfiremake htop
673 ipfiremake chkconfig
674 ipfiremake postfix
675 ipfiremake fetchmail
676 ipfiremake cyrus-imapd
677 ipfiremake openmailadmin
678 ipfiremake clamav
679 ipfiremake spamassassin
680 ipfiremake amavisd
681 ipfiremake dma
682 ipfiremake alsa
683 ipfiremake mpfire
684 ipfiremake guardian
685 ipfiremake libid3tag
686 ipfiremake libmad
687 ipfiremake libogg
688 ipfiremake libvorbis
689 ipfiremake libdvbpsi
690 ipfiremake flac
691 ipfiremake lame
692 ipfiremake sox
693 ipfiremake libshout
694 ipfiremake xvid
695 ipfiremake libmpeg2
696 ipfiremake libarchive
697 ipfiremake cmake
698 ipfiremake gnump3d
699 ipfiremake rsync
700 ipfiremake tcpwrapper
701 ipfiremake libtirpc
702 ipfiremake rpcbind
703 ipfiremake nfs
704 ipfiremake gnu-netcat
705 ipfiremake ncat
706 ipfiremake nmap
707 ipfiremake ncftp
708 ipfiremake etherwake
709 ipfiremake bwm-ng
710 ipfiremake sysstat
711 ipfiremake vsftpd
712 ipfiremake strongswan
713 ipfiremake rng-tools
714 ipfiremake lsof
715 ipfiremake br2684ctl
716 ipfiremake pcmciautils
717 ipfiremake lm_sensors
718 ipfiremake liboping
719 ipfiremake collectd
720 ipfiremake elinks
721 ipfiremake igmpproxy
722 ipfiremake fbset
723 ipfiremake opus
724 ipfiremake python-six
725 ipfiremake python-pyparsing
726 ipfiremake spice-protocol
727 ipfiremake spice
728 ipfiremake sdl
729 ipfiremake libusbredir
730 ipfiremake qemu
731 ipfiremake sane
732 ipfiremake netpbm
733 ipfiremake phpSANE
734 ipfiremake tunctl
735 ipfiremake netsnmpd
736 ipfiremake nagios
737 ipfiremake nagios_nrpe
738 ipfiremake icinga
739 ipfiremake ebtables
740 ipfiremake directfb
741 ipfiremake dfb++
742 ipfiremake faad2
743 ipfiremake ffmpeg
744 ipfiremake vdr
745 ipfiremake vdr_streamdev
746 ipfiremake vdr_vnsiserver5
747 ipfiremake vdr_epgsearch
748 ipfiremake vdr_dvbapi
749 ipfiremake vdr_eepg
750 ipfiremake w_scan
751 ipfiremake icecast
752 ipfiremake icegenerator
753 ipfiremake mpd
754 ipfiremake libmpdclient
755 ipfiremake mpc
756 ipfiremake perl-Net-SMTP-SSL
757 ipfiremake perl-MIME-Base64
758 ipfiremake perl-Authen-SASL
759 ipfiremake perl-MIME-Lite
760 ipfiremake perl-Email-Date-Format
761 ipfiremake git
762 ipfiremake squidclamav
763 ipfiremake vnstat
764 ipfiremake iw
765 ipfiremake wpa_supplicant
766 ipfiremake hostapd
767 ipfiremake pycurl
768 ipfiremake urlgrabber
769 ipfiremake syslinux
770 ipfiremake tftpd
771 ipfiremake cpufrequtils
772 ipfiremake bluetooth
773 ipfiremake gutenprint
774 ipfiremake apcupsd
775 ipfiremake iperf
776 ipfiremake iperf3
777 ipfiremake 7zip
778 ipfiremake lynis
779 ipfiremake streamripper
780 ipfiremake sshfs
781 ipfiremake taglib
782 #ipfiremake mediatomb
783 ipfiremake sslh
784 ipfiremake perl-gettext
785 ipfiremake perl-Sort-Naturally
786 ipfiremake vdradmin
787 ipfiremake miau
788 ipfiremake perl-DBI
789 ipfiremake perl-DBD-mysql
790 ipfiremake perl-DBD-SQLite
791 ipfiremake perl-File-ReadBackwards
792 ipfiremake cacti
793 ipfiremake openvmtools
794 ipfiremake nagiosql
795 ipfiremake iftop
796 ipfiremake motion
797 ipfiremake joe
798 ipfiremake monit
799 ipfiremake nut
800 ipfiremake watchdog
801 ipfiremake libpri
802 ipfiremake libsrtp
803 ipfiremake asterisk
804 ipfiremake lcr
805 ipfiremake usb_modeswitch
806 ipfiremake usb_modeswitch_data
807 ipfiremake zerofree
808 ipfiremake pound
809 ipfiremake minicom
810 ipfiremake ddrescue
811 ipfiremake imspector
812 ipfiremake miniupnpd
813 ipfiremake client175
814 ipfiremake powertop
815 ipfiremake parted
816 ipfiremake swig
817 ipfiremake python-m2crypto
818 ipfiremake wireless-regdb
819 ipfiremake crda
820 ipfiremake libsolv
821 ipfiremake python-distutils-extra
822 ipfiremake python-lzma
823 ipfiremake python-progressbar
824 ipfiremake python-xattr
825 ipfiremake ddns
826 ipfiremake transmission
827 ipfiremake dpfhack
828 ipfiremake lcd4linux
829 ipfiremake mtr
830 ipfiremake tcpick
831 ipfiremake minidlna
832 ipfiremake acpid
833 ipfiremake fping
834 ipfiremake telnet
835 ipfiremake xinetd
836 ipfiremake gpgme
837 ipfiremake pygpgme
838 ipfiremake pakfire3
839 ipfiremake stress
840 ipfiremake libstatgrab
841 ipfiremake sarg
842 ipfiremake check_mk_agent
843 ipfiremake nginx
844 ipfiremake sendEmail
845 ipfiremake sysbench
846 ipfiremake strace
847 ipfiremake elfutils
848 ipfiremake ltrace
849 ipfiremake ipfire-netboot
850 ipfiremake lcdproc
851 ipfiremake bitstream
852 ipfiremake multicat
853 ipfiremake keepalived
854 ipfiremake ipvsadm
855 ipfiremake perl-Carp-Clan
856 ipfiremake perl-Date-Calc
857 ipfiremake perl-Date-Manip
858 ipfiremake perl-File-Tail
859 ipfiremake perl-TimeDate
860 ipfiremake swatch
861 ipfiremake tor
862 ipfiremake arm
863 ipfiremake wavemon
864 ipfiremake iptraf-ng
865 ipfiremake iotop
866 ipfiremake stunnel
867 ipfiremake sslscan
868 ipfiremake owncloud
869 ipfiremake bacula
870 ipfiremake batctl
871 ipfiremake perl-PDF-API2
872 ipfiremake squid-accounting
873 ipfiremake pigz
874 ipfiremake tmux
875 ipfiremake perl-Text-CSV_XS
876 ipfiremake swconfig
877 ipfiremake haproxy
878 ipfiremake ipset
879 ipfiremake lua
880 ipfiremake dnsdist
881 ipfiremake bird
882 ipfiremake dmidecode
883 ipfiremake mcelog
884 ipfiremake rtpproxy
885 ipfiremake util-macros
886 ipfiremake libpciaccess
887 ipfiremake libyajl
888 ipfiremake libvirt
889 ipfiremake python3-libvirt
890 ipfiremake freeradius
891 ipfiremake perl-common-sense
892 ipfiremake perl-inotify2
893 ipfiremake perl-Net-IP
894}
895
896buildinstaller() {
897 # Run installer scripts one by one
898 LOGFILE="$BASEDIR/log/_build.installer.log"
899 export LOGFILE
900 ipfiremake memtest
901 ipfiremake installer
902 installmake strip
903}
904
905buildpackages() {
906 LOGFILE="$BASEDIR/log/_build.packages.log"
907 export LOGFILE
908 echo "... see detailed log in _build.*.log files" >> $LOGFILE
909
910
911 # Generating list of packages used
912 echo -n "Generating packages list from logs" | tee -a $LOGFILE
913 rm -f $BASEDIR/doc/packages-list
914 for i in `ls -1tr $BASEDIR/log/[^_]*`; do
915 if [ "$i" != "$BASEDIR/log/FILES" -a -n $i ]; then
916 echo "* `basename $i`" >>$BASEDIR/doc/packages-list
917 fi
918 done
919 echo "== List of softwares used to build $NAME Version: $VERSION ==" > $BASEDIR/doc/packages-list.txt
920 grep -v 'configroot$\|img$\|initrd$\|initscripts$\|installer$\|install$\|setup$\|pakfire$\|stage2$\|smp$\|tools$\|tools1$\|tools2$\|.tgz$\|-config$\|_missing_rootfile$\|install1$\|install2$\|pass1$\|pass2$\|pass3$' \
921 $BASEDIR/doc/packages-list | sort >> $BASEDIR/doc/packages-list.txt
922 rm -f $BASEDIR/doc/packages-list
923 # packages-list.txt is ready to be displayed for wiki page
924 beautify message DONE
925
926 # Update changelog
927 cd $BASEDIR
928 [ -z $GIT_TAG ] || LAST_TAG=$GIT_TAG
929 [ -z $LAST_TAG ] || EXT="$LAST_TAG..HEAD"
930 git log -n 500 --no-merges --pretty=medium --shortstat $EXT > $BASEDIR/doc/ChangeLog
931
932 # Create images for install
933 ipfiremake cdrom
934
935 # Check if there is a loop device for building in virtual environments
936 modprobe loop 2>/dev/null
937 if [ $BUILD_IMAGES == 1 ] && ([ -e /dev/loop/0 ] || [ -e /dev/loop0 ] || [ -e "/dev/loop-control" ]); then
938 ipfiremake flash-images
939 ipfiremake flash-images SCON=1
940 fi
941
942 mv $LFS/install/images/{*.iso,*.tgz,*.img.gz,*.bz2} $BASEDIR >> $LOGFILE 2>&1
943
944 ipfirepackages
945
946 ipfiremake xen-image
947 mv $LFS/install/images/*.bz2 $BASEDIR >> $LOGFILE 2>&1
948
949 cd $BASEDIR
950
951 # remove not useable iso on armv5tel (needed to build flash images)
952 [ "${BUILD_ARCH}" = "armv5tel" ] && rm -rf *.iso
953
954 for i in `ls *.bz2 *.img.gz *.iso`; do
955 md5sum $i > $i.md5
956 done
957 cd $PWD
958
959 # Cleanup
960 stdumount
961 rm -rf $BASEDIR/build/tmp/*
962
963 # Generating total list of files
964 echo -n "Generating files list from logs" | tee -a $LOGFILE
965 rm -f $BASEDIR/log/FILES
966 for i in `ls -1tr $BASEDIR/log/[^_]*`; do
967 if [ "$i" != "$BASEDIR/log/FILES" -a -n $i ]; then
968 echo "##" >>$BASEDIR/log/FILES
969 echo "## `basename $i`" >>$BASEDIR/log/FILES
970 echo "##" >>$BASEDIR/log/FILES
971 cat $i | sed "s%^\./%#%" | sort >> $BASEDIR/log/FILES
972 fi
973 done
974 beautify message DONE
975
976 cd $PWD
977}
978
979ipfirepackages() {
980 ipfiremake core-updates
981
982 local i
983 for i in $(find $BASEDIR/config/rootfiles/packages{/${BUILD_ARCH},} -maxdepth 1 -type f); do
984 i=$(basename ${i})
985 if [ -e $BASEDIR/lfs/$i ]; then
986 ipfiredist $i
987 else
988 echo -n $i
989 beautify message SKIP
990 fi
991 done
992 test -d $BASEDIR/packages || mkdir $BASEDIR/packages
993 mv -f $LFS/install/packages/* $BASEDIR/packages >> $LOGFILE 2>&1
994 rm -rf $BASEDIR/build/install/packages/*
995}
996
997while [ $# -gt 0 ]; do
998 case "${1}" in
999 --target=*)
1000 configure_target "${1#--target=}"
1001 ;;
1002 -*)
1003 exiterror "Unknown configuration option: ${1}"
1004 ;;
1005 *)
1006 # Found a command, so exit options parsing.
1007 break
1008 ;;
1009 esac
1010 shift
1011done
1012
1013# See what we're supposed to do
1014case "$1" in
1015build)
1016 clear
1017 PACKAGE=`ls -v -r $BASEDIR/cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.tar.gz 2> /dev/null | head -n 1`
1018 #only restore on a clean disk
1019 if [ ! -e "${BASEDIR}/build/tools/.toolchain-successful" ]; then
1020 if [ ! -n "$PACKAGE" ]; then
1021 beautify build_stage "Full toolchain compilation - Native GCC: `gcc --version | grep GCC | awk {'print $3'}`"
1022 prepareenv
1023 buildtoolchain
1024 else
1025 PACKAGENAME=${PACKAGE%.tar.gz}
1026 beautify build_stage "Packaged toolchain compilation"
1027 if [ `md5sum $PACKAGE | awk '{print $1}'` == `cat $PACKAGENAME.md5 | awk '{print $1}'` ]; then
1028 tar zxf $PACKAGE
1029 prepareenv
1030 else
1031 exiterror "$PACKAGENAME md5 did not match, check downloaded package"
1032 fi
1033 fi
1034 else
1035 echo -n "Using installed toolchain" | tee -a $LOGFILE
1036 beautify message SKIP
1037 prepareenv
1038 fi
1039
1040 beautify build_start
1041 beautify build_stage "Building LFS"
1042 buildbase
1043
1044 beautify build_stage "Building IPFire"
1045 buildipfire
1046
1047 beautify build_stage "Building installer"
1048 buildinstaller
1049
1050 beautify build_stage "Building packages"
1051 buildpackages
1052
1053 beautify build_stage "Checking Logfiles for new Files"
1054
1055 cd $BASEDIR
1056 tools/checknewlog.pl
1057 tools/checkrootfiles
1058 cd $PWD
1059
1060 beautify build_end
1061 ;;
1062shell)
1063 # enter a shell inside LFS chroot
1064 # may be used to changed kernel settings
1065 prepareenv
1066 entershell
1067 ;;
1068clean)
1069 echo -en "${BOLD}Cleaning build directory...${NORMAL}"
1070 for i in `mount | grep $BASEDIR | sed 's/^.*loop=\(.*\))/\1/'`; do
1071 $LOSETUP -d $i 2>/dev/null
1072 done
1073 for i in `mount | grep $BASEDIR | cut -d " " -f 1`; do
1074 umount $i
1075 done
1076 stdumount
1077 for i in `seq 0 7`; do
1078 if ( losetup /dev/loop${i} 2>/dev/null | grep -q "/install/images" ); then
1079 umount /dev/loop${i} 2>/dev/null;
1080 losetup -d /dev/loop${i} 2>/dev/null;
1081 fi;
1082 done
1083 rm -rf $BASEDIR/build
1084 rm -rf $BASEDIR/cdrom
1085 rm -rf $BASEDIR/packages
1086 rm -rf $BASEDIR/log
1087 if [ -h /tools ]; then
1088 rm -f /tools
1089 fi
1090 rm -f $BASEDIR/ipfire-*
1091 beautify message DONE
1092 ;;
1093downloadsrc)
1094 if [ ! -d $BASEDIR/cache ]; then
1095 mkdir $BASEDIR/cache
1096 fi
1097 mkdir -p $BASEDIR/log
1098 echo -e "${BOLD}Preload all source files${NORMAL}" | tee -a $LOGFILE
1099 FINISHED=0
1100 cd $BASEDIR/lfs
1101 for c in `seq $MAX_RETRIES`; do
1102 if (( FINISHED==1 )); then
1103 break
1104 fi
1105 FINISHED=1
1106 cd $BASEDIR/lfs
1107 for i in *; do
1108 if [ -f "$i" -a "$i" != "Config" ]; then
1109 lfsmakecommoncheck ${i} || continue
1110
1111 make -s -f $i LFS_BASEDIR=$BASEDIR BUILD_ARCH="${BUILD_ARCH}" \
1112 MESSAGE="$i\t ($c/$MAX_RETRIES)" download >> $LOGFILE 2>&1
1113 if [ $? -ne 0 ]; then
1114 beautify message FAIL
1115 FINISHED=0
1116 else
1117 if [ $c -eq 1 ]; then
1118 beautify message DONE
1119 fi
1120 fi
1121 fi
1122 done
1123 done
1124 echo -e "${BOLD}***Verifying md5sums${NORMAL}"
1125 ERROR=0
1126 for i in *; do
1127 if [ -f "$i" -a "$i" != "Config" ]; then
1128 lfsmakecommoncheck ${i} > /dev/null || continue
1129 make -s -f $i LFS_BASEDIR=$BASEDIR BUILD_ARCH="${BUILD_ARCH}" \
1130 MESSAGE="$i\t " md5 >> $LOGFILE 2>&1
1131 if [ $? -ne 0 ]; then
1132 echo -ne "MD5 difference in lfs/$i"
1133 beautify message FAIL
1134 ERROR=1
1135 fi
1136 fi
1137 done
1138 if [ $ERROR -eq 0 ]; then
1139 echo -ne "${BOLD}all files md5sum match${NORMAL}"
1140 beautify message DONE
1141 else
1142 echo -ne "${BOLD}not all files were correctly download${NORMAL}"
1143 beautify message FAIL
1144 fi
1145 cd - >/dev/null 2>&1
1146 ;;
1147toolchain)
1148 clear
1149 prepareenv
1150 beautify build_stage "Toolchain compilation - Native GCC: `gcc --version | grep GCC | awk {'print $3'}`"
1151 buildtoolchain
1152 echo "`date -u '+%b %e %T'`: Create toolchain tar.gz for ${BUILD_ARCH}" | tee -a $LOGFILE
1153 test -d $BASEDIR/cache/toolchains || mkdir -p $BASEDIR/cache/toolchains
1154 cd $BASEDIR && tar -zc --exclude='log/_build.*.log' -f cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.tar.gz \
1155 build/tools build/bin/sh log >> $LOGFILE
1156 md5sum cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.tar.gz \
1157 > cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.md5
1158 stdumount
1159 ;;
1160gettoolchain)
1161 # arbitrary name to be updated in case of new toolchain package upload
1162 PACKAGE=$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}
1163 if [ ! -f $BASEDIR/cache/toolchains/$PACKAGE.tar.gz ]; then
1164 URL_TOOLCHAIN=`grep URL_TOOLCHAIN lfs/Config | awk '{ print $3 }'`
1165 test -d $BASEDIR/cache/toolchains || mkdir -p $BASEDIR/cache/toolchains
1166 echo "`date -u '+%b %e %T'`: Load toolchain tar.gz for ${BUILD_ARCH}" | tee -a $LOGFILE
1167 cd $BASEDIR/cache/toolchains
1168 wget -U "IPFireSourceGrabber/2.x" $URL_TOOLCHAIN/$PACKAGE.tar.gz $URL_TOOLCHAIN/$PACKAGE.md5 >& /dev/null
1169 if [ $? -ne 0 ]; then
1170 echo "`date -u '+%b %e %T'`: error downloading $PACKAGE toolchain for ${BUILD_ARCH} machine" | tee -a $LOGFILE
1171 else
1172 if [ "`md5sum $PACKAGE.tar.gz | awk '{print $1}'`" = "`cat $PACKAGE.md5 | awk '{print $1}'`" ]; then
1173 echo "`date -u '+%b %e %T'`: toolchain md5 ok" | tee -a $LOGFILE
1174 else
1175 exiterror "$PACKAGE.md5 did not match, check downloaded package"
1176 fi
1177 fi
1178 else
1179 echo "Toolchain is already downloaded. Exiting..."
1180 fi
1181 ;;
1182othersrc)
1183 prepareenv
1184 echo -ne "`date -u '+%b %e %T'`: Build sources iso for ${BUILD_ARCH}" | tee -a $LOGFILE
1185 chroot $LFS /tools/bin/env -i HOME=/root \
1186 TERM=$TERM PS1='\u:\w\$ ' \
1187 PATH=/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin \
1188 VERSION=$VERSION NAME="$NAME" SNAME="$SNAME" BUILD_ARCH="${BUILD_ARCH}" \
1189 /bin/bash -x -c "cd /usr/src/lfs && make -f sources-iso LFS_BASEDIR=/usr/src install" >>$LOGFILE 2>&1
1190 mv $LFS/install/images/ipfire-* $BASEDIR >> $LOGFILE 2>&1
1191 if [ $? -eq "0" ]; then
1192 beautify message DONE
1193 else
1194 beautify message FAIL
1195 fi
1196 stdumount
1197 ;;
1198uploadsrc)
1199 PWD=`pwd`
1200 if [ -z $IPFIRE_USER ]; then
1201 echo -n "You have to setup IPFIRE_USER first. See .config for details."
1202 beautify message FAIL
1203 exit 1
1204 fi
1205
1206 URL_SOURCE=$(grep URL_SOURCE lfs/Config | awk '{ print $3 }')
1207 REMOTE_FILES=$(echo "ls -1" | sftp -C ${IPFIRE_USER}@${URL_SOURCE})
1208
1209 for file in ${BASEDIR}/cache/*; do
1210 [ -d "${file}" ] && continue
1211 grep -q "$(basename ${file})" <<<$REMOTE_FILES && continue
1212 NEW_FILES="$NEW_FILES $file"
1213 done
1214 [ -n "$NEW_FILES" ] && scp -2 $NEW_FILES ${IPFIRE_USER}@${URL_SOURCE}
1215 cd $BASEDIR
1216 cd $PWD
1217 exit 0
1218 ;;
1219lang)
1220 update_langs
1221 ;;
1222*)
1223 echo "Usage: $0 {build|changelog|clean|gettoolchain|downloadsrc|shell|sync|toolchain}"
1224 cat doc/make.sh-usage
1225 ;;
1226esac