]> git.ipfire.org Git - people/arne_f/ipfire-2.x.git/blobdiff - make.sh
ccache: Remove CCACHE_COMPRESS=1
[people/arne_f/ipfire-2.x.git] / make.sh
diff --git a/make.sh b/make.sh
index 93f888ef1e33e4b392863051aecb3ecbb70e8fff..837a071237bb0a4b8b60ea5319e035e3f93dc630 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -40,6 +40,14 @@ GIT_LASTCOMMIT="$(git rev-parse --verify HEAD)"                      # Last commit
 
 TOOLCHAINVER=20210202
 
+ZSTD_OPT=(
+       # Compress in parallel using all processor cores
+       -T0
+
+       # Compress as best as we can
+       --ultra -22
+)
+
 ###############################################################################
 #
 # Beautifying variables & presentation & input output interface
@@ -214,7 +222,7 @@ configure_build() {
        # 128MB of memory. Therefore we find out how
        # many processes fit into memory.
        local mem_max=$(( ${SYSTEM_MEMORY} / 128 ))
-       local cpu_max=$(( ${SYSTEM_PROCESSORS} + 1 ))
+       local cpu_max=$(( ${SYSTEM_PROCESSORS} ))
 
        local parallelism
        if [ ${mem_max} -lt ${cpu_max} ]; then
@@ -514,7 +522,6 @@ prepareenv() {
        # Run LFS static binary creation scripts one by one
        export CCACHE_DIR=$BASEDIR/ccache
        export CCACHE_TEMPDIR="/tmp"
-       export CCACHE_COMPRESS=1
        export CCACHE_COMPILERCHECK="string:toolchain-${TOOLCHAINVER} ${BUILD_ARCH}"
 
        # Remove pre-install list of installed files in case user erase some files before rebuild
@@ -586,7 +593,6 @@ enterchroot() {
                BUILD_PLATFORM="${BUILD_PLATFORM}" \
                CCACHE_DIR=/usr/src/ccache \
                CCACHE_TEMPDIR="${CCACHE_TEMPDIR}" \
-               CCACHE_COMPRESS="${CCACHE_COMPRESS}" \
                CCACHE_COMPILERCHECK="${CCACHE_COMPILERCHECK}" \
                GOCACHE="/usr/src/ccache/go" \
                KVER="${KVER}" \
@@ -670,7 +676,6 @@ lfsmake1() {
                PATH="${TOOLS_DIR}/ccache/bin:${TOOLS_DIR}/bin:$PATH" \
                CCACHE_DIR="${CCACHE_DIR}" \
                CCACHE_TEMPDIR="${CCACHE_TEMPDIR}" \
-               CCACHE_COMPRESS="${CCACHE_COMPRESS}" \
                CCACHE_COMPILERCHECK="${CCACHE_COMPILERCHECK}" \
                CFLAGS="${CFLAGS}" \
                CXXFLAGS="${CXXFLAGS}" \
@@ -1042,10 +1047,10 @@ buildtoolchain() {
        lfsmake1 glibc
        lfsmake1 libxcrypt
        lfsmake1 gcc                    PASS=L
-       lfsmake1 binutils                       PASS=2
-       lfsmake1 gcc                    PASS=2
        lfsmake1 zlib
        lfsmake1 zstd
+       lfsmake1 binutils                       PASS=2
+       lfsmake1 gcc                    PASS=2
        lfsmake1 ccache
        lfsmake1 tcl
        lfsmake1 expect
@@ -1724,7 +1729,7 @@ build)
        # Clear screen
        ${INTERACTIVE} && clear
 
-       PACKAGE=`ls -v -r $BASEDIR/cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.tar.xz 2> /dev/null | head -n 1`
+       PACKAGE="$BASEDIR/cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.tar.zst"
        #only restore on a clean disk
        if [ ! -e "${BASEDIR}/build${TOOLS_DIR}/.toolchain-successful" ]; then
                if [ ! -n "$PACKAGE" ]; then
@@ -1732,7 +1737,7 @@ build)
                        prepareenv
                        buildtoolchain
                else
-                       PACKAGENAME=${PACKAGE%.tar.xz}
+                       PACKAGENAME=${PACKAGE%.tar.zst}
                        print_build_stage "Packaged toolchain compilation"
                        if [ `md5sum $PACKAGE | awk '{print $1}'` == `cat $PACKAGENAME.md5 | awk '{print $1}'` ]; then
                                tar axf $PACKAGE
@@ -1875,21 +1880,21 @@ toolchain)
        buildtoolchain
        echo "`date -u '+%b %e %T'`: Create toolchain image for ${BUILD_ARCH}" | tee -a $LOGFILE
        test -d $BASEDIR/cache/toolchains || mkdir -p $BASEDIR/cache/toolchains
-       cd $BASEDIR && tar -cf- --exclude='log/_build.*.log' build/${TOOLS_DIR} build/bin/sh log | xz ${XZ_OPT} \
-               > cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.tar.xz
-       md5sum cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.tar.xz \
+       cd $BASEDIR && tar -cf- --exclude='log/_build.*.log' build/${TOOLS_DIR} build/bin/sh log \
+               | zstd ${ZSTD_OPT} > cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.tar.zst
+       md5sum cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.tar.zst \
                > cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.md5
        stdumount
        ;;
 gettoolchain)
        # arbitrary name to be updated in case of new toolchain package upload
        PACKAGE=$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}
-       if [ ! -f $BASEDIR/cache/toolchains/$PACKAGE.tar.xz ]; then
+       if [ ! -f $BASEDIR/cache/toolchains/$PACKAGE.tar.zst ]; then
                URL_TOOLCHAIN=`grep URL_TOOLCHAIN lfs/Config | awk '{ print $3 }'`
                test -d $BASEDIR/cache/toolchains || mkdir -p $BASEDIR/cache/toolchains
                echo "`date -u '+%b %e %T'`: Load toolchain image for ${BUILD_ARCH}" | tee -a $LOGFILE
                cd $BASEDIR/cache/toolchains
-               wget -U "IPFireSourceGrabber/2.x" $URL_TOOLCHAIN/$PACKAGE.tar.xz $URL_TOOLCHAIN/$PACKAGE.md5 >& /dev/null
+               wget -U "IPFireSourceGrabber/2.x" $URL_TOOLCHAIN/$PACKAGE.tar.zst $URL_TOOLCHAIN/$PACKAGE.md5 >& /dev/null
                if [ $? -ne 0 ]; then
                        echo "`date -u '+%b %e %T'`: error downloading $PACKAGE toolchain for ${BUILD_ARCH} machine" | tee -a $LOGFILE
                else