From 90284b6fe0e5ba89fe63943212bfd7ffc3e96d47 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Mon, 9 Jan 2017 21:48:43 +0100 Subject: nwztools: fix typo (nwz-zx100 -> nw-zx100) Also now gen_db.py can check for such mismatch Change-Id: I4d91aae0dde08c866eda2ed5da3c11431c46e06a --- utils/nwztools/database/gen_db.py | 5 ++ utils/nwztools/database/nvp/nodes-nw-zx100.txt | 89 ++++++++++++++++++++++++ utils/nwztools/database/nvp/nodes-nwz-zx100.txt | 89 ------------------------ utils/nwztools/database/nvp/nw-zx100.txt | 90 +++++++++++++++++++++++++ utils/nwztools/database/nvp/nwz-zx100.txt | 90 ------------------------- utils/nwztools/database/nwz_db.c | 2 +- 6 files changed, 185 insertions(+), 180 deletions(-) create mode 100644 utils/nwztools/database/nvp/nodes-nw-zx100.txt delete mode 100644 utils/nwztools/database/nvp/nodes-nwz-zx100.txt create mode 100644 utils/nwztools/database/nvp/nw-zx100.txt delete mode 100644 utils/nwztools/database/nvp/nwz-zx100.txt (limited to 'utils') diff --git a/utils/nwztools/database/gen_db.py b/utils/nwztools/database/gen_db.py index cf1423f2a5..8b7d1cbaaf 100755 --- a/utils/nwztools/database/gen_db.py +++ b/utils/nwztools/database/gen_db.py @@ -13,6 +13,7 @@ with open('models.txt') as fp: g_models.append({'mid': int(mid, 0), 'name': name}) # parse series.txt g_series = [] +g_series_codename = set() with open('series.txt') as fp: for line in fp: # we unpack and repack 1) to make the format obvious 2) to catch errors @@ -25,6 +26,7 @@ with open('series.txt') as fp: models = [] models = [int(mid,0) for mid in models] g_series.append({'codename': codename, 'name': name, 'models': models}) + g_series_codename.add(codename) # parse all maps in nvp/ # since most nvps are the same, what we actually do is to compute the md5sum hash # of all files, to identify groups and then each entry in the name is in fact the @@ -38,6 +40,9 @@ for line in subprocess.run(["md5sum"] + map_files, stdout = subprocess.PIPE).std continue hash, file = line.rstrip().split() codename = re.search('nvp/(.*)\.txt', file).group(1) + # sanity check + if not (codename in g_series_codename): + print("Warning: file %s does not have a match series in series.txt" % file) hash = hash[:HASH_SIZE] # only keep one file if not (hash in g_hash_nvp): diff --git a/utils/nwztools/database/nvp/nodes-nw-zx100.txt b/utils/nwztools/database/nvp/nodes-nw-zx100.txt new file mode 100644 index 0000000000..2beb185b6c --- /dev/null +++ b/utils/nwztools/database/nvp/nodes-nw-zx100.txt @@ -0,0 +1,89 @@ +1,4,system information +2,32,u-boot password +3,4,firmware update flag +4,4,beep ok flag +5,4,hold mode +6,16,rtc alarm +7,64,model id +8,5,product code +9,16,serial number +10,8,update file name +11,64,key and signature +12,32,ship information +13,4,test mode flag +14,4,getty mode flag +15,16,fm parameter +16,64,sound driver parameter +17,64,noise cancel driver parameter +18,512,bluetooth pskey +77,4,wifi protected setup +85,4,battery calibration +19,2048,bluetooth parameter +20,512,btmw factory pair info +21,512,btmw factory scdb +22,4,btmw log mode flag +78,4,application debug mode flag +79,4,browser log mode flag +80,4,time out to sleep +81,4,europe vol regulation flag +82,4,function information +83,4,service id +84,4,marlin key +86,4,MSC only mode flag +89,4,SD Card export flag +23,704,aad/empr key +24,160,aad icv +25,520,empr icv +26,4,key mode (debug/release) +27,64,random data +28,8224,slacker id file +29,64,starfish id +30,33024,marlin device key +31,20,secure clock +32,16,slacker time +33,64,marlin time +34,16384,EKB 0 +35,16384,EKB 1 +36,1024,EMPR 0 +37,1024,EMPR 1 +38,1024,EMPR 2 +39,1024,EMPR 3 +40,1024,EMPR 4 +41,1024,EMPR 5 +42,1024,EMPR 6 +43,1024,EMPR 7 +44,1024,EMPR 8 +45,1024,EMPR 9 +46,1024,EMPR 10 +47,1024,EMPR 11 +48,1024,EMPR 12 +49,1024,EMPR 13 +50,1024,EMPR 14 +51,1024,EMPR 15 +52,1024,EMPR 16 +53,1024,EMPR 17 +54,1024,EMPR 18 +55,1024,EMPR 19 +56,1024,EMPR 20 +57,1024,EMPR 21 +58,1024,EMPR 22 +59,1024,EMPR 23 +60,1024,EMPR 24 +61,1024,EMPR 25 +62,1024,EMPR 26 +63,1024,EMPR 27 +64,1024,EMPR 28 +65,1024,EMPR 29 +66,1024,EMPR 30 +67,1024,EMPR 31 +68,4,color variation +69,4,speaker ship info +70,8,middleware parameter +71,4,quick shutdown flag +72,262144,boot image +73,262144,hold image +74,262144,low battery image +75,262144,update image +76,262144,update error image +87,262144,precharge image +88,262144,dead battery image diff --git a/utils/nwztools/database/nvp/nodes-nwz-zx100.txt b/utils/nwztools/database/nvp/nodes-nwz-zx100.txt deleted file mode 100644 index 2beb185b6c..0000000000 --- a/utils/nwztools/database/nvp/nodes-nwz-zx100.txt +++ /dev/null @@ -1,89 +0,0 @@ -1,4,system information -2,32,u-boot password -3,4,firmware update flag -4,4,beep ok flag -5,4,hold mode -6,16,rtc alarm -7,64,model id -8,5,product code -9,16,serial number -10,8,update file name -11,64,key and signature -12,32,ship information -13,4,test mode flag -14,4,getty mode flag -15,16,fm parameter -16,64,sound driver parameter -17,64,noise cancel driver parameter -18,512,bluetooth pskey -77,4,wifi protected setup -85,4,battery calibration -19,2048,bluetooth parameter -20,512,btmw factory pair info -21,512,btmw factory scdb -22,4,btmw log mode flag -78,4,application debug mode flag -79,4,browser log mode flag -80,4,time out to sleep -81,4,europe vol regulation flag -82,4,function information -83,4,service id -84,4,marlin key -86,4,MSC only mode flag -89,4,SD Card export flag -23,704,aad/empr key -24,160,aad icv -25,520,empr icv -26,4,key mode (debug/release) -27,64,random data -28,8224,slacker id file -29,64,starfish id -30,33024,marlin device key -31,20,secure clock -32,16,slacker time -33,64,marlin time -34,16384,EKB 0 -35,16384,EKB 1 -36,1024,EMPR 0 -37,1024,EMPR 1 -38,1024,EMPR 2 -39,1024,EMPR 3 -40,1024,EMPR 4 -41,1024,EMPR 5 -42,1024,EMPR 6 -43,1024,EMPR 7 -44,1024,EMPR 8 -45,1024,EMPR 9 -46,1024,EMPR 10 -47,1024,EMPR 11 -48,1024,EMPR 12 -49,1024,EMPR 13 -50,1024,EMPR 14 -51,1024,EMPR 15 -52,1024,EMPR 16 -53,1024,EMPR 17 -54,1024,EMPR 18 -55,1024,EMPR 19 -56,1024,EMPR 20 -57,1024,EMPR 21 -58,1024,EMPR 22 -59,1024,EMPR 23 -60,1024,EMPR 24 -61,1024,EMPR 25 -62,1024,EMPR 26 -63,1024,EMPR 27 -64,1024,EMPR 28 -65,1024,EMPR 29 -66,1024,EMPR 30 -67,1024,EMPR 31 -68,4,color variation -69,4,speaker ship info -70,8,middleware parameter -71,4,quick shutdown flag -72,262144,boot image -73,262144,hold image -74,262144,low battery image -75,262144,update image -76,262144,update error image -87,262144,precharge image -88,262144,dead battery image diff --git a/utils/nwztools/database/nvp/nw-zx100.txt b/utils/nwztools/database/nvp/nw-zx100.txt new file mode 100644 index 0000000000..e7ed5a0bd4 --- /dev/null +++ b/utils/nwztools/database/nvp/nw-zx100.txt @@ -0,0 +1,90 @@ +dbg,000 +syi,001 +ubp,002 +fup,003 +bok,004 +hld,005 +rtc,006 +mid,007 +pcd,008 +ser,009 +ufn,010 +kas,011 +shp,012 +tst,013 +gty,014 +fmp,015 +sdp,016 +ncp,017 +psk,018 +pts,077 +btc,085 +bpr,019 +bfp,020 +bfd,021 +bml,022 +apd,078 +blf,079 +slp,080 +vrt,081 +fni,082 +sid,083 +mlk,084 +mso,086 +sdc,089 +cng,023 +dba,024 +dbv,025 +dor,026 +rnd,027 +skd,028 +sfi,029 +mdk,030 +dcc,031 +skt,032 +mtm,033 +tr0,034 +tr1,035 +e00,036 +e01,037 +e02,038 +e03,039 +e04,040 +e05,041 +e06,042 +e07,043 +e08,044 +e09,045 +e10,046 +e11,047 +e12,048 +e13,049 +e14,050 +e15,051 +e16,052 +e17,053 +e18,054 +e19,055 +e20,056 +e21,057 +e22,058 +e23,059 +e24,060 +e25,061 +e26,062 +e27,063 +e28,064 +e29,065 +e30,066 +e31,067 +clv,068 +sps,069 +mdl,070 +edw,071 +bti,072 +hdi,073 +lbi,074 +fui,075 +eri,076 +pci,087 +dbi,088 diff --git a/utils/nwztools/database/nvp/nwz-zx100.txt b/utils/nwztools/database/nvp/nwz-zx100.txt deleted file mode 100644 index e7ed5a0bd4..0000000000 --- a/utils/nwztools/database/nvp/nwz-zx100.txt +++ /dev/null @@ -1,90 +0,0 @@ -dbg,000 -syi,001 -ubp,002 -fup,003 -bok,004 -hld,005 -rtc,006 -mid,007 -pcd,008 -ser,009 -ufn,010 -kas,011 -shp,012 -tst,013 -gty,014 -fmp,015 -sdp,016 -ncp,017 -psk,018 -pts,077 -btc,085 -bpr,019 -bfp,020 -bfd,021 -bml,022 -apd,078 -blf,079 -slp,080 -vrt,081 -fni,082 -sid,083 -mlk,084 -mso,086 -sdc,089 -cng,023 -dba,024 -dbv,025 -dor,026 -rnd,027 -skd,028 -sfi,029 -mdk,030 -dcc,031 -skt,032 -mtm,033 -tr0,034 -tr1,035 -e00,036 -e01,037 -e02,038 -e03,039 -e04,040 -e05,041 -e06,042 -e07,043 -e08,044 -e09,045 -e10,046 -e11,047 -e12,048 -e13,049 -e14,050 -e15,051 -e16,052 -e17,053 -e18,054 -e19,055 -e20,056 -e21,057 -e22,058 -e23,059 -e24,060 -e25,061 -e26,062 -e27,063 -e28,064 -e29,065 -e30,066 -e31,067 -clv,068 -sps,069 -mdl,070 -edw,071 -bti,072 -hdi,073 -lbi,074 -fui,075 -eri,076 -pci,087 -dbi,088 diff --git a/utils/nwztools/database/nwz_db.c b/utils/nwztools/database/nwz_db.c index 4edbb2e1c2..d5c226203b 100644 --- a/utils/nwztools/database/nwz_db.c +++ b/utils/nwztools/database/nwz_db.c @@ -1144,6 +1144,6 @@ struct nwz_series_info_t nwz_series[NWZ_SERIES_COUNT] = { "nw-s780", "NW-S780 Series", 4, models_nw_s780, &nvp_index_6485c8 }, { "nw-wm1", "NW-WM1 Series", 2, models_nw_wm1, &nvp_index_398250 }, { "nwz-x1000", "NWZ-X1000 Series", 9, models_nwz_x1000, 0 }, - { "nw-zx100", "NW-ZX100 Series", 6, models_nw_zx100, 0 }, + { "nw-zx100", "NW-ZX100 Series", 6, models_nw_zx100, &nvp_index_92faee }, { "nwz-noname", "NONAME", 3, models_nwz_noname, 0 }, }; -- cgit v1.2.3