#!/usr/bin/env python3 import argparse from ftplib import FTP from sys import argv from os import stat parser = argparse.ArgumentParser(description='Tool to boot AVM EVA ramdisk images.') parser.add_argument('ip', type=str, help='IP-address to transfer the image to') parser.add_argument('image', type=str, help='Location of the ramdisk image') parser.add_argument('--offset', type=lambda x: int(x,0), help='Offset to load the image to in hex format with leading 0x. Only needed for non-lantiq devices.') args = parser.parse_args() size = stat(args.image).st_size # arbitrary size limit, to prevent the address calculations from overflows etc. assert size < 0x2000000 if args.offset: addr = size haddr = args.offset else: # We need to align the address. # A page boundary seems to be sufficient on 7362sl and 7412 addr = ((0x8000000 - size) & ~0xfff) haddr = 0x80000000 + addr img = open(args.image, "rb") ftp = FTP(args.ip, 'adam2', 'adam2') def adam(cmd): print("> %s"%(cmd)) resp = ftp.sendcmd(cmd) print("< %s"%(resp)) assert resp[0:3] == "200" ftp.set_pasv(True) # The following parameters allow booting the avm recovery system with this # script. adam('SETENV memsize 0x%08x'%(addr)) adam('SETENV kernel_args_tmp mtdram1=0x%08x,0x88000000'%(haddr)) adam('MEDIA SDRAM') ftp.storbinary('STOR 0x%08x 0x88000000'%(haddr), img) img.close() ftp.close() tch'/> xenJames
aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxen/Makefile.dist
blob: 70883629b88f1bc805ce9e4d0a74b30f048701b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115