# # Small script that visualizes the kernel feature support status # of an architecture. # # (If no arguments are given then it will print the host architecture's status.) # global ARCH := $(1:-$(uname -m | sed 's/x86_64/x86/' | sed 's/i386/x86/')) cd $[dirname $0] echo "#" echo "# Kernel feature support matrix of the '$ARCH' architecture:" echo "#" for F in [*/*/arch-support.txt] { global SUBSYS := $[echo $F | cut -d/ -f1] global N := $[grep -h "^# Feature name:" $F | cut -c25-] global C := $[grep -h "^# Kconfig:" $F | cut -c25-] global D := $[grep -h "^# description:" $F | cut -c25-] global S := $[grep -hw $ARCH $F | cut -d'|' -f3] printf "%10s/%-22s:%s| %35s # %s\n" $SUBSYS $N $S $C $D } (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ARCH) op: Equal rhs: { (BracedVarSub token: suffix_op: (StringUnary op_id: VTest_ColonHyphen arg_word: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(uname)} {(-m)}) (C {(sed)} {(SQ )}) (C {(sed)} {(SQ )}) ] negated: False ) ] ) left_token: spids: [23 43] ) } ) spids: [20 44] ) } spids: [19] ) ] spids: [19] ) (C {(cd)} { (CommandSubPart command_list: (CommandList children:[(C {(dirname)} {($ VSub_Number "$0")})]) left_token: spids: [49 53] ) } ) (C {(echo)} {(DQ ("#"))}) (C {(echo)} {(DQ ("# Kernel feature support matrix of the '") ($ VSub_Name "$ARCH") ("' architecture:"))} ) (C {(echo)} {(DQ ("#"))}) (ForEach iter_name: F iter_words: [{(Lit_Other "*") (/) (Lit_Other "*") (/arch-support.txt)}] do_arg_iter: False body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:SUBSYS) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [(C {(echo)} {($ VSub_Name "$F")}) (C {(cut)} {(-d/)} {(-f1)})] negated: False ) ] ) left_token: spids: [92 104] ) } spids: [91] ) ] spids: [91] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:N) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(grep)} {(-h)} {(DQ ("^# Feature name:"))} {($ VSub_Name "$F")}) (C {(cut)} {(-c25-)}) ] negated: False ) ] ) left_token: spids: [108 124] ) } spids: [107] ) ] spids: [107] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:C) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(grep)} {(-h)} {(DQ ("^# Kconfig:"))} {($ VSub_Name "$F")}) (C {(cut)} {(-c25-)}) ] negated: False ) ] ) left_token: spids: [128 144] ) } spids: [127] ) ] spids: [127] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:D) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(grep)} {(-h)} {(DQ ("^# description:"))} {($ VSub_Name "$F")} ) (C {(cut)} {(-c25-)}) ] negated: False ) ] ) left_token: spids: [148 164] ) } spids: [147] ) ] spids: [147] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:S) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(grep)} {(-hw)} {($ VSub_Name "$ARCH")} {($ VSub_Name "$F")}) (C {(cut)} {(-d) (EscapedLiteralPart token:)} {(-f3)} ) ] negated: False ) ] ) left_token: spids: [168 185] ) } spids: [167] ) ] spids: [167] ) (C {(printf)} {(DQ ("%10s/%-22s:%s| %35s # %s") (EscapedLiteralPart token:))} {(DQ ($ VSub_Name "$SUBSYS"))} {(DQ ($ VSub_Name "$N"))} {(DQ ($ VSub_Name "$S"))} {(DQ ($ VSub_Name "$C"))} {(DQ ($ VSub_Name "$D"))} ) ] spids: [88 216] ) spids: [81 86] ) ] )