]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - make.sh
core81: set need reboot flag and restart apache.
[people/teissler/ipfire-2.x.git] / make.sh
diff --git a/make.sh b/make.sh
index ef98d6fa315066bdd9f15fb6f6b34059dd22e400..bfb9365156af574b0c8e29ec18aa4f87c8cadc65 100755 (executable)
--- a/make.sh
+++ b/make.sh
 # along with IPFire; if not, write to the Free Software                    #
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA #
 #                                                                          #
-# Copyright (C) 2007-2013 IPFire Team <info@ipfire.org>.                   #
+# Copyright (C) 2007-2014 IPFire Team <info@ipfire.org>.                   #
 #                                                                          #
 ############################################################################
 #
 
 NAME="IPFire"                                                  # Software name
 SNAME="ipfire"                                                 # Short name
-VERSION="2.13"                                                 # Version number
-CORE="73"                                                      # Core Level (Filename)
-PAKFIRE_CORE="73"                                              # Core Level (PAKFIRE)
-GIT_BRANCH=`git status | head -n1 | cut -d" " -f4`             # Git Branch
+VERSION="2.15"                                                 # Version number
+CORE="81"                                                      # Core Level (Filename)
+PAKFIRE_CORE="81"                                              # Core Level (PAKFIRE)
+GIT_BRANCH=`git rev-parse --abbrev-ref HEAD`                   # Git Branch
 SLOGAN="www.ipfire.org"                                                # Software slogan
 CONFIG_ROOT=/var/ipfire                                                # Configuration rootdir
 NICE=10                                                                # Nice level
 MAX_RETRIES=1                                                  # prefetch/check loop
-BUILD_IMAGES=1                                                 # Build USB, Flash and Xen Images
+BUILD_IMAGES=1                                                 # Flash and Xen Downloader
 KVER=`grep --max-count=1 VER lfs/linux | awk '{ print $3 }'`
-MACHINE=`uname -m`
 GIT_TAG=$(git tag | tail -1)                                   # Git Tag
 GIT_LASTCOMMIT=$(git log | head -n1 | cut -d" " -f2 |head -c8) # Last commit
-TOOLCHAINVER=6
-
-BUILDMACHINE=$MACHINE
-    if [ "$MACHINE" = "x86_64" ]; then
-        BUILDMACHINE="i686";
-    fi
+TOOLCHAINVER=7
 
+# New architecture variables
+BUILD_ARCH="$(uname -m)"
+BUILDMACHINE="${BUILD_ARCH}"
 
 # Debian specific settings
 if [ ! -e /etc/debian_version ]; then
@@ -72,6 +69,12 @@ if [ -f .config ]; then
        . .config
 fi
 
+if [ -n "${TARGET_ARCH}" ]; then
+       configure_target "${TARGET_ARCH}"
+else
+       configure_target "default"
+fi
+
 if [ -z $EDITOR ]; then
        for i in nano emacs vi; do
                EDITOR=$(which $i 2>/dev/null)
@@ -83,6 +86,22 @@ if [ -z $EDITOR ]; then
        [ -z $EDITOR ] && exiterror "You should have installed an editor."
 fi
 
