]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - make.sh
sysctl: Use strict Reverse Path Filtering
[ipfire-2.x.git] / make.sh
diff --git a/make.sh b/make.sh
index fb1fc4812b54383054c688a5b786b539575bc505..f794dec0ec67fbd27a69b6afb1d043436b75a033 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -1,32 +1,29 @@
 #!/bin/bash
-############################################################################
-#                                                                          #
-# This file is part of the IPFire Firewall.                                #
-#                                                                          #
-# IPFire is free software; you can redistribute it and/or modify           #
-# it under the terms of the GNU General Public License as published by     #
-# the Free Software Foundation; either version 2 of the License, or        #
-# (at your option) any later version.                                      #
-#                                                                          #
-# IPFire is distributed in the hope that it will be useful,                #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of           #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            #
-# GNU General Public License for more details.                             #
-#                                                                          #
-# You should have received a copy of the GNU General Public License        #
-# 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-2022 IPFire Team <info@ipfire.org>.                   #
-#                                                                          #
-############################################################################
-#
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2007-2022  IPFire Team  <info@ipfire.org>                     #
+#                                                                             #
+# This program is free software: you can redistribute it and/or modify        #
+# it under the terms of the GNU General Public License as published by        #
+# the Free Software Foundation, either version 3 of the License, or           #
+# (at your option) any later version.                                         #
+#                                                                             #
+# This program is distributed in the hope that it will be useful,             #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
+# GNU General Public License for more details.                                #
+#                                                                             #
+# You should have received a copy of the GNU General Public License           #
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
 
 NAME="IPFire"                                                  # Software name
 SNAME="ipfire"                                                 # Short name
 # If you update the version don't forget to update backupiso and add it to core update
 VERSION="2.27"                                                 # Version number
-CORE="165"                                                     # Core Level (Filename)
+CORE="167"                                                     # Core Level (Filename)
 SLOGAN="www.ipfire.org"                                                # Software slogan
 CONFIG_ROOT=/var/ipfire                                                # Configuration rootdir
 MAX_RETRIES=1                                                  # prefetch/check loop
@@ -295,10 +292,6 @@ stdumount() {
        umount $BASEDIR/build/tmp               2>/dev/null;
 }
 
