]>
git.ipfire.org Git - ipfire-2.x.git/blob - tools/checkrootfiles
2 ###############################################################################
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2007-2023 IPFire Team info@ipfire.org #
7 # This program is free software: you can redistribute it and/or modify #
8 # it under the terms of the GNU General Public License as published by #
9 # the Free Software Foundation, either version 3 of the License, or #
10 # (at your option) any later version. #
12 # This program is distributed in the hope that it will be useful, #
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15 # GNU General Public License for more details. #
17 # You should have received a copy of the GNU General Public License #
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
20 ###############################################################################
22 # All supported architectures
29 # A list of files that are not scanned
30 # because they probably cause some false positives.
39 # Exclude old core updates
40 "--exclude-dir" "oldcore"
42 # Ignore the update scripts
43 "--exclude" "update.sh"
53 # Exclude any architecture-specific directories
55 for a
in ${ARCHES[@]}; do
56 args
+=( "--exclude-dir" "${a}" )
59 # Exclude all excluded files
61 for x
in ${EXCLUDED_FILES[@]}; do
62 args
+=( "--exclude" "${x}" )
65 # Search for all lines that contain the architecture, but exclude commented lines
66 grep -r "^[^#].*${arch}" "${args[@]}"
77 if grep -r "${pattern}" "${args[@]}"; then
78 if [ -n "${message}" ]; then
79 echo "ERROR: ${message}"
81 echo "ERROR: Files matching '${pattern}' have been found in the rootfiles"
92 # Check for /etc/init.d
93 if ! check_for_pattern
"^etc/init\.d/" \
94 "/etc/init.d/* has been found. Please replace by /etc/rc.d/init.d"; then
99 if ! check_for_pattern
"^var/run/.*" \
100 "You cannot ship files in /var/run as it is a ramdisk"; then
104 # Check architectures
106 for arch
in ${ARCHES[@]}; do
107 check_for_arch
"${arch}" || failed
=$?