diff options
Diffstat (limited to 'utils/nwztools/database/nvp/parse_all_nvp_nodes.sh')
-rwxr-xr-x | utils/nwztools/database/nvp/parse_all_nvp_nodes.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/utils/nwztools/database/nvp/parse_all_nvp_nodes.sh b/utils/nwztools/database/nvp/parse_all_nvp_nodes.sh new file mode 100755 index 0000000000..3aae79deb0 --- /dev/null +++ b/utils/nwztools/database/nvp/parse_all_nvp_nodes.sh | |||
@@ -0,0 +1,32 @@ | |||
1 | # | ||
2 | # usage: parse_all_nvp_nodes /path/to/directory | ||
3 | # | ||
4 | # the expected structure is: | ||
5 | # nwz-*/rootfs.tar | ||
6 | # nwz-*/rootfs.tar | ||
7 | # | ||
8 | if [ "$#" -lt 1 ]; then | ||
9 | >&2 echo "usage: parse_all_nvp_header.sh /path/to/directory" | ||
10 | exit 1 | ||
11 | fi | ||
12 | |||
13 | # list interesting directories | ||
14 | for dir in `find "$1" -maxdepth 1 -name "nw-*" -or -name "nwz-*"` | ||
15 | do | ||
16 | # extract codename | ||
17 | codename=`basename "$dir"` | ||
18 | # only consider linux based targets | ||
19 | if [ -e "$dir/not_linux" ]; then | ||
20 | #echo "$codename: not linux based" | ||
21 | continue | ||
22 | fi | ||
23 | # check if we can find a rootfs | ||
24 | rootfs_tgz="$dir/rootfs.tgz" | ||
25 | if [ ! -e "$rootfs_tgz" ]; then | ||
26 | echo "$codename: no rootfs found" | ||
27 | continue | ||
28 | fi | ||
29 | echo "$codename: found rootfs `basename $rootfs_tgz`" | ||
30 | ./parse_nvp_nodes.sh "$rootfs_tgz" "nodes-$codename.txt" | ||
31 | done | ||
32 | |||