+# Prepare string for /etc/system-release.
+SYSTEM_RELEASE="${NAME} ${VERSION} (${MACHINE})"
+if [ "$(git status -s | wc -l)" == "0" ]; then
+       GIT_STATUS=""
+else
+       GIT_STATUS="-dirty"
+fi
+case "$GIT_BRANCH" in
+       core*|beta?|rc?)
+               SYSTEM_RELEASE="${SYSTEM_RELEASE} - $GIT_BRANCH$GIT_STATUS"
+               ;;
+       *)
+               SYSTEM_RELEASE="${SYSTEM_RELEASE} - Development Build: $GIT_BRANCH/$GIT_LASTCOMMIT$GIT_STATUS"
+               ;;
+esac
+
 prepareenv() {
     ############################################################################
     #                                                                          #
@@ -225,7 +244,7 @@ prepareenv() {
 
 buildtoolchain() {
     local error=false
-    case "${MACHINE}:$(uname -m)" in
+    case "${TARGET_ARCH}:${BUILD_ARCH}" in
         # x86
         i586:i586|i586:i686|i586:x86_64)
             # These are working.
@@ -336,7 +355,7 @@ buildbase() {
     lfsmake2 groff
     lfsmake2 gperf
     lfsmake2 gzip
-    lfsmake2 inetutils
+    lfsmake2 hostname
     lfsmake2 iproute2
     lfsmake2 jwhois
     lfsmake2 kbd
@@ -344,7 +363,7 @@ buildbase() {
     lfsmake2 make
     lfsmake2 man
     lfsmake2 mktemp
-    lfsmake2 module-init-tools
+    lfsmake2 kmod
     lfsmake2 net-tools
     lfsmake2 patch
     lfsmake2 psmisc
@@ -353,10 +372,11 @@ buildbase() {
     lfsmake2 sysvinit
     lfsmake2 tar
     lfsmake2 texinfo
-    lfsmake2 udev
     lfsmake2 util-linux
+    lfsmake2 udev
     lfsmake2 vim
     lfsmake2 xz
+    lfsmake2 paxctl
     lfsmake2 grub
 }
 
@@ -365,10 +385,8 @@ buildipfire() {
   export LOGFILE
   ipfiremake configroot
   ipfiremake backup
-  ipfiremake bind
-  ipfiremake dhcp
-  ipfiremake dhcpcd
   ipfiremake libusb
+  ipfiremake libusbx
   ipfiremake libpcap
   ipfiremake ppp
   ipfiremake pptp
@@ -378,85 +396,80 @@ buildipfire() {
   ipfiremake dvb-firmwares
   ipfiremake zd1211-firmware
   ipfiremake rpi-firmware
+  ipfiremake bc
   ipfiremake u-boot
 
-  if [ "${MACHINE_TYPE}" != "arm" ]; then
-
-    # x86-xen (Legacy XEN) kernel build
-    ipfiremake linux2                  KCFG="-xen"
-    ipfiremake v4l-dvb                 KCFG="-xen"
-    ipfiremake mISDN                   KCFG="-xen"
-    ipfiremake cryptodev               KCFG="-xen"
-    ipfiremake compat-drivers          KCFG="-xen"
-    ipfiremake r8169                   KCFG="-xen"
-    ipfiremake r8168                   KCFG="-xen"
-    ipfiremake r8101                   KCFG="-xen"
-    ipfiremake e1000                   KCFG="-xen"
-    ipfiremake e1000e                  KCFG="-xen"
-    ipfiremake igb                     KCFG="-xen"
-
-    # x86-pae (Native and new XEN) kernel build
-    ipfiremake linux                   KCFG="-pae"
-    ipfiremake kvm-kmod                        KCFG="-pae"
-    ipfiremake v4l-dvb                 KCFG="-pae"
-    ipfiremake mISDN                   KCFG="-pae"
-    ipfiremake cryptodev               KCFG="-pae"
-    ipfiremake compat-drivers          KCFG="-pae"
-    ipfiremake r8169                   KCFG="-pae"
-    ipfiremake r8168                   KCFG="-pae"
-    ipfiremake r8101                   KCFG="-pae"
-    ipfiremake e1000e                  KCFG="-pae"
-    ipfiremake igb                     KCFG="-pae"
-
-    # x86 kernel build
-    ipfiremake linux                   KCFG=""
-    ipfiremake kvm-kmod                        KCFG=""
-    ipfiremake v4l-dvb                 KCFG=""
-    ipfiremake mISDN                   KCFG=""
-    ipfiremake cryptodev               KCFG=""
-    ipfiremake compat-drivers          KCFG=""
-    ipfiremake r8169                   KCFG=""
-    ipfiremake r8168                   KCFG=""
-    ipfiremake r8101                   KCFG=""
-    ipfiremake e1000e                  KCFG=""
-    ipfiremake igb                     KCFG=""
-
-  else
-    # arm-rpi (Raspberry Pi) kernel build
-    ipfiremake linux                   KCFG="-rpi"
-    ipfiremake v4l-dvb                 KCFG="-rpi"
-    ipfiremake mISDN                   KCFG="-rpi" NOPCI=1
-    ipfiremake cryptodev               KCFG="-rpi"
-    ipfiremake compat-drivers          KCFG="-rpi"
-
-    # arm-omap (Panda Board) kernel build
-    ipfiremake linux                   KCFG="-omap"
-    ipfiremake v4l-dvb                 KCFG="-omap"
-    ipfiremake mISDN                   KCFG="-omap" NOPCI=1
-    ipfiremake cryptodev               KCFG="-omap"
-    ipfiremake compat-drivers          KCFG="-omap"
-
-    # arm-kirkwood (Dreamplug, ICY-Box ...) kernel build
-    ipfiremake linux                   KCFG="-kirkwood"
-    ipfiremake v4l-dvb                 KCFG="-kirkwood"
-    ipfiremake mISDN                   KCFG="-kirkwood"
-    ipfiremake cryptodev               KCFG="-kirkwood"
-    ipfiremake compat-drivers          KCFG="-kirkwood"
-    ipfiremake r8169                   KCFG="-kirkwood"
-    ipfiremake r8168                   KCFG="-kirkwood"
-    ipfiremake r8101                   KCFG="-kirkwood"
-#    ipfiremake e1000e                 KCFG="-kirkwood"
-    ipfiremake igb                     KCFG="-kirkwood"
-
-  fi
+  case "${TARGET_ARCH}" in
+       i586)
+               # x86-pae (Native and new XEN) kernel build
+               ipfiremake linux                        KCFG="-pae"
+#              ipfiremake kvm-kmod                     KCFG="-pae"
+#              ipfiremake v4l-dvb                      KCFG="-pae"
+#              ipfiremake mISDN                        KCFG="-pae"
+               ipfiremake cryptodev                    KCFG="-pae"
+#              ipfiremake compat-drivers               KCFG="-pae"
+#              ipfiremake r8169                        KCFG="-pae"
+#              ipfiremake r8168                        KCFG="-pae"
+#              ipfiremake r8101                        KCFG="-pae"
+               ipfiremake e1000e                       KCFG="-pae"
+               ipfiremake igb                          KCFG="-pae"
+
+               # x86 kernel build
+               ipfiremake linux                        KCFG=""
+#              ipfiremake kvm-kmod                     KCFG=""
+#              ipfiremake v4l-dvb                      KCFG=""
+#              ipfiremake mISDN                        KCFG=""
+               ipfiremake cryptodev                    KCFG=""
+#              ipfiremake compat-drivers               KCFG=""
+#              ipfiremake r8169                        KCFG=""
+#              ipfiremake r8168                        KCFG=""
+#              ipfiremake r8101                        KCFG=""
+               ipfiremake e1000e                       KCFG=""
+               ipfiremake igb                          KCFG=""
+               ;;
+
+       armv5tel)
+               # arm-rpi (Raspberry Pi) kernel build
+               ipfiremake linux                        KCFG="-rpi"
+#              ipfiremake v4l-dvb                      KCFG="-rpi"
+#              ipfiremake mISDN                        KCFG="-rpi" NOPCI=1
+               ipfiremake cryptodev                    KCFG="-rpi"
+#              ipfiremake compat-drivers               KCFG="-rpi"
+
+               # arm multi platform (Panda, Wandboard ...) kernel build
+               ipfiremake linux                        KCFG="-multi"
+               ipfiremake cryptodev                    KCFG="-multi"
+               ipfiremake e1000e                       KCFG="-multi"
+               ipfiremake igb                          KCFG="-multi"
+
+               # arm-kirkwood (Dreamplug, ICY-Box ...) kernel build
+               ipfiremake linux                        KCFG="-kirkwood"
+#              ipfiremake v4l-dvb                      KCFG="-kirkwood"
+#              ipfiremake mISDN                        KCFG="-kirkwood"
+               ipfiremake cryptodev                    KCFG="-kirkwood"
+#              ipfiremake compat-drivers               KCFG="-kirkwood"
+#              ipfiremake r8169                        KCFG="-kirkwood"
+#              ipfiremake r8168                        KCFG="-kirkwood"
+#              ipfiremake r8101                        KCFG="-kirkwood"
+#              ipfiremake e1000e                       KCFG="-kirkwood"
+               ipfiremake igb                          KCFG="-kirkwood"
+               ;;
+  esac
   ipfiremake pkg-config
+  ipfiremake openssl
+  ipfiremake openssl-compat
+  ipfiremake libgpg-error
+  ipfiremake libgcrypt
+  ipfiremake libassuan
+  ipfiremake bind
+  ipfiremake dhcp
+  ipfiremake dhcpcd
   ipfiremake linux-atm
   ipfiremake cpio
   ipfiremake dracut
   ipfiremake expat
   ipfiremake gdbm
   ipfiremake pam
-  ipfiremake openssl
   ipfiremake curl
   ipfiremake tcl
   ipfiremake sqlite
@@ -491,9 +504,11 @@ buildipfire() {
   ipfiremake apache2
   ipfiremake php
   ipfiremake apache2                   PASS=C
+  ipfiremake jquery
   ipfiremake arping
   ipfiremake beep
   ipfiremake dvdrtools
+  ipfiremake nettle
   ipfiremake dnsmasq
   ipfiremake dosfstools
   ipfiremake reiserfsprogs
@@ -507,6 +522,8 @@ buildipfire() {
   ipfiremake perl-GD
   ipfiremake GD-Graph
   ipfiremake GD-TextUtil
+  ipfiremake perl-Device-SerialPort
+  ipfiremake perl-Device-Modem
   ipfiremake gnupg
   ipfiremake hdparm
   ipfiremake sdparm
@@ -591,6 +608,8 @@ buildipfire() {
   ipfiremake lzo
   ipfiremake openvpn
   ipfiremake pammysql
+  ipfiremake mpage
+  ipfiremake dbus
   ipfiremake cups
   ipfiremake ghostscript
   ipfiremake foomatic
@@ -627,9 +646,6 @@ buildipfire() {
   ipfiremake libmpeg2
   ipfiremake cmake
   ipfiremake gnump3d
-  ipfiremake libsigc++
-  ipfiremake libtorrent
-  ipfiremake rtorrent
   ipfiremake rsync
   ipfiremake tcpwrapper
   ipfiremake libevent
@@ -644,6 +660,7 @@ buildipfire() {
   ipfiremake sysstat
   ipfiremake vsftpd
   ipfiremake strongswan
+  ipfiremake rng-tools
   ipfiremake lsof
   ipfiremake br2684ctl
   ipfiremake pcmciautils
@@ -660,8 +677,10 @@ buildipfire() {
   ipfiremake netpbm
   ipfiremake phpSANE
   ipfiremake tunctl
+  ipfiremake netsnmpd
   ipfiremake nagios
   ipfiremake nagios_nrpe
+  ipfiremake icinga
   ipfiremake ebtables
   ipfiremake directfb
   ipfiremake dfb++
@@ -669,8 +688,11 @@ buildipfire() {
   ipfiremake ffmpeg
   ipfiremake vdr
   ipfiremake vdr_streamdev
+  ipfiremake vdr_vnsiserver5
   ipfiremake vdr_vnsiserver3
   ipfiremake vdr_epgsearch
+  ipfiremake vdr_dvbapi
+  ipfiremake vdr_eepg
   ipfiremake w_scan
   ipfiremake icecast
   ipfiremake icegenerator
@@ -679,9 +701,7 @@ buildipfire() {
   ipfiremake mpc
   ipfiremake git
   ipfiremake squidclamav
-  ipfiremake bc
   ipfiremake vnstat
-  ipfiremake vnstati
   ipfiremake iw
   ipfiremake wpa_supplicant
   ipfiremake hostapd
@@ -690,7 +710,6 @@ buildipfire() {
   ipfiremake syslinux
   ipfiremake tftpd
   ipfiremake cpufrequtils
-  ipfiremake dbus
   ipfiremake bluetooth
   ipfiremake gutenprint
   ipfiremake apcupsd
@@ -707,11 +726,11 @@ buildipfire() {
   ipfiremake perl-Sort-Naturally
   ipfiremake vdradmin
   ipfiremake miau
-  ipfiremake netsnmpd
   ipfiremake perl-DBI
   ipfiremake perl-DBD-mysql
+  ipfiremake perl-DBD-SQLite
+  ipfiremake perl-File-ReadBackwards
   ipfiremake cacti
-  ipfiremake icecc
   ipfiremake openvmtools
   ipfiremake nagiosql
   ipfiremake iftop
@@ -726,7 +745,6 @@ buildipfire() {
   ipfiremake usb_modeswitch_data
   ipfiremake zerofree
   ipfiremake mdadm
-  ipfiremake eject
   ipfiremake pound
   ipfiremake minicom
   ipfiremake ddrescue
@@ -745,6 +763,7 @@ buildipfire() {
   ipfiremake python-progressbar
   ipfiremake python-xattr
   ipfiremake intltool
+  ipfiremake ddns
   ipfiremake transmission
   ipfiremake dpfhack
   ipfiremake lcd4linux
@@ -755,15 +774,12 @@ buildipfire() {
   ipfiremake fping
   ipfiremake telnet
   ipfiremake xinetd
-  ipfiremake libgpg-error
-  ipfiremake libassuan
   ipfiremake gpgme
   ipfiremake pygpgme
   ipfiremake pakfire3
   ipfiremake stress
   ipfiremake libstatgrab
   ipfiremake sarg
-  ipfiremake fstrim
   ipfiremake check_mk_agent
   ipfiremake libdaemon
   ipfiremake avahi
@@ -787,36 +803,16 @@ buildipfire() {
   ipfiremake arm
   ipfiremake wavemon
   ipfiremake iptraf-ng
-  echo Build on $HOSTNAME > $BASEDIR/build/var/ipfire/firebuild
-  cat /proc/version >> $BASEDIR/build/var/ipfire/firebuild
-  echo >> $BASEDIR/build/var/ipfire/firebuild
-  git log -1 >> $BASEDIR/build/var/ipfire/firebuild
-  echo >> $BASEDIR/build/var/ipfire/firebuild
-  git status >> $BASEDIR/build/var/ipfire/firebuild
-  echo >> $BASEDIR/build/var/ipfire/firebuild
-  cat /proc/cpuinfo >> $BASEDIR/build/var/ipfire/firebuild
-  echo $PAKFIRE_CORE > $BASEDIR/build/opt/pakfire/db/core/mine
-  if [ "$(git status -s | wc -l)" == "0" ]; then
-       GIT_STATUS=""
-  else
-       GIT_STATUS="-dirty"
-  fi
-  case "$GIT_BRANCH" in
-       core*|beta?|rc?)
-           echo "$NAME $VERSION ($MACHINE) - $GIT_BRANCH$GIT_STATUS" > $BASEDIR/build/etc/system-release
-           ;;
-       *)
-           echo "$NAME $VERSION ($MACHINE) - Development Build: $GIT_BRANCH/$GIT_LASTCOMMIT$GIT_STATUS" > $BASEDIR/build/etc/system-release
-           ;;
-  esac
+  ipfiremake iotop
+  ipfiremake stunnel
+  ipfiremake sslscan
+  ipfiremake owncloud
 }
 
 buildinstaller() {
   # Run installer scripts one by one
   LOGFILE="$BASEDIR/log/_build.installer.log"
   export LOGFILE
-  ipfiremake as86
-  ipfiremake mbr
   ipfiremake memtest
   ipfiremake installer
   installmake strip
@@ -854,10 +850,8 @@ buildpackages() {
   ipfiremake cdrom
 
   # Check if there is a loop device for building in virtual environments
-  if [ $BUILD_IMAGES == 1 ] && ([ -e /dev/loop/0 ] || [ -e /dev/loop0 ]); then
-       if [ "${MACHINE_TYPE}" != "arm" ]; then
-               ipfiremake usb-stick
-       fi
+  modprobe loop 2>/dev/null
+  if [ $BUILD_IMAGES == 1 ] && ([ -e /dev/loop/0 ] || [ -e /dev/loop0 ] || [ -e "/dev/loop-control" ]); then
        ipfiremake flash-images
   fi
 
@@ -865,16 +859,7 @@ buildpackages() {
 
   ipfirepackages
 
-  # Check if there is a loop device for building in virtual environments
-  if [ $BUILD_IMAGES == 1 ] && ([ -e /dev/loop/0 ] || [ -e /dev/loop0 ]) && [ "${MACHINE_TYPE}" != "arm" ]; then
-        cp -f $BASEDIR/packages/linux-xen-*.ipfire $LFS/install/packages/
-        cp -f $BASEDIR/packages/meta-linux-xen $LFS/install/packages/
-        cp -f $BASEDIR/packages/linux-pae-*.ipfire $LFS/install/packages/
-        cp -f $BASEDIR/packages/meta-linux-pae $LFS/install/packages/
-       ipfiremake xen-image
-       rm -rf $LFS/install/packages/linux-xen-*.ipfire
-       rm -rf $LFS/install/packages/meta-linux-xen
-  fi
+  ipfiremake xen-image
   mv $LFS/install/images/*.bz2 $BASEDIR >> $LOGFILE 2>&1
 
   cd $BASEDIR
@@ -921,6 +906,22 @@ ipfirepackages() {
   rm -rf  $BASEDIR/build/install/packages/*
 }
 
+while [ $# -gt 0 ]; do
+       case "${1}" in
+               --target=*)
+                       configure_target "${1#--target=}"
+                       ;;
+               -*)
+                       exiterror "Unknown configuration option: ${1}"
+                       ;;
+               *)
+                       # Found a command, so exit options parsing.
+                       break
+                       ;;
+       esac
+       shift
+done
+
 # See what we're supposed to do
 case "$1" in 
 build)
@@ -1115,11 +1116,11 @@ uploadsrc)
        fi
 
        URL_SOURCE=$(grep URL_SOURCE lfs/Config | awk '{ print $3 }')
-       REMOTE_FILES=$(echo "ls -1 --ignore=toolchains" | sftp -C ${IPFIRE_USER}@${URL_SOURCE})
+       REMOTE_FILES=$(echo "ls -1" | sftp -C ${IPFIRE_USER}@${URL_SOURCE})
 
-       cd $BASEDIR/cache/
-       for file in $(ls -1 --ignore=toolchains); do
-               grep -q "$file" <<<$REMOTE_FILES && continue
+       for file in ${BASEDIR}/cache/*; do
+               [ -d "${file}" ] && continue
+               grep -q "$(basename ${file})" <<<$REMOTE_FILES && continue
                NEW_FILES="$NEW_FILES $file"
        done
        [ -n "$NEW_FILES" ] && scp -2 $NEW_FILES ${IPFIRE_USER}@${URL_SOURCE}