From: Andrea Parri <andrea.parri@amarulasolutions.com>
To: Ingo Molnar <mingo@kernel.org>, Jonathan Corbet <corbet@lwn.net>
Cc: linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
linux-arch@vger.kernel.org,
Andrea Parri <andrea.parri@amarulasolutions.com>
Subject: [PATCH 1/3] Documentation/features: Add script that refreshes the arch support status files in place
Date: Tue, 3 Apr 2018 18:55:49 +0200 [thread overview]
Message-ID: <1522774551-9503-2-git-send-email-andrea.parri@amarulasolutions.com> (raw)
In-Reply-To: <1522774551-9503-1-git-send-email-andrea.parri@amarulasolutions.com>
Suggested-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Andrea Parri <andrea.parri@amarulasolutions.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
next prev parent reply other threads:[~2018-04-03 16:55 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-03 16:55 [RFC PATCH 0/3] Documentation/features: Provide and apply "features-refresh.sh" Andrea Parri
2018-04-03 16:55 ` Andrea Parri
2018-04-03 16:55 ` Andrea Parri [this message]
2018-04-03 16:55 ` [PATCH 1/3] Documentation/features: Add script that refreshes the arch support status files in place Andrea Parri
2018-04-03 16:55 ` [PATCH 2/3] Documentation/features/core: Add arch support status files for 'cBPF-JIT' and 'eBPF-JIT' Andrea Parri
2018-04-03 16:55 ` Andrea Parri
2018-04-03 16:55 ` [PATCH 3/3] Documentation/features: Refresh and auto-generate the arch support status files in place Andrea Parri
2018-04-03 16:55 ` Andrea Parri
2018-04-04 4:56 ` [RFC PATCH 0/3] Documentation/features: Provide and apply "features-refresh.sh" Ingo Molnar
2018-04-04 4:56 ` Ingo Molnar
2018-04-04 13:03 ` Andrea Parri
2018-04-04 13:03 ` Andrea Parri
2018-04-05 15:18 ` Ingo Molnar
2018-04-05 15:18 ` Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1522774551-9503-2-git-send-email-andrea.parri@amarulasolutions.com \
--to=andrea.parri@amarulasolutions.com \
--cc=corbet@lwn.net \
--cc=linux-arch@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).