rockbox/utils/nwztools/database/nvp/parse_all_nvp_nodes.sh
Amaury Pouly 3c3e133f99 nwztools: small fixes
Make sure scripts use bash, make nwz database generator more deterministic

Change-Id: I26812b697abe0406fb3c60d6eb231cb27edc81d5
2017-01-04 17:03:14 +01:00

32 lines
833 B
Bash
Executable file

#!/bin/bash
# usage: parse_all_nvp_nodes /path/to/directory
#
# the expected structure is:
# nwz-*/rootfs.tar
# nwz-*/rootfs.tar
#
if [ "$#" -lt 1 ]; then
>&2 echo "usage: parse_all_nvp_header.sh /path/to/directory"
exit 1
fi
# list interesting directories
for dir in `find "$1" -maxdepth 1 -name "nw-*" -or -name "nwz-*"`
do
# extract codename
codename=`basename "$dir"`
# only consider linux based targets
if [ -e "$dir/not_linux" ]; then
#echo "$codename: not linux based"
continue
fi
# check if we can find a rootfs
rootfs_tgz="$dir/rootfs.tgz"
if [ ! -e "$rootfs_tgz" ]; then
echo "$codename: no rootfs found"
continue
fi
echo "$codename: found rootfs `basename $rootfs_tgz`"
./parse_nvp_nodes.sh "$rootfs_tgz" "nodes-$codename.txt"
done