Project

General

Profile

EC20 DFOTA » History » Version 2

zecke, 12/04/2016 03:58 PM

1 1 zecke
h1. EC20/EC25 Delta Firmware over the air (DFOTA) upgrades
2
3
An example of the DFOTA file is here: http://dfota.quectel-service.com:8088/Dfiles/EC20/EC20EQAR02A05V03-R02A09V02.zip
4
5
h2. Start delta upgrade
6
7
<pre>
8
AT+QFOTADL="http://dfota.quectel-service.com:8088/Dfiles/EC20/EC20EQAR02A05V03-R02A09V02.zip"
9
</pre>
10
11
It will start an internal connection manager to terminate data on the Linux module and then run wget to store the file to
12
"update.zip". If it worked a reboot into the recovery system will be made.
13
14
h2. Recovery image
15
16
It seems that /usr/bin/recovery will be started and finds a update.zip in the right partition and will then apply
17
the delta updates.
18
19
20
h2. Delta format
21
22
Delta updates are available for the bootloader (?), dsp, userdata and system. It is speculated that for the
23
system and userdata yaffs2 the actual filesystem will be mounted and individual files will be modified.
24
25
<pre>
26
struct upgrade_file_begin {
27
   uint32_t checksum; // ???? different in all of these upgrades
28
   uint32_t __le len; // len.. E.g. 184014 of a 184059 file
29
   ... still a lot of 32bit length.. not really TLV
30
};
31
struct upgrade_file_trailer {
32
  uint32_t __le len;
33
  char name[len]; with trailing \0
34
  uint32_t null_end (four bytes 0x00)
35
};
36
</pre>
37 2 zecke
38
39
h2. Kicking the recovery binary
40
41
* mount /dev/mtdblock14 /mnt..
42
* Place update.zip to /cache/
43
* echo "IP_START_UPDATE" > /cache/fota/ipth_config_dfs.txt  to say what to do
44
45
Was difficult to repeat, e.g. creating backup and mounting system partition failed on second/third tries
46
47
<pre>
48
/ # ./strace -o foo.txt -f ./recovery2 
49
mount: mounting none on /sys/kernel/debug failed: Device or resource busy
50
Starting recovery on Fri Oct 14 12:39:48 2016
51
recovery filesystem table
52
=========================
53
  0 /tmp ramdisk (null) (null) 0
54
  1 / auto rootfs (null) 0
55
  2 /proc proc proc (null) 0
56
  3 /dev/pts devpts devpts (null) 0
57
  4 /proc/bus/usb usbfs usbfs (null) 0
58
  5 /dev/shm tmpfs tmpfs (null) 0
59
  6 /cache yaffs2 /dev/mtdblock9 (null) 0
60
  7 /media/card auto /dev/mmcblk0p1 (null) 0
61
  8 /system yaffs2 /dev/mtdblock14 (null) 0
62
  9 /data yaffs2 /dev/mtdblock15 (null) 0
63
  10 /misc mtd /dev/mtdblock10 (null) 0
