]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - make.sh
Merge remote-tracking branch 'origin/next' into kernel-4.14
[ipfire-2.x.git] / make.sh
diff --git a/make.sh b/make.sh
index 22724aa87235d924be3250a69736118e094b3903..5647ecb97c7937416d106240540cdf32826883ca 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -70,8 +70,8 @@ resize_terminal() {
        NAME_WIDTH=$(( COLUMNS - OPTIONS_WIDTH - TIME_WIDTH - STATUS_WIDTH ))
        LINE_WIDTH=$(( COLUMNS - STATUS_WIDTH ))
 
-       TIME_COL=$(( COLUMNS - TIME_WIDTH - STATUS_WIDTH ))
-       STATUS_COL=$(( COLUMNS - STATUS_WIDTH ))
+       TIME_COL=$(( NAME_WIDTH + OPTIONS_WIDTH ))
+       STATUS_COL=$(( TIME_COL + TIME_WIDTH ))
 }
 
 # Initially setup terminal
@@ -217,6 +217,12 @@ configure_build() {
                        parallelism=${cpu_max}
                fi
 
+               # limit to -j23 because perl will not build
+               # more
+               if [ ${parallelism} -gt 23 ]; then
+                       parallelism=23
+               fi
+
                MAKETUNING="-j${parallelism}"
        fi
 }
