1 From 09f840049d155fa4b681ece749feeff9a269ecde Mon Sep 17 00:00:00 2001
2 From: Ioana Ciornei <ioana.ciornei@nxp.com>
3 Date: Tue, 24 Oct 2017 16:29:45 +0000
4 Subject: [PATCH 04/12] scripts: use restool --full-path option
6 Instead of constructing the the full path container list by
7 hand use the restool option newly added.
9 Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
11 scripts/ls-main | 54 +++++++-----------------------------------------------
12 1 file changed, 7 insertions(+), 47 deletions(-)
14 diff --git a/scripts/ls-main b/scripts/ls-main
15 index ea0df92..72f6c77 100755
24 # Intercept the Ctrl+C command but do not interrupt execution
26 @@ -87,11 +86,6 @@ root_c=
27 # Type of endpoint object
31 -# Full path containers
35 SYS_DPRC="/sys/bus/fsl-mc/drivers/fsl_mc_dprc"
38 @@ -220,42 +214,6 @@ get_container() {
39 echo $(echo "$i" | sed "s/\(dprc.[0-9]*\/\)*//g")
43 - $restool dprc list |
44 - while IFS= read -r line
46 - containers+=("$line")
49 - for i in "${containers[@]}"
51 - cnt=$(count_spaces "$i")
53 - if [ "$cnt" -gt 0 ]; then
54 - # Get index of the upper level container
58 - while [ "$idx2" -ge 0 ]
60 - cntp=$(count_spaces "${containers[idx2]}")
62 - if [ "$cntp" -lt "$cnt" ]; then
63 - upc=$(echo "${containers[idx2]}" | sed "s/ *$//")
64 - crt_ct=$upc"/""$(echo $crt_ct | sed 's/ *$//')"
79 # Retrieve the type of the object
80 too=$(echo "$1" | sed "s/\(\.[0-9]*\)\(\.[0-9]*\)*$//g")
81 @@ -897,9 +855,9 @@ process_addni() {
87 - for i in "${fpc[@]}"
88 + dprc_list="$($restool dprc list --full-path)"
89 + echo "${dprc_list}" |
92 crt_c=$(get_container "$i")
93 $restool dprc show "$crt_c" | grep dpni |
94 @@ -948,10 +906,12 @@ process_listni() {
99 + dprc_list="$($restool dprc list --full-path)"
101 - for i in "${fpc[@]}"
102 + echo "${dprc_list}" |
106 crt_c=$(get_container "$i")
107 $restool dprc show "$crt_c" | grep dpmac |
108 while IFS= read -r line