1
0
Fork 0
forked from len0rd/rockbox

sonynwz: add nvp nodes for NW-A40/ZX300, various fixes for tools

We still miss the model IDS for those device so scsitool won't be able to
recognize them automatically.

Change-Id: I17ae0f0d95c011cea8e289def63c7673b6c4b667
This commit is contained in:
Amaury Pouly 2017-10-06 11:28:30 +02:00
parent 3f1e4a0b1a
commit 698779e3e8
7 changed files with 351 additions and 4 deletions

View file

@ -4,6 +4,17 @@ import os
import re
import subprocess
import hashlib
import sys
# arguments
if len(sys.argv) != 2:
print("Usage: %s output_directory" % sys.argv[0])
exit(1)
output_directory = sys.argv[1]
# check path is valid
if not os.path.isdir(output_directory):
print("Error: '%s' is not a valid directory" % output_directory)
exit(1)
# parse models.txt
g_models = []
@ -200,7 +211,7 @@ extern struct nwz_series_info_t nwz_series[NWZ_SERIES_COUNT];
#endif /* __NWZ_DB_H__ */
"""
with open("nwz-db.h", "w") as fp:
with open(os.path.join(output_directory, "nwz-db.h"), "w") as fp:
fp.write(header_begin)
# generate list of all nvp nodes
for name in sorted(g_nvp_names):
@ -256,7 +267,7 @@ def by_name(nvp_entry):
def codename_to_c(codename):
return re.sub('[^a-zA-Z0-9]', '_', codename, 0)
with open("nwz-db.c", "w") as fp:
with open(os.path.join(output_directory, "nwz-db.c"), "w") as fp:
fp.write(impl_begin)
# generate model list (sort by mid)
for model in sorted(g_models, key = by_mid):