diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2017-01-04 16:26:07 +0100 |
---|---|---|
committer | Gerrit Rockbox <gerrit@rockbox.org> | 2017-01-04 17:03:14 +0100 |
commit | 3c3e133f99f38f9746df7c51ded6671ffa987504 (patch) | |
tree | 9b5763c18c9e0d430aadd8ba8b0126eb8907a836 /utils | |
parent | d7770a1cddeb94826046b9c58107f967e5462810 (diff) | |
download | rockbox-3c3e133f99f38f9746df7c51ded6671ffa987504.tar.gz rockbox-3c3e133f99f38f9746df7c51ded6671ffa987504.zip |
nwztools: small fixes
Make sure scripts use bash, make nwz database generator more deterministic
Change-Id: I26812b697abe0406fb3c60d6eb231cb27edc81d5
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/nwztools/database/gen_db.py | 6 | ||||
-rwxr-xr-x | utils/nwztools/database/nvp/parse_all_nvp_headers.sh | 2 | ||||
-rwxr-xr-x | utils/nwztools/database/nvp/parse_all_nvp_nodes.sh | 2 | ||||
-rwxr-xr-x | utils/nwztools/database/nvp/parse_nvp_header.sh | 1 | ||||
-rwxr-xr-x | utils/nwztools/database/nvp/parse_nvp_nodes.sh | 1 | ||||
-rw-r--r-- | utils/nwztools/emmctools/nvp.c | 2 |
6 files changed, 8 insertions, 6 deletions
diff --git a/utils/nwztools/database/gen_db.py b/utils/nwztools/database/gen_db.py index 61c08f919a..792a1b91c2 100755 --- a/utils/nwztools/database/gen_db.py +++ b/utils/nwztools/database/gen_db.py | |||
@@ -199,9 +199,9 @@ with open("nwz_db.h", "w") as fp: | |||
199 | # generate list of all nvp nodes | 199 | # generate list of all nvp nodes |
200 | for name in sorted(g_nvp_names): | 200 | for name in sorted(g_nvp_names): |
201 | # create comment to explain the meaning, gather several meaning together | 201 | # create comment to explain the meaning, gather several meaning together |
202 | # if there are more than one | 202 | # if there are more than one (sorted to keep a stable order when we update) |
203 | explain = "" | 203 | explain = "" |
204 | if name in g_nvp_desc: | 204 | if name in sorted(g_nvp_desc): |
205 | explain = " | ".join(list(g_nvp_desc[name])) | 205 | explain = " | ".join(list(g_nvp_desc[name])) |
206 | # overwrite desc set with a single string for later | 206 | # overwrite desc set with a single string for later |
207 | g_nvp_desc[name] = explain | 207 | g_nvp_desc[name] = explain |
@@ -257,7 +257,7 @@ with open("nwz_db.c", "w") as fp: | |||
257 | fp.write(" { %s, \"%s\" },\n" % (hex(model["mid"]), model["name"])) | 257 | fp.write(" { %s, \"%s\" },\n" % (hex(model["mid"]), model["name"])) |
258 | fp.write("};\n") | 258 | fp.write("};\n") |
259 | # generate nvps | 259 | # generate nvps |
260 | for hash in g_hash_nvp: | 260 | for hash in sorted(g_hash_nvp): |
261 | nvp = g_hash_nvp[hash] | 261 | nvp = g_hash_nvp[hash] |
262 | fp.write("\nstatic int nvp_index_%s[NWZ_NVP_COUNT] =\n" % hash) | 262 | fp.write("\nstatic int nvp_index_%s[NWZ_NVP_COUNT] =\n" % hash) |
263 | fp.write("{\n") | 263 | fp.write("{\n") |
diff --git a/utils/nwztools/database/nvp/parse_all_nvp_headers.sh b/utils/nwztools/database/nvp/parse_all_nvp_headers.sh index e84eaae8f5..331016b045 100755 --- a/utils/nwztools/database/nvp/parse_all_nvp_headers.sh +++ b/utils/nwztools/database/nvp/parse_all_nvp_headers.sh | |||
@@ -1,4 +1,4 @@ | |||
1 | # | 1 | #!/bin/bash |
2 | # usage: parse_all_nvp_headers /path/to/directory | 2 | # usage: parse_all_nvp_headers /path/to/directory |
3 | # | 3 | # |
4 | # the expected structure is: | 4 | # the expected structure is: |
diff --git a/utils/nwztools/database/nvp/parse_all_nvp_nodes.sh b/utils/nwztools/database/nvp/parse_all_nvp_nodes.sh index 3aae79deb0..3e67b3d354 100755 --- a/utils/nwztools/database/nvp/parse_all_nvp_nodes.sh +++ b/utils/nwztools/database/nvp/parse_all_nvp_nodes.sh | |||
@@ -1,4 +1,4 @@ | |||
1 | # | 1 | #!/bin/bash |
2 | # usage: parse_all_nvp_nodes /path/to/directory | 2 | # usage: parse_all_nvp_nodes /path/to/directory |
3 | # | 3 | # |
4 | # the expected structure is: | 4 | # the expected structure is: |
diff --git a/utils/nwztools/database/nvp/parse_nvp_header.sh b/utils/nwztools/database/nvp/parse_nvp_header.sh index 853df93557..8baab3c9eb 100755 --- a/utils/nwztools/database/nvp/parse_nvp_header.sh +++ b/utils/nwztools/database/nvp/parse_nvp_header.sh | |||
@@ -1,3 +1,4 @@ | |||
1 | #!/bin/bash | ||
1 | # usage | 2 | # usage |
2 | # parse_header.sh /path/to/icx_nvp.h | 3 | # parse_header.sh /path/to/icx_nvp.h |
3 | # parse_header.sh /path/to/linux/source [file] | 4 | # parse_header.sh /path/to/linux/source [file] |
diff --git a/utils/nwztools/database/nvp/parse_nvp_nodes.sh b/utils/nwztools/database/nvp/parse_nvp_nodes.sh index cf42504e32..456a707e5d 100755 --- a/utils/nwztools/database/nvp/parse_nvp_nodes.sh +++ b/utils/nwztools/database/nvp/parse_nvp_nodes.sh | |||
@@ -1,3 +1,4 @@ | |||
1 | #!/bin/bash | ||
1 | # usage | 2 | # usage |
2 | # parse_nodes.sh /path/to/icx_nvp_emmc.ko output_file | 3 | # parse_nodes.sh /path/to/icx_nvp_emmc.ko output_file |
3 | # parse_nodes.sh /path/to/rootfs/dir output_file | 4 | # parse_nodes.sh /path/to/rootfs/dir output_file |
diff --git a/utils/nwztools/emmctools/nvp.c b/utils/nwztools/emmctools/nvp.c index c679c1098b..bbc05563b5 100644 --- a/utils/nwztools/emmctools/nvp.c +++ b/utils/nwztools/emmctools/nvp.c | |||
@@ -553,4 +553,4 @@ int nvp_info(void) | |||
553 | } | 553 | } |
554 | 554 | ||
555 | return 0; | 555 | return 0; |
556 | } \ No newline at end of file | 556 | } |