-now() {
-       date -u "+%s"
-}
-
 format_runtime() {
        local seconds=${1}
 
@@ -547,7 +540,7 @@ prepareenv() {
        esac
 
        # Setup ccache cache size
-       enterchroot ccache --max-size="${CCACHE_CACHE_SIZE}" >/dev/null
+       enterchroot ccache --max-size="${CCACHE_CACHE_SIZE}"
 }
 
 enterchroot() {
@@ -651,9 +644,9 @@ lfsmakecommoncheck() {
        fi
 
        cd $BASEDIR/lfs && make -s -f $* LFS_BASEDIR=$BASEDIR BUILD_ARCH="${BUILD_ARCH}" \
-               MESSAGE="$1\t md5sum" md5  >> $LOGFILE 2>&1
+               MESSAGE="$1\t b2sum" b2  >> $LOGFILE 2>&1
        if [ $? -ne 0 ]; then
-               exiterror "md5sum error in $1, check file in cache or signature"
+               exiterror "BLAKE2 checksum error in $1, check file in cache or signature"
        fi
 
        return 0        # pass all!
@@ -741,7 +734,7 @@ ipfiredist() {
 wait_until_finished() {
        local pid=${1}
 
-       local start_time=$(now)
+       local start_time="${SECONDS}"
 
        # Show progress
        if ${INTERACTIVE}; then
@@ -751,7 +744,7 @@ wait_until_finished() {
 
                local runtime
                while kill -0 ${pid} 2>/dev/null; do
-                       print_runtime $(( $(now) - ${start_time} ))
+                       print_runtime $(( SECONDS - start_time ))
 
                        # Wait a little
                        sleep 1
@@ -763,7 +756,7 @@ wait_until_finished() {
        local ret=$?
 
        if ! ${INTERACTIVE}; then
-               print_runtime $(( $(now) - ${start_time} ))
+               print_runtime $(( SECONDS - start_time ))
        fi
 
        return ${ret}
@@ -785,7 +778,7 @@ fake_environ() {
 }
 
 qemu_environ() {
-       local env
+       local env="QEMU_TARGET_HELPER=${QEMU_TARGET_HELPER}"
 
        # Don't add anything if qemu is not used.
        if ! qemu_is_required; then
@@ -797,6 +790,11 @@ qemu_environ() {
                arm*)
                        QEMU_CPU="${QEMU_CPU:-cortex-a9}"
 
+                       env="${env} QEMU_CPU=${QEMU_CPU}"
+                       ;;
+               riscv64)
+                       QEMU_CPU="${QEMU_CPU:-sifive-u54}"
+
                        env="${env} QEMU_CPU=${QEMU_CPU}"
                        ;;
        esac
@@ -912,7 +910,7 @@ qemu_find_build_helper_name() {
 file_is_static() {
        local file="${1}"
 
-       file ${file} 2>/dev/null | grep -q "statically linked"
+       file -L "${file}" 2>/dev/null | grep -q "statically linked"
 }
 
 update_language_list() {
@@ -1094,6 +1092,8 @@ buildbase() {
        lfsmake2 libxcrypt
        lfsmake2 file
        lfsmake2 gcc
+       lfsmake2 attr
+       lfsmake2 acl
        lfsmake2 sed
        lfsmake2 berkeley
        lfsmake2 coreutils
@@ -1109,8 +1109,6 @@ buildbase() {
        lfsmake2 pcre
        lfsmake2 pcre2
        lfsmake2 gettext
-       lfsmake2 attr
-       lfsmake2 acl
        lfsmake2 bash
        lfsmake2 diffutils
        lfsmake2 ed
@@ -1129,6 +1127,7 @@ buildbase() {
        lfsmake2 pkg-config
        lfsmake2 procps
        lfsmake2 make
+       lfsmake2 libpipeline
        lfsmake2 man
        lfsmake2 net-tools
        lfsmake2 patch
@@ -1194,6 +1193,7 @@ buildipfire() {
   # multi kernel builds so KCFG is empty
   lfsmake2 linux               KCFG=""
   lfsmake2 rtl8189es           KCFG=""
+  lfsmake2 rtl8189fs           KCFG=""
   lfsmake2 rtl8812au           KCFG=""
   lfsmake2 rtl8822bu           KCFG=""
   lfsmake2 xradio              KCFG=""
@@ -1205,7 +1205,6 @@ buildipfire() {
   lfsmake2 nettle
   lfsmake2 json-c
   lfsmake2 libconfig
-  lfsmake2 libevent
   lfsmake2 libevent2
   lfsmake2 expat
   lfsmake2 apr
@@ -1319,7 +1318,6 @@ buildipfire() {
   lfsmake2 ca-certificates
   lfsmake2 fireinfo
   lfsmake2 libnet
-  lfsmake2 libnl
   lfsmake2 libnl-3
   lfsmake2 libidn
   lfsmake2 nasm
@@ -1332,7 +1330,6 @@ buildipfire() {
   lfsmake2 libexif
   lfsmake2 libpng
   lfsmake2 libtiff
-  lfsmake2 libart
   lfsmake2 gd
   lfsmake2 slang
   lfsmake2 newt
@@ -1380,7 +1377,6 @@ buildipfire() {
   lfsmake2 perl-HTTP-Date
   lfsmake2 gnupg
   lfsmake2 hdparm
-  lfsmake2 sdparm
   lfsmake2 whatmask
   lfsmake2 libtirpc
   lfsmake2 conntrack-tools
@@ -1402,7 +1398,7 @@ buildipfire() {
   lfsmake2 perl-Digest-SHA1
   lfsmake2 perl-Digest-HMAC
   lfsmake2 perl-libwww
-       lfsmake2 perl-LWP-Protocol-https
+  lfsmake2 perl-LWP-Protocol-https
   lfsmake2 perl-Net-HTTP
   lfsmake2 perl-Net-DNS
   lfsmake2 perl-Net-IPv4Addr
@@ -1422,6 +1418,7 @@ buildipfire() {
   lfsmake2 perl-XML-Parser
   lfsmake2 perl-Crypt-PasswdMD5
   lfsmake2 perl-Net-Telnet
+  lfsmake2 perl-JSON
   lfsmake2 python3-setuptools
   lfsmake2 python3-inotify
   lfsmake2 python3-docutils
@@ -1440,7 +1437,6 @@ buildipfire() {
   lfsmake2 pango
   lfsmake2 rrdtool
   lfsmake2 setup
-  lfsmake2 libdnet
   lfsmake2 jansson
   lfsmake2 yaml
   lfsmake2 libhtp
@@ -1538,7 +1534,6 @@ buildipfire() {
   lfsmake2 libusbredir
   lfsmake2 libseccomp
   lfsmake2 qemu
-  lfsmake2 netpbm
   lfsmake2 netsnmpd
   lfsmake2 nagios_nrpe
   lfsmake2 nagios-plugins
@@ -1593,7 +1588,6 @@ buildipfire() {
   lfsmake2 monit
   lfsmake2 nut
   lfsmake2 watchdog
-  lfsmake2 libpri
   lfsmake2 usb_modeswitch
   lfsmake2 usb_modeswitch_data
   lfsmake2 zerofree
@@ -1606,14 +1600,23 @@ buildipfire() {
   lfsmake2 u-boot
   lfsmake2 u-boot-friendlyarm
   lfsmake2 wireless-regdb
-  lfsmake2 libsolv
   lfsmake2 ddns
+  lfsmake2 python3-pycparser
+  lfsmake2 python3-charset-normalizer
+  lfsmake2 python3-certifi
+  lfsmake2 python3-idna
+  lfsmake2 python3-requests
   lfsmake2 python3-toml
   lfsmake2 python3-pyproject2setuppy
   lfsmake2 python3-tomli
+  lfsmake2 python3-pep517
+  lfsmake2 python3-build
+  lfsmake2 python3-install
+  lfsmake2 python3-urllib3
+  lfsmake2 python3-flit
+  lfsmake2 python3-packaging
   lfsmake2 python3-typing-extensions
   lfsmake2 python3-semantic-version
-  lfsmake2 python3-packaging
   lfsmake2 python3-setuptools-scm
   lfsmake2 python3-setuptools-rust
   lfsmake2 python3-six
@@ -1624,10 +1627,15 @@ buildipfire() {
   lfsmake2 python3-s3transfer
   lfsmake2 python3-rsa
   lfsmake2 python3-pyasn1
-  lfsmake2 python3-urllib3
   lfsmake2 python3-botocore
   lfsmake2 python3-cffi
   lfsmake2 python3-cryptography
+  lfsmake2 python3-circuitbreaker
+  lfsmake2 python3-pytz
+  lfsmake2 python3-click
+  lfsmake2 python3-arrow
+  lfsmake2 python3-terminaltables
+  lfsmake2 python3-pkgconfig
   lfsmake2 aws-cli
   lfsmake2 oci-python-sdk
   lfsmake2 oci-cli
@@ -1664,7 +1672,6 @@ buildipfire() {
   lfsmake2 perl-IO-String
   lfsmake2 perl-PDF-API2
   lfsmake2 proxy-accounting
-  lfsmake2 pigz
   lfsmake2 tmux
   lfsmake2 perl-Text-CSV_XS
   lfsmake2 lua
@@ -1700,7 +1707,6 @@ buildipfire() {
   lfsmake2 firmware-update
   lfsmake2 tshark
   lfsmake2 speedtest-cli
-  lfsmake2 rfkill
   lfsmake2 amazon-ssm-agent
   lfsmake2 libloc
   lfsmake2 ncdu
@@ -1769,7 +1775,7 @@ buildpackages() {
   [ "${BUILD_ARCH}" = "armv6l" ] && rm -rf *.iso
 
   for i in $(ls *.bz2 *.img.xz *.iso 2>/dev/null); do
-       md5sum $i > $i.md5
+       b2sum $i > $i.b2
   done
   cd $PWD
 
@@ -1817,7 +1823,7 @@ done
 # See what we're supposed to do
 case "$1" in
 build)
-       START_TIME=$(now)
+       START_TIME="${SECONDS}"
 
        # Clear screen
        ${INTERACTIVE} && clear
@@ -1832,11 +1838,11 @@ build)
                else
                        PACKAGENAME=${PACKAGE%.tar.zst}
                        print_build_stage "Packaged toolchain compilation"
-                       if [ `md5sum $PACKAGE | awk '{print $1}'` == `cat $PACKAGENAME.md5 | awk '{print $1}'` ]; then
+                       if [ `b2sum $PACKAGE | awk '{print $1}'` == `cat $PACKAGENAME.b2 | awk '{print $1}'` ]; then
                                zstd -d < "${PACKAGE}" | tar x
                                prepareenv
                        else
-                               exiterror "$PACKAGENAME md5 did not match, check downloaded package"
+                               exiterror "$PACKAGENAME BLAKE2 checksum did not match, check downloaded package"
                        fi
                fi
        else
@@ -1862,7 +1868,7 @@ build)
        tools/checkrootfiles
        cd $PWD
 
-       print_build_summary $(( $(now) - ${START_TIME} ))
+       print_build_summary $(( SECONDS - START_TIME ))
        ;;
 shell)
        # enter a shell inside LFS chroot
@@ -1941,22 +1947,22 @@ downloadsrc)
                        fi
                done
        done
-       echo -e "${BOLD}***Verifying md5sums${NORMAL}"
+       echo -e "${BOLD}***Verifying BLAKE2 checksum${NORMAL}"
        ERROR=0
        for i in *; do
                if [ -f "$i" -a "$i" != "Config" ]; then
                        lfsmakecommoncheck ${i} > /dev/null || continue
                        make -s -f $i LFS_BASEDIR=$BASEDIR BUILD_ARCH="${BUILD_ARCH}" \
-                               MESSAGE="$i\t " md5 >> $LOGFILE 2>&1
+                               MESSAGE="$i\t " b2 >> $LOGFILE 2>&1
                        if [ $? -ne 0 ]; then
-                               echo -ne "MD5 difference in lfs/$i"
+                               echo -ne "BLAKE2 checksum difference in lfs/$i"
                                print_status FAIL
                                ERROR=1
                        fi
                fi
        done
        if [ $ERROR -eq 0 ]; then
-               echo -ne "${BOLD}all files md5sum match${NORMAL}"
+               echo -ne "${BOLD}all files BLAKE2 checksum match${NORMAL}"
                print_status DONE
        else
                echo -ne "${BOLD}not all files were correctly download${NORMAL}"
@@ -1975,8 +1981,8 @@ toolchain)
        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 \
                | 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
+       b2sum cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.tar.zst \
+               > cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.b2
        stdumount
        ;;
 gettoolchain)
@@ -1987,14 +1993,14 @@ gettoolchain)
                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.zst $URL_TOOLCHAIN/$PACKAGE.md5 >& /dev/null
+               wget -U "IPFireSourceGrabber/2.x" $URL_TOOLCHAIN/$PACKAGE.tar.zst $URL_TOOLCHAIN/$PACKAGE.b2 >& /dev/null
                if [ $? -ne 0 ]; then
                        echo "`date -u '+%b %e %T'`: error downloading $PACKAGE toolchain for ${BUILD_ARCH} machine" | tee -a $LOGFILE
                else
-                       if [ "`md5sum $PACKAGE.tar.zst | awk '{print $1}'`" = "`cat $PACKAGE.md5 | awk '{print $1}'`" ]; then
-                               echo "`date -u '+%b %e %T'`: toolchain md5 ok" | tee -a $LOGFILE
+                       if [ "`b2sum $PACKAGE.tar.zst | awk '{print $1}'`" = "`cat $PACKAGE.b2 | awk '{print $1}'`" ]; then
+                               echo "`date -u '+%b %e %T'`: toolchain BLAKE2 checksum ok" | tee -a $LOGFILE
                        else
-                               exiterror "$PACKAGE.md5 did not match, check downloaded package"
+                               exiterror "$PACKAGE BLAKE2 checksum did not match, check downloaded package"
                        fi
                fi
        else