~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/Documentation/features/scripts/features-refresh.sh

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 #
  2 # Small script that refreshes the kernel feature support status in place.
  3 #
  4 
  5 for F_FILE in Documentation/features/*/*/arch-support.txt; do
  6         F=$(grep "^#         Kconfig:" "$F_FILE" | cut -c26-)
  7 
  8         #
  9         # Each feature F is identified by a pair (O, K), where 'O' can
 10         # be either the empty string (for 'nop') or "not" (the logical
 11         # negation operator '!'); other operators are not supported.
 12         #
 13         O=""
 14         K=$F
 15         if [[ "$F" == !* ]]; then
 16                 O="not"
 17                 K=$(echo $F | sed -e 's/^!//g')
 18         fi
 19 
 20         #
 21         # F := (O, K) is 'valid' iff there is a Kconfig file (for some
 22         # arch) which contains K.
 23         #
 24         # Notice that this definition entails an 'asymmetry' between
 25         # the case 'O = ""' and the case 'O = "not"'. E.g., F may be
 26         # _invalid_ if:
 27         #
 28         # [case 'O = ""']
 29         #   1) no arch provides support for F,
 30         #   2) K does not exist (e.g., it was renamed/mis-typed);
 31         #
 32         # [case 'O = "not"']
 33         #   3) all archs provide support for F,
 34         #   4) as in (2).
 35         #
 36         # The rationale for adopting this definition (and, thus, for
 37         # keeping the asymmetry) is:
 38         #
 39         #       We want to be able to 'detect' (2) (or (4)).
 40         #
 41         # (1) and (3) may further warn the developers about the fact
 42         # that K can be removed.
 43         #
 44         F_VALID="false"
 45         for ARCH_DIR in arch/*/; do
 46                 K_FILES=$(find $ARCH_DIR -name "Kconfig*")
 47                 K_GREP=$(grep "$K" $K_FILES)
 48                 if [ ! -z "$K_GREP" ]; then
 49                         F_VALID="true"
 50                         break
 51                 fi
 52         done
 53         if [ "$F_VALID" = "false" ]; then
 54                 printf "WARNING: '%s' is not a valid Kconfig\n" "$F"
 55         fi
 56 
 57         T_FILE="$F_FILE.tmp"
 58         grep "^#" $F_FILE > $T_FILE
 59         echo "    -----------------------" >> $T_FILE
 60         echo "    |         arch |status|" >> $T_FILE
 61         echo "    -----------------------" >> $T_FILE
 62         for ARCH_DIR in arch/*/; do
 63                 ARCH=$(echo $ARCH_DIR | sed -e 's/^arch//g' | sed -e 's/\///g')
 64                 K_FILES=$(find $ARCH_DIR -name "Kconfig*")
 65                 K_GREP=$(grep "$K" $K_FILES)
 66                 #
 67                 # Arch support status values for (O, K) are updated according
 68                 # to the following rules.
 69                 #
 70                 #   - ("", K) is 'supported by a given arch', if there is a
 71                 #     Kconfig file for that arch which contains K;
 72                 #
 73                 #   - ("not", K) is 'supported by a given arch', if there is
 74                 #     no Kconfig file for that arch which contains K;
 75                 #
 76                 #   - otherwise: preserve the previous status value (if any),
 77                 #                default to 'not yet supported'.
 78                 #
 79                 # Notice that, according these rules, invalid features may be
 80                 # updated/modified.
 81                 #
 82                 if [ "$O" = "" ] && [ ! -z "$K_GREP" ]; then
 83                         printf "    |%12s: |  ok  |\n" "$ARCH" >> $T_FILE
 84                 elif [ "$O" = "not" ] && [ -z "$K_GREP" ]; then
 85                         printf "    |%12s: |  ok  |\n" "$ARCH" >> $T_FILE
 86                 else
 87                         S=$(grep -v "^#" "$F_FILE" | grep " $ARCH:")
 88                         if [ ! -z "$S" ]; then
 89                                 echo "$S" >> $T_FILE
 90                         else
 91                                 printf "    |%12s: | TODO |\n" "$ARCH" \
 92                                         >> $T_FILE
 93                         fi
 94                 fi
 95         done
 96         echo "    -----------------------" >> $T_FILE
 97         mv $T_FILE $F_FILE
 98 done

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php