^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) # Small script that visualizes the kernel feature support status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) # of an architecture.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) # (If no arguments are given then it will print the host architecture's status.)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) ARCH=${1:-$(uname -m | sed 's/x86_64/x86/' | sed 's/i386/x86/')}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) cd $(dirname $0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) echo "#"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) echo "# Kernel feature support matrix of the '$ARCH' architecture:"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) echo "#"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) for F in */*/arch-support.txt; do
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) SUBSYS=$(echo $F | cut -d/ -f1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) N=$(grep -h "^# Feature name:" $F | cut -c25-)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) C=$(grep -h "^# Kconfig:" $F | cut -c25-)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) D=$(grep -h "^# description:" $F | cut -c25-)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) S=$(grep -hv "^#" $F | grep -w $ARCH | cut -d\| -f3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) printf "%10s/%-22s:%s| %35s # %s\n" "$SUBSYS" "$N" "$S" "$C" "$D"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) done
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)