11 size
= stat(image
).st_size
12 # arbitrary size limit, to prevent the address calculations from overflows etc.
13 assert size
< 0x2000000
15 # We need to align the address. A page boundary seems to be sufficient on 7362sl
17 addr
= ((0x8000000 - size
) & ~
0xfff)
18 haddr
= 0x80000000 + addr
19 img
= open(image
, "rb")
21 ftp
= FTP(ip
, 'adam2', 'adam2')
25 resp
= ftp
.sendcmd(cmd
)
27 assert resp
[0:3] == "200"
30 # The following parameters allow booting the avm recovery system with this
32 adam('SETENV memsize 0x%08x'%(addr))
33 adam('SETENV kernel_args_tmp mtdram1=0x%08x,0x88000000'%(haddr))
35 ftp
.storbinary('STOR 0x%08x 0x88000000'%(haddr), img
)