@@ -52,6 +52,7 @@ def download(url, file_name=None):
52
52
53
53
uboot_release_url = "https://api.github.com/repos/frank-w/u-boot/releases/latest"
54
54
kernel_releases_url = "https://api.github.com/repos/frank-w/BPI-Router-Linux/releases"
55
+ bin_releases_url = "https://api.github.com/repos/frank-w/arm-crosscompile/releases"
55
56
56
57
uboot_data = download (uboot_release_url )
57
58
uj = json .loads (uboot_data )
@@ -103,6 +104,24 @@ def download(url, file_name=None):
103
104
#print("release-data:",json.dumps(rel,indent=2))
104
105
#print("files:",json.dumps(kfiles,indent=2))
105
106
107
+ bin_releases = download (bin_releases_url )
108
+ brj = json .loads (bin_releases )
109
+
110
+ if brj :
111
+ bfiles = {}
112
+ for rel in brj :
113
+ bname = rel .get ("name" )
114
+
115
+ for f in rel .get ("assets" ):
116
+ fname = f .get ("name" )
117
+
118
+ if not fname in bfiles :
119
+ if re .search (r"^(hostapd|iproute2).*\.tar.gz$" ,fname ):
120
+ #fn=re.sub(boardpattern,r'\1',kfname)
121
+ bfiles [fname ]= f .get ("browser_download_url" )
122
+
123
+ print ("binfiles:" ,bfiles )
124
+
106
125
ufile = None
107
126
kfile = None
108
127
@@ -149,6 +168,23 @@ def download(url, file_name=None):
149
168
newconfig ["kernelfile" ]= fname
150
169
else : print ("no kernel defined!" )
151
170
171
+
172
+ if config and config .get ("replacehostapd" ):
173
+ newconfig ["replacehostapd" ]= config .get ("replacehostapd" )
174
+
175
+ if bfiles :
176
+ hostapdfile = bfiles .get ("hostapd_arm64.tar.gz" )
177
+ a = urlparse (hostapdfile )
178
+ fname = os .path .basename (a .path )
179
+ print (f"hostapdfile: { hostapdfile } filename: { fname } " )
180
+ if not os .path .isfile (fname ):
181
+ download (hostapdfile ,fname )
182
+ else : print (fname ,"already exists" )
183
+ newconfig ["hostapdfile" ]= fname
184
+ else : print ("no bfiles defined!" )
185
+
186
+
187
+
152
188
with open (conffile , 'w' ) as f :
153
189
for d in newconfig :
154
190
s = d + '=' + newconfig [d ]
0 commit comments