]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - make.sh
Merge remote-tracking branch 'origin/next' into fifteen
[people/teissler/ipfire-2.x.git] / make.sh
diff --git a/make.sh b/make.sh
index 589a7fdc0402826376fa238a8e1c803eb273025e..9bae8a679f0f0c661a11029e3654f4d9ca3a51b3 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -32,12 +32,12 @@ 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
+TOOLCHAINVER=7
 
 BUILDMACHINE=$MACHINE
     if [ "$MACHINE" = "x86_64" ]; then
@@ -83,6 +83,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() {
     ############################################################################
     #                                                                          #
@@ -179,11 +195,12 @@ prepareenv() {
     set +h
     LC_ALL=POSIX
     if [ -z $MAKETUNING ]; then
-        if [ "${MACHINE:0:3}" = "arm" ]; then
-            MAKETUNING="-j2"
-        else
-            MAKETUNING="-j6"
-        fi
+       CPU_COUNT="$(getconf _NPROCESSORS_ONLN 2>/dev/null)"
+       if [ -z "${CPU_COUNT}" ]; then
+               CPU_COUNT=1
+       fi
+
+       MAKETUNING="-j$(( ${CPU_COUNT} * 2 + 1 ))"
     fi
     export LFS LC_ALL CFLAGS CXXFLAGS MAKETUNING
     unset CC CXX CPP LD_LIBRARY_PATH LD_PRELOAD
@@ -356,6 +373,7 @@ buildbase() {
     lfsmake2 util-linux
     lfsmake2 vim
     lfsmake2 xz
+    lfsmake2 paxctl
     lfsmake2 grub
 }
 
@@ -377,24 +395,11 @@ buildipfire() {
   ipfiremake dvb-firmwares
   ipfiremake zd1211-firmware
   ipfiremake rpi-firmware
-  ipfiremake u-boot
   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"
@@ -424,29 +429,26 @@ buildipfire() {
   else
     # arm-rpi (Raspberry Pi) kernel build
     ipfiremake linux                   KCFG="-rpi"
-    ipfiremake v4l-dvb                 KCFG="-rpi"
-    ipfiremake mISDN                   KCFG="-rpi" NOPCI=1
+#    ipfiremake v4l-dvb                        KCFG="-rpi"
+#    ipfiremake mISDN                  KCFG="-rpi" NOPCI=1
     ipfiremake cryptodev               KCFG="-rpi"
-    ipfiremake compat-drivers          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 multi platform (Panda, Wandboard ...) kernel build
+    ipfiremake linux                   KCFG="-multi"
+    ipfiremake cryptodev               KCFG="-multi"
 
     # arm-kirkwood (Dreamplug, ICY-Box ...) kernel build
     ipfiremake linux                   KCFG="-kirkwood"
-    ipfiremake v4l-dvb                 KCFG="-kirkwood"
-    ipfiremake mISDN                   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"
+#    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
   ipfiremake pkg-config
@@ -730,7 +732,7 @@ buildipfire() {
   ipfiremake minicom
   ipfiremake ddrescue
   ipfiremake imspector
-#  ipfiremake miniupnpd
+  ipfiremake miniupnpd
   ipfiremake client175
   ipfiremake powertop
   ipfiremake parted
@@ -774,7 +776,7 @@ buildipfire() {
   ipfiremake lcdproc
   ipfiremake bitstream
   ipfiremake multicat
-#  ipfiremake keepalived
+  ipfiremake keepalived
   ipfiremake ipvsadm
   ipfiremake perl-Carp-Clan
   ipfiremake perl-Date-Calc
@@ -786,36 +788,13 @@ 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
 }
 
 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,9 +833,6 @@ buildpackages() {
 
   # 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
        ipfiremake flash-images
   fi
 
@@ -864,16 +840,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