64
65
rootfs on / type rootfs (rw)
66
/dev/root on / type yaffs2 (rw,relatime)
67
proc on /proc type proc (rw,relatime)
68
sysfs on /sys type sysfs (rw,relatime)
69
tmpfs on /dev type tmpfs (rw,relatime,size=64k,mode=755)
70
devpts on /dev/pts type devpts (rw,relatime,mode=600)
71
tmpfs on /dev/shm type tmpfs (rw,relatime,mode=777)
72
/dev/mtdblock15 on /usr type yaffs2 (rw,relatime)
73
/dev/mtdblock9 on /cache type yaffs2 (rw,relatime)
74
/dev/mtdblock13 on / type yaffs (rw,relatime)
75
tmpfs on /dev type tmpfs (rw,relatime,size=64k,mode=755)
76
/dev/mtdblock9 on /cache type yaffs2 (rw,relatime)
77
none on /sys type sysfs (rw,relatime)
78
none on /sys/kernel/debug type debugfs (rw,relatime)
79
proc on /proc type proc (rw,relatime)
80
total 3
81
lrwxrwxrwx    1 root     root            31 Jul 21 07:10 boot_hsic_composition -> /usr/bin/usb/compositions/empty
82
lrwxrwxrwx    1 root     root            30 Jul 21 07:10 boot_hsusb_composition -> /usr/bin/usb/compositions/9215
83
drwxr-xr-x    1 root     root          2048 Jul 21 07:10 compositions
84
crw--w----    1 root     root      247,   0 Jan  8  1970 /dev/ttyGS0
85
RB_Progress: fwrite "/dev/ttyGS1" fail
86
I:Checking delta update status...
87
handle_redbend_update: START_DELTA_UPDATE
88
I:Setting delta update status...
89
I:Delta update status is set to (IP_PREVIOUS_UPDATE_IN_PROGRESS 0)
90
I:Start delta update...
91
I:Setting recovery boot...
92
I:Recovery mode reached maximum retry. Clear boot message.
93
mtd: successfully wrote block at bebe0f4800000000
94
I:Set boot command ""
95
I:boot.command=
96
I:boot.recovery=
97
I:Update location: /cache/update.zip
98
I:number of files in zip is 1 
99
I:verifying file at index 0
100
I:No radio diff images found 
101
I:system.diff found 
102
E:No modem package available.
103
E:No modem update needed. returning O.K
104
mtd: successfully wrote block at bebe23a000000000
105
I:Reset FOTA cookie done.
106
start fota update (/cache/fota/system.diff)
107
redbend_fs_entry: device_name: /dev/mtdblock14
108
redbend_fs_entry: mount_point: /tmp/system
109
redbend_fs_entry: update_name: /cache/fota/system.diff
110
redbend_fs_entry: part_name: system
111
112
113
114
RB_GetDelta: offset 0x0(0), size 0x14(20)
115
RB_GetDelta: offset 0x0(0), size 0x18(24)
116
RB_GetDelta: offset 0x4(4), size 0x3508(13576)
117
RB_GetDelta: offset 0x0(0), size 0x40(64)
118
RB_GetDelta: offset 0x350c(13580), size 0x18(24)
119
RB_GetDelta: offset 0x3510(13584), size 0x27(39)
120
RB_GetDelta: offset 0x0(0), size 0x14(20)
121
RB_GetDelta: offset 0x0(0), size 0x18(24)
122
RB_GetDelta: offset 0x350c(13580), size 0x18(24)
123
RB_GetDelta: offset 0x0(0), size 0x18(24)
124
RB_GetDelta: offset 0x0(0), size 0x18(24)
125
RB_GetDelta: offset 0x350c(13580), size 0x18(24)
126
RB_GetDelta: offset 0x3524(13604), size 0x4(4)
127
RB_GetDelta: offset 0x3528(13608), size 0x4(4)
128
RB_GetDelta: offset 0x352c(13612), size 0x7(7)
129
RB_GetDelta: offset 0x0(0), size 0x40(64)
130
RB_GetDelta: offset 0x0(0), size 0x40(64)
131
RB_GetDelta: offset 0x40(64), size 0x304(772)
132
RB_GetDelta: offset 0x344(836), size 0xd(13)
133
RB_GetDelta: offset 0x351(849), size 0x4a8(1192)
134
FS partition delta dump
135
RedBend: Delta Info: delta_sig - 0x6d0d05e5
136
RedBend: Delta Info: delta_size - 13580
137
RedBend: Delta Info: ver - 82000
138
RedBend: Delta Info: scout_ver - 80000
139
RedBend: Delta Info: flags - 0x80000000
140
RedBend: Delta Info: runtype_flags - 0x280
141
RedBend: Delta Info: ram_size - 0x200c8
142
RedBend: Delta Info: sector_size - 0x40000
143
RedBend: Delta Info: dic_sz - 0xdc8
144
RedBend: Delta Info: compress_sz - 0x4b5
145
RedBend: Delta Info: min_alloc_ram_use - 0x22
146
RedBend: Delta Info: ext_info_sz - 2
147
RedBend: Delta Info: num_copy - 0
148
RedBend: Delta Info: num_diff - 95
149
RedBend: Delta Info: num_insert - 3
150
RedBend: Delta Info: num_delete - 0
151
RedBend: Delta Info: num_del_dirs - 0
152
RedBend: Delta Info: num_dirs - 0
153
RedBend: Delta Info: num_del_link - 0
154
RedBend: Delta Info: num_link - 4
155
RedBend: Delta Info: num_critical_update - 95
156
RedBend: Delta Info: num_critical_insert - 3
157
RB_CreateFolder: /cache/fota/a, mode:0x1ff
158
open file /cache/fota/a/backup
159
RB_OpenFile: Path:/cache/fota/a/backup | Mode: RDONLY 
160
 First open() with error 2
161
open file /tmp/system/etc/version
162
RB_OpenFile: Path:/tmp/system/etc/version | Mode: RDONLY 
163
 First open() with error 2
164
open file /tmp/system/etc/version
165
RB_OpenFile: Path:/tmp/system/etc/version | Mode: RDONLY 
166
 First open() with error 2
167
RedBend: Error in scout, file signature mismatch in file /tmp/system/etc/version
168
umount: can't umount /tmp/system: No such file or directory
169
fota update fail (/cache/fota/system.diff)
170
I:fs:/cache/update.zip update err
171
mtd: successfully wrote block at bebe23a000000000
172
I:Reset FOTA cookie done.
173
mtd: successfully wrote block at bebe0f3800000000
174
I:Set boot command ""
175
I:Setting delta update status...
176
I:Delta update status is set to (IP_PREVIOUS_UPDATE_FAILED 500)
177
handle_redbend_update: DELTA_UPDATE_IN_PROGRESS
178
I:Setting delta update status...
179
I:Delta update status is set to (IP_PREVIOUS_UPDATE_IN_PROGRESS 0)
180
I:Start delta update...
181
I:Setting recovery boot...
182
I:Error opening recovery count file. Ignore.
183
mtd: successfully wrote block at bebe0f4800000000
184
I:Set boot command "boot-recovery"
185
I:boot.command=boot-recovery
186
I:boot.recovery=recovery
187
188
I:Update location: /cache/update.zip
189
E:Can't open /cache/update.zip
190
(No such file or directory)
191
mtd: successfully wrote block at bebe0f3800000000
192
I:Set boot command ""
193
I:Setting delta update status...
194
I:Delta update status is set to (IP_PREVIOUS_UPDATE_FAILED 410)
195
mtd: successfully wrote block at bebe23a000000000
196
I:Reset FOTA cookie done.
197
RB_Progress: fwrite "/dev/ttyGS1" fail
198
precent:0 total:1 cur:1
199
Rebooting after recovery
200
I:Rebooting at the end of recovery module.
201
mtd: successfully wrote block at bebe0f8000000000
202
I:Set boot command ""
203
</pre>
Add picture from clipboard (Maximum size: 48.8 MB)