xref: /OK3568_Linux_fs/kernel/Documentation/features/list-arch.sh (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun#
2*4882a593Smuzhiyun# Small script that visualizes the kernel feature support status
3*4882a593Smuzhiyun# of an architecture.
4*4882a593Smuzhiyun#
5*4882a593Smuzhiyun# (If no arguments are given then it will print the host architecture's status.)
6*4882a593Smuzhiyun#
7*4882a593Smuzhiyun
8*4882a593SmuzhiyunARCH=${1:-$(uname -m | sed 's/x86_64/x86/' | sed 's/i386/x86/')}
9*4882a593Smuzhiyun
10*4882a593Smuzhiyuncd $(dirname $0)
11*4882a593Smuzhiyunecho "#"
12*4882a593Smuzhiyunecho "# Kernel feature support matrix of the '$ARCH' architecture:"
13*4882a593Smuzhiyunecho "#"
14*4882a593Smuzhiyun
15*4882a593Smuzhiyunfor F in */*/arch-support.txt; do
16*4882a593Smuzhiyun  SUBSYS=$(echo $F | cut -d/ -f1)
17*4882a593Smuzhiyun  N=$(grep -h "^# Feature name:"        $F | cut -c25-)
18*4882a593Smuzhiyun  C=$(grep -h "^#         Kconfig:"     $F | cut -c25-)
19*4882a593Smuzhiyun  D=$(grep -h "^#         description:" $F | cut -c25-)
20*4882a593Smuzhiyun  S=$(grep -hv "^#" $F | grep -w $ARCH | cut -d\| -f3)
21*4882a593Smuzhiyun
22*4882a593Smuzhiyun  printf "%10s/%-22s:%s| %35s # %s\n" "$SUBSYS" "$N" "$S" "$C" "$D"
23*4882a593Smuzhiyundone
24*4882a593Smuzhiyun
25