lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue,  3 Apr 2018 18:55:49 +0200
From:   Andrea Parri <andrea.parri@...rulasolutions.com>
To:     Ingo Molnar <mingo@...nel.org>, Jonathan Corbet <corbet@....net>
Cc:     linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
        linux-arch@...r.kernel.org,
        Andrea Parri <andrea.parri@...rulasolutions.com>
Subject: [PATCH 1/3] Documentation/features: Add script that refreshes the arch support status files in place

Suggested-by: Ingo Molnar <mingo@...nel.org>
Signed-off-by: Andrea Parri <andrea.parri@...rulasolutions.com>
---
 Documentation/features/scripts/features-refresh.sh | 55 ++++++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100755 Documentation/features/scripts/features-refresh.sh

diff --git a/Documentation/features/scripts/features-refresh.sh b/Documentation/features/scripts/features-refresh.sh
new file mode 100755
index 0000000000000..ae3e9d5d3f262
--- /dev/null
+++ b/Documentation/features/scripts/features-refresh.sh
@@ -0,0 +1,55 @@
+#
+# Small script that refreshes the kernel feature support status in place.
+#
+
+for F_FILE in Documentation/features/*/*/arch-support.txt; do
+	K=$(grep "^#         Kconfig:" "$F_FILE" | cut -c26-)
+	K_VALID="false" # K is 'valid' iff there exists a Kconfig file
+			# (for some arch) containing K.
+
+	for ARCH_DIR in arch/*/; do
+		K_FILES=$(find $ARCH_DIR -name "Kconfig*")
+
+		K_GREP=$(grep "$K" $K_FILES)
+		if [ ! -z "$K_GREP" ]; then
+			K_VALID="true"
+			break
+		fi
+	done
+
+	if [ "$K_VALID" = "false" ]; then
+		printf "WARNING: '%s' is not a valid Kconfig\n" "$K"
+	fi
+
+	T_FILE="$F_FILE.tmp"
+
+	grep "^#" $F_FILE > $T_FILE
+	echo "    -----------------------" >> $T_FILE
+	echo "    |         arch |status|" >> $T_FILE
+	echo "    -----------------------" >> $T_FILE
+
+	for ARCH_DIR in arch/*/; do
+		ARCH=$(echo $ARCH_DIR | sed -e 's/arch//g' | sed -e 's/\///g')
+		K_FILES=$(find $ARCH_DIR -name "Kconfig*")
+
+		K_GREP=$(grep "$K" $K_FILES)
+		if [ ! -z "$K_GREP" ]; then
+			# K is 'supported by a given arch', if there exists
+			# a Kconfig file for this arch containing K.
+			printf "    |%12s: |  ok  |\n" "$ARCH" >> $T_FILE
+		else
+			# ... Otherwise: Keep the original status (if any);
+			# default to "not yet supported".
+			S=$(grep -v "^#" "$F_FILE" | grep " $ARCH:")
+			if [ ! -z "$S" ]; then
+				echo "$S" >> $T_FILE
+			else
+				printf "    |%12s: | TODO |\n" "$ARCH" \
+					>> $T_FILE
+			fi
+		fi
+	done
+
+	echo "    -----------------------" >> $T_FILE
+	mv $T_FILE $F_FILE
+done
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