@@ -322,12 +328,7 @@ print_package() {
        fi
 
        printf "%-$(( ${NAME_WIDTH} - 1 ))s " "${string}"
-
-       if [ -n "${options}" ]; then
-               printf "[ %-$(( ${OPTIONS_WIDTH} - 4 ))s ]" "${options}"
-       else
-               printf "%${OPTIONS_WIDTH}s" ""
-       fi
+       printf "%$(( ${OPTIONS_WIDTH} - 1 ))s " "${options}"
 }
 
 print_runtime() {
@@ -438,19 +439,6 @@ prepareenv() {
        # Set LFS Directory
        LFS=$BASEDIR/build
 
-       # Check ${TOOLS_DIR} symlink
-       if [ -h "${TOOLS_DIR}" ]; then
-         rm -f "${TOOLS_DIR}"
-       fi
-
-       if [ ! -e "${TOOLS_DIR}" ]; then
-          ln -s "${BASEDIR}/build${TOOLS_DIR}" "${TOOLS_DIR}"
-       fi
-
-       if [ ! -h "${TOOLS_DIR}" ]; then
-         exiterror "Could not create ${TOOLS_DIR} symbolic link"
-       fi
-
        # Setup environment
        set +h
        LC_ALL=POSIX
@@ -573,6 +561,7 @@ lfsmakecommoncheck() {
        if grep "^SUP_ARCH" ${BASEDIR}/lfs/${1} >/dev/null; then
                # Check if package supports ${BUILD_ARCH} or all architectures.
                if ! grep -E "^SUP_ARCH.*${BUILD_ARCH}|^SUP_ARCH.*all" ${BASEDIR}/lfs/${1} >/dev/null; then
+                       print_runtime 0
                        print_status SKIP
                        return 1
                fi
@@ -644,7 +633,7 @@ lfsmake2() {
        local PS1='\u:\w$ '
 
        enterchroot \
-               bash -x -c "cd /usr/src/lfs && \
+               ${EXTRA_PATH}bash -x -c "cd /usr/src/lfs && \
                        MAKETUNING=${MAKETUNING} \
                        make -f $* \
                        LFS_BASEDIR=/usr/src install" \
@@ -914,6 +903,19 @@ buildtoolchain() {
                exiterror "Could not find GCC. You will need a working build enviroment in order to build the toolchain."
        fi
 
+       # Check ${TOOLS_DIR} symlink
+       if [ -h "${TOOLS_DIR}" ]; then
+               rm -f "${TOOLS_DIR}"
+       fi
+
+       if [ ! -e "${TOOLS_DIR}" ]; then
+               ln -s "${BASEDIR}/build${TOOLS_DIR}" "${TOOLS_DIR}"
+       fi
+
+       if [ ! -h "${TOOLS_DIR}" ]; then
+               exiterror "Could not create ${TOOLS_DIR} symbolic link"
+       fi
+
        LOGFILE="$BASEDIR/log/_build.toolchain.log"
        export LOGFILE
 
@@ -951,6 +953,7 @@ buildtoolchain() {
        lfsmake1 texinfo
        lfsmake1 xz
        lfsmake1 fake-environ
+       lfsmake1 strip
        lfsmake1 cleanup-toolchain
 }
 
@@ -1064,29 +1067,29 @@ buildipfire() {
   case "${BUILD_ARCH}" in
        x86_64)
                lfsmake2 linux                  KCFG=""
-               lfsmake2 backports                      KCFG=""
-               lfsmake2 e1000e                 KCFG=""
-               lfsmake2 igb                            KCFG=""
-               lfsmake2 ixgbe                  KCFG=""
+#              lfsmake2 backports                      KCFG=""
+#              lfsmake2 e1000e                 KCFG=""
+#              lfsmake2 igb                            KCFG=""
+#              lfsmake2 ixgbe                  KCFG=""
                lfsmake2 xtables-addons         KCFG=""
                lfsmake2 linux-initrd                   KCFG=""
                ;;
        i586)
                # x86-pae (Native and new XEN) kernel build
                lfsmake2 linux                  KCFG="-pae"
-               lfsmake2 backports                      KCFG="-pae"
-               lfsmake2 e1000e                 KCFG="-pae"
-               lfsmake2 igb                            KCFG="-pae"
-               lfsmake2 ixgbe                  KCFG="-pae"
+#              lfsmake2 backports                      KCFG="-pae"
+#              lfsmake2 e1000e                 KCFG="-pae"
+#              lfsmake2 igb                            KCFG="-pae"
+#              lfsmake2 ixgbe                  KCFG="-pae"
                lfsmake2 xtables-addons         KCFG="-pae"
                lfsmake2 linux-initrd                   KCFG="-pae"
 
                # x86 kernel build
                lfsmake2 linux                  KCFG=""
-               lfsmake2 backports                      KCFG=""
-               lfsmake2 e1000e                 KCFG=""
-               lfsmake2 igb                            KCFG=""
-               lfsmake2 ixgbe                  KCFG=""
+#              lfsmake2 backports                      KCFG=""
+#              lfsmake2 e1000e                 KCFG=""
+#              lfsmake2 igb                            KCFG=""
+#              lfsmake2 ixgbe                  KCFG=""
                lfsmake2 xtables-addons         KCFG=""
                lfsmake2 linux-initrd                   KCFG=""
                ;;
@@ -1342,7 +1345,6 @@ buildipfire() {
   lfsmake2 etherwake
   lfsmake2 bwm-ng
   lfsmake2 sysstat
-  lfsmake2 vsftpd
   lfsmake2 strongswan
   lfsmake2 rng-tools
   lfsmake2 lsof
@@ -1436,7 +1438,6 @@ buildipfire() {
   lfsmake2 usb_modeswitch
   lfsmake2 usb_modeswitch_data
   lfsmake2 zerofree
-  lfsmake2 pound
   lfsmake2 minicom
   lfsmake2 ddrescue
   lfsmake2 miniupnpd
@@ -1493,7 +1494,6 @@ buildipfire() {
   lfsmake2 iptraf-ng
   lfsmake2 iotop
   lfsmake2 stunnel
-  lfsmake2 sslscan
   lfsmake2 owncloud
   lfsmake2 bacula
   lfsmake2 batctl
@@ -1532,7 +1532,8 @@ buildinstaller() {
   export LOGFILE
   lfsmake2 memtest
   lfsmake2 installer
-  lfsmake1 strip
+  # use toolchain bash for chroot to strip
+  EXTRA_PATH=${TOOLS_DIR}/bin/ lfsmake2 strip
 }
 
 buildpackages() {
@@ -1542,7 +1543,7 @@ buildpackages() {
 
   
   # Generating list of packages used
-  echo -n "Generating packages list from logs" | tee -a $LOGFILE
+  print_line "Generating packages list from logs"
   rm -f $BASEDIR/doc/packages-list
   for i in `ls -1tr $BASEDIR/log/[^_]*`; do
        if [ "$i" != "$BASEDIR/log/FILES" -a -n $i ]; then
@@ -1593,19 +1594,6 @@ buildpackages() {
   stdumount
   rm -rf $BASEDIR/build/tmp/*
 
-  # Generating total list of files
-  echo -n "Generating files list from logs" | tee -a $LOGFILE
-  rm -f $BASEDIR/log/FILES
-  for i in `ls -1tr $BASEDIR/log/[^_]*`; do
-       if [ "$i" != "$BASEDIR/log/FILES" -a -n $i ]; then
-               echo "##" >>$BASEDIR/log/FILES
-               echo "## `basename $i`" >>$BASEDIR/log/FILES
-               echo "##" >>$BASEDIR/log/FILES
-               cat $i | sed "s%^\./%#%" | sort >> $BASEDIR/log/FILES
-       fi
-  done
-  print_status DONE
-
   cd $PWD
 }