This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "IPFire 2.x development tree".
The branch, master has been updated via 8e6bb176b126579f970452ee54effe3e84422e6b (commit) via d7ee801712705c97fda658bb71209d814d1db841 (commit) via 974d274ea70e6a1500536cdeace80fee0fe34c90 (commit) from 6fc9957e62b4f5fe9b47e9d340480b9bc33788cd (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit 8e6bb176b126579f970452ee54effe3e84422e6b Author: Michael Tremer michael.tremer@ipfire.org Date: Tue Aug 27 09:39:27 2024 +0000
core-updates: Honour the excluded file list
This was not implement when refactoring the code to compress the updater's tarball.
Signed-off-by: Michael Tremer michael.tremer@ipfire.org
commit d7ee801712705c97fda658bb71209d814d1db841 Author: Michael Tremer michael.tremer@ipfire.org Date: Fri Aug 23 09:50:39 2024 +0000
make.sh: Integrate the rootfile consistency check
Signed-off-by: Michael Tremer michael.tremer@ipfire.org
commit 974d274ea70e6a1500536cdeace80fee0fe34c90 Author: Michael Tremer michael.tremer@ipfire.org Date: Fri Aug 23 09:33:31 2024 +0000
make.sh: Refactor the broken rootfile check
Signed-off-by: Michael Tremer michael.tremer@ipfire.org
-----------------------------------------------------------------------
Summary of changes: lfs/Config | 5 +- lfs/cdrom | 2 +- lfs/core-updates | 2 +- make.sh | 129 +++++++++++++++++++++++++++++++++++++++++++++++++-- tools/checknewlog.pl | 48 ------------------- tools/checkrootfiles | 114 --------------------------------------------- 6 files changed, 130 insertions(+), 170 deletions(-) delete mode 100755 tools/checknewlog.pl delete mode 100755 tools/checkrootfiles
Difference in files: diff --git a/lfs/Config b/lfs/Config index fe4e9605c..9fabe790c 100644 --- a/lfs/Config +++ b/lfs/Config @@ -358,6 +358,7 @@ __FILES_IN = \ --exclude="proc/*" \ --exclude="tmp/*" \ --exclude="__pycache__" \ + $(if $(1),--exclude-from=$(1)) \ --files-from=-
# Takes a tarball and extracts it in the target directory @@ -370,8 +371,10 @@ __FILES_OUT = \ # Copies all files on a rootfile into the given directory define COPY_FILES # Copy all files from $(1) to $(2) ($(3)) + # $4 = rootfile to write out + # $5 = exclude $(call COLLECT_FILES,$(1),$(3),$(4)) | \ - $(call __FILES_IN) | \ + $(call __FILES_IN,$(5)) | \ $(call __FILES_OUT,$(2))
# Strip everything, except a few things diff --git a/lfs/cdrom b/lfs/cdrom index aef95208d..a25141fc2 100644 --- a/lfs/cdrom +++ b/lfs/cdrom @@ -148,7 +148,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) rm -rf $(DIR_TMP)/root && mkdir -p $(DIR_TMP)/root
# Copy all files that we want - $(call COPY_FILES,$(DIR_SRC)/config/rootfiles/common,$(DIR_TMP)/root,) + $(call COPY_FILES,$(DIR_SRC)/config/rootfiles/common,$(DIR_TMP)/root,,,)
# Create mount points $(call CREATE_MOUNTPOINTS,$(DIR_TMP)/root) diff --git a/lfs/core-updates b/lfs/core-updates index 81ea9a5f0..ca72e2381 100644 --- a/lfs/core-updates +++ b/lfs/core-updates @@ -54,7 +54,7 @@ install: @rm -rf $(ARCHIVE_DIR) && mkdir -pv $(ARCHIVE_DIR) $(ARCHIVE_TMP)
# Generate the archive and write out the rootfile - $(call COPY_FILES,$(DIR_SRC)/config/rootfiles/core/$(CORE)/filelists,$(ARCHIVE_TMP),,$(ARCHIVE_DIR)/ROOTFILES) + $(call COPY_FILES,$(DIR_SRC)/config/rootfiles/core/$(CORE)/filelists,$(ARCHIVE_TMP),,$(ARCHIVE_DIR)/ROOTFILES,$(DIR_SRC)/config/rootfiles/core/$(CORE)/exclude)
# Create the archive $(call COMPRESS_XZ,$(ARCHIVE_TMP),$(ARCHIVE_DIR)/files.tar.xz) diff --git a/make.sh b/make.sh index cf12e4237..f474ee7ae 100755 --- a/make.sh +++ b/make.sh @@ -46,6 +46,13 @@ KVER="${KVER/-rc/.0-rc}${KVER_SUFFIX}" # ###############################################################################
+# All supported architectures +ARCHES=( + aarch64 + riscv64 + x86_64 +) + HOST_ARCH="${HOSTTYPE}" LC_ALL=POSIX PS1='\u:\w$ ' @@ -2159,6 +2166,117 @@ exec_in_namespace() { "${0}" "${args[@]}" "$@" }
+check_for_missing_rootfiles() { + print_headline "Checking for missing rootfiles..." + + local file + for file in ${LOG_DIR}/*_missing_rootfile; do + file="${file##*/}" + file="${file/_missing_rootfile/}"; + + print_line "${file} is missing a rootfile" + print_status FAIL + done + + return 0 +} + +check_rootfiles_for_arch() { + local arch="${1}" + + local args=( + # Search path + "${BASEDIR}/config/rootfiles" + + # Exclude old core updates + "--exclude-dir" "oldcore" + + # Ignore the update scripts + "--exclude" "update.sh" + ) + + # A list of files that are not scanned + # because they probably cause some false positives. + local excluded_files=( + qemu + ) + + # Exclude any architecture-specific directories + local a + for a in ${ARCHES[@]}; do + args+=( "--exclude-dir" "${a}" ) + done + + # Exclude all excluded files + local x + for x in ${excluded_files[@]}; do + args+=( "--exclude" "${x}" ) + done + + # Search for all lines that contain the architecture, but exclude commented lines + if grep -r "^[^#].*${arch}" "${args[@]}"; then + return 1 + fi + + return 0 +} + +check_rootfiles_for_pattern() { + local pattern="${1}" + local message="${2}" + + local args=( + # Search path + "${BASEDIR}/config/rootfiles" + + # Exclude old core updates + "--exclude-dir" "oldcore" + + # Ignore the update scripts + "--exclude" "update.sh" + ) + + if grep -r "${pattern}" "${args[@]}"; then + if [ -n "${message}" ]; then + print_line "${message}" + print_status FAIL + else + print_file "Files matching '${pattern}' have been found in the rootfiles" + print_status FAIL + fi + return 1 + fi + + return 0 +} + +check_rootfiles() { + local failed=0 + + print_headline "Checking for rootfile consistency..." + + # Check for /etc/init.d + if ! check_rootfiles_for_pattern "^etc/init.d/" \ + "/etc/init.d/* has been found. Please replace by /etc/rc.d/init.d"; then + failed=1 + fi + + # Check for /var/run + if ! check_rootfiles_for_pattern "^var/run/.*" \ + "You cannot ship files in /var/run as it is a ramdisk"; then + failed=1 + fi + + # Check architectures + local arch + for arch in ${ARCHES[@]}; do + check_rootfiles_for_arch "${arch}" || failed=$? + done + + # Return the error + return ${failed} +} + # Set BASEDIR readonly BASEDIR="$(find_base)"
@@ -2354,12 +2472,13 @@ build) # Build all packages build_packages
- print_headline "Checking Logfiles for new Files" + # Check for missing rootfiles + check_for_missing_rootfiles
- pushd "${BASEDIR}" &>/dev/null - tools/checknewlog.pl - tools/checkrootfiles - popd &>/dev/null + # Check for rootfile consistency + if ! check_rootfiles; then + exiterror "Rootfiles are inconsistent" + fi
print_build_summary $(( SECONDS - START_TIME )) ;; diff --git a/tools/checknewlog.pl b/tools/checknewlog.pl deleted file mode 100755 index e21fd6577..000000000 --- a/tools/checknewlog.pl +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/perl -############################################################################### -# # -# IPFire.org - A linux based firewall # -# Copyright (C) 2007-2017 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/. # -# # -############################################################################### - - -opendir(DIR, "./log") || die; -my @FILES = readdir(DIR); -closedir(DIR); - -foreach(@FILES) { -# print $_."\n"; - my $Found = 0; - - if ( $_ =~ /$.log/ || $_ =~ /^.+/ || $_=~ /-install/ || $_=~ /-tools/ || $_=~ /-config/ || $_=~ /-kmod-/|| $_=~ /u-boot-.*-1/|| $_=~ /coreutils/ || $_=~ /cmake/ || $_=~ /gcc-.*-libatomic/ || $_=~ /gdb/ || $_=~ /libsigc/ || $_ eq 'FILES' ){ - next; - } elsif ( $_=~ /missing_rootfile/ ){ - print "Rootfile for $_ missing!\n"; - } else { - open(DATEI, "<./log/$_") || die "File not found"; - my @Lines = <DATEI>; - close(DATEI); - - foreach (@Lines){ - if ( $_ =~ /^+/ ){$Found=1;} - } - - if ($Found){ - print "Changes in $_ check rootfile!\n"; - } - } -} diff --git a/tools/checkrootfiles b/tools/checkrootfiles deleted file mode 100755 index 9437de6f1..000000000 --- a/tools/checkrootfiles +++ /dev/null @@ -1,114 +0,0 @@ -#!/bin/bash -############################################################################### -# # -# IPFire.org - A linux based firewall # -# Copyright (C) 2007-2023 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/. # -# # -############################################################################### - -# All supported architectures -ARCHES=( - aarch64 - riscv64 - x86_64 -) - -# A list of files that are not scanned -# because they probably cause some false positives. -EXCLUDED_FILES=( - qemu -) - -ARGS=( - # Search path - "config/rootfiles" - - # Exclude old core updates - "--exclude-dir" "oldcore" - - # Ignore the update scripts - "--exclude" "update.sh" -) - -check_for_arch() { - local arch="${1}" - - local args=( - "${ARGS[@]}" - ) - - # Exclude any architecture-specific directories - local a - for a in ${ARCHES[@]}; do - args+=( "--exclude-dir" "${a}" ) - done - - # Exclude all excluded files - local x - for x in ${EXCLUDED_FILES[@]}; do - args+=( "--exclude" "${x}" ) - done - - # Search for all lines that contain the architecture, but exclude commented lines - grep -r "^[^#].*${arch}" "${args[@]}" -} - -check_for_pattern() { - local pattern="${1}" - local message="${2}" - - local args=( - "${ARGS[@]}" - ) - - if grep -r "${pattern}" "${args[@]}"; then - if [ -n "${message}" ]; then - echo "ERROR: ${message}" - else - echo "ERROR: Files matching '${pattern}' have been found in the rootfiles" - fi - return 1 - fi - - return 0 -} - -main() { - local failed=0 - - # Check for /etc/init.d - if ! check_for_pattern "^etc/init.d/" \ - "/etc/init.d/* has been found. Please replace by /etc/rc.d/init.d"; then - failed=1 - fi - - # Check for /var/run - if ! check_for_pattern "^var/run/.*" \ - "You cannot ship files in /var/run as it is a ramdisk"; then - failed=1 - fi - - # Check architectures - local arch - for arch in ${ARCHES[@]}; do - check_for_arch "${arch}" || failed=$? - done - - # Return the error - return ${failed} -} - -main "$@" || exit $?
hooks/post-receive -- IPFire 2.x development tree