SB30 OTA Guide » History » Version 1
Lion Wang, 08/06/2021 09:46 AM
1 | 1 | Lion Wang | h1. SB30 OTA Guide |
---|---|---|---|
2 | |||
3 | Update device.mk & BoardConfig.mk |
||
4 | |||
5 | 1. Modify device/inoco/sb30/device.mk |
||
6 | Update OTA url (persist.vendor.otaurl) to customer's server. |
||
7 | For example, update OTA url to "https://www.custurl.com" |
||
8 | |||
9 | persist.vendor.otaurl=https://www.custurl.com/download/SB30.json |
||
10 | |||
11 | 2. Apply "sb30_ota.patch" |
||
12 | |||
13 | Index: device/inoco/sb30/BoardConfig.mk |
||
14 | =================================================================== |
||
15 | --- device/inoco/sb30/BoardConfig.mk |
||
16 | +++ device/inoco/sb30/BoardConfig.mk |
||
17 | @@ -16,6 +16,9 @@ |
||
18 | endif |
||
19 | BOARD_FLASH_BLOCK_SIZE := 4096 |
||
20 | |||
21 | +#build timestamp |
||
22 | +BUILD_NUMBER := $(shell date +%s) |
||
23 | + |
||
24 | # Add path of project sepolicy folder |
||
25 | BOARD_SEPOLICY_DIRS += \ |
||
26 | device/inoco/$(MTK_TARGET_PROJECT)/sepolicy |
||
27 | |||
28 | 3. Build OTA package |
||
29 | $ export INOCO_RPI=yes |
||
30 | $ source build/envsetup.sh |
||
31 | $ lunch sb30-userdebug |
||
32 | $ make -j8 |
||
33 | $ make otapackage |
||
34 | $ export INOCO_RPI= |
||
35 | |||
36 | The ota package will be located at out/target/product/sb30/sb30-ota-???.zip |
||
37 | |||
38 | OTA by local |
||
39 | ABOTAUpdate App > Option menu > Pick File > Select "sb30-ota-???.zip" |
||
40 | |||
41 | OTA by server |
||
42 | Extract "sb30-ota-???.zip", you can find version/hash/size/incremental information as below to modify SB30.json. |
||
43 | |||
44 | For example, extract sb30-ota-eng.lin.zip: |
||
45 | |||
46 | sb30-ota-eng.lin/payload.bin (This is the OTA download file) |
||
47 | sb30-ota-eng.lin/payload_properties.txt |
||
48 | FILE_HASH=KrcnrqCzAIcnnjc1ysoVY0jpIgDPsVPB9oGjjyg34fI= |
||
49 | FILE_SIZE=411430579 |
||
50 | METADATA_HASH=ePssh8AaT6JuDcQznmqq/kHi+ZwSUr2tBXEXwq4xLnQ= |
||
51 | METADATA_SIZE=110793 |
||
52 | |||
53 | sb30-ota-eng.lin/META-INF/com/android/metadata |
||
54 | post-build-incremental=1581318174 |
||
55 | Upload SB30.json to https://www.custurl.com/download/ |
||
56 | Upload payload.bin to https://www.custurl.com/download/ |
||
57 | |||
58 | SB30.json: |
||
59 | |||
60 | { |
||
61 | "master":{ |
||
62 | "version":"1581318174", |
||
63 | "url":"https://www.custurl.com/download/payload.bin", |
||
64 | "description":"This is Note for Master, upgrade to version 1581318174", |
||
65 | "FILE_HASH":"KrcnrqCzAIcnnjc1ysoVY0jpIgDPsVPB9oGjjyg34fI=", |
||
66 | "FILE_SIZE":411430579, |
||
67 | "METADATA_HASH":"ePssh8AaT6JuDcQznmqq/kHi+ZwSUr2tBXEXwq4xLnQ=", |
||
68 | "METADATA_SIZE":110793 |
||
69 | } |
||
70 | } |
||
71 | ABOTAUpdate App will compare "version"(the value of ro.build.version.incremental) from this content and then use TAG "url" as downloading path. |
||
72 | If your firmware version is NUM_VERSION_A and then you will download version_a+.bin as your new firmware. |
||
73 | If your firmware version can't be found through JSON file, and your firmware version is older than NUM_VERSION_B, then you will download "master" url specified version_b.bin as your new firmware. |
||
74 | Sample Content of SB30.json |
||
75 | |||
76 | { |
||
77 | |||
78 | "master":{ |
||
79 | "version":"NUM_VERSION_B", |
||
80 | "url":"https://www.custurl.com/download/version_b.bin", |
||
81 | ... |
||
82 | }, |
||
83 | "NUM_VERSION_A":{ |
||
84 | "version":"NUM_VERSION_A+", |
||
85 | "url":"https://www.custurl.com/download/version_a+.bin", |
||
86 | ... |
||
87 | } |
||
88 | } |