nwztools: small fixes

Make sure scripts use bash, make nwz database generator more deterministic

Change-Id: I26812b697abe0406fb3c60d6eb231cb27edc81d5
This commit is contained in:
Amaury Pouly 2017-01-04 16:26:07 +01:00 committed by Gerrit Rockbox
parent d7770a1cdd
commit 3c3e133f99
6 changed files with 8 additions and 6 deletions

View file

@ -199,9 +199,9 @@ with open("nwz_db.h", "w") as fp:
# generate list of all nvp nodes
for name in sorted(g_nvp_names):
# create comment to explain the meaning, gather several meaning together
# if there are more than one
# if there are more than one (sorted to keep a stable order when we update)
explain = ""
if name in g_nvp_desc:
if name in sorted(g_nvp_desc):
explain = " | ".join(list(g_nvp_desc[name]))
# overwrite desc set with a single string for later
g_nvp_desc[name] = explain
@ -257,7 +257,7 @@ with open("nwz_db.c", "w") as fp:
fp.write(" { %s, \"%s\" },\n" % (hex(model["mid"]), model["name"]))
fp.write("};\n")
# generate nvps
for hash in g_hash_nvp:
for hash in sorted(g_hash_nvp):
nvp = g_hash_nvp[hash]
fp.write("\nstatic int nvp_index_%s[NWZ_NVP_COUNT] =\n" % hash)
fp.write("{\n")

View file

@ -1,4 +1,4 @@
#
#!/bin/bash
# usage: parse_all_nvp_headers /path/to/directory
#
# the expected structure is:

View file

@ -1,4 +1,4 @@
#
#!/bin/bash
# usage: parse_all_nvp_nodes /path/to/directory
#
# the expected structure is:

View file

@ -1,3 +1,4 @@
#!/bin/bash
# usage
# parse_header.sh /path/to/icx_nvp.h
# parse_header.sh /path/to/linux/source [file]

View file

@ -1,3 +1,4 @@
#!/bin/bash
# usage
# parse_nodes.sh /path/to/icx_nvp_emmc.ko output_file
# parse_nodes.sh /path/to/rootfs/dir output_file