Skip to content

Commit d4b072d

Browse files
committed
buildimg/downloadfiles: update kernel and add own build hostapd
1 parent 7c6dd8c commit d4b072d

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

buildimg.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ case "$board" in
4444
esac
4545

4646
if [[ "$board" == "bpi-r4" ]]; then
47-
kernel="6.10" #r4 does not have LTS support yet
47+
kernel="6.11" #r4 does not have LTS support yet
48+
echo "replacehostapd=1" >> sourcefiles_${board}.conf
4849
fi
4950

5051
if [[ -n "$3" ]] && [[ "$3" =~ ^[1-9]\.[0-9]+$ ]];then kernel=$3;fi
@@ -192,6 +193,12 @@ if [[ ${board} != "bpi-r2pro" ]];then
192193
#add wifi.sh to rc.local (autostart)
193194
sed -i '/^exit/s/^/\/usr\/sbin\/wifi.sh &\n/' $targetdir/etc/rc.local
194195
else
196+
if [[ -n "$replacehostapd" ]];then
197+
tar -tzf $hostapdfile #currently only show content
198+
echo "unpack hostapd to bpi-root loopdev..."
199+
sudo tar -xzf $hostapdfile -C mnt/BPI-ROOT/usr/local/sbin/
200+
ls -lh mnt/BPI-ROOT/usr/local/sbin/
201+
fi
195202
sudo chroot $targetdir bash -c "ln -fs hostapd_wlan0.conf /etc/hostapd/hostapd.conf"
196203
fi
197204
#copy firmware

downloadfiles.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def download(url, file_name=None):
5252

5353
uboot_release_url="https://api.github.com/repos/frank-w/u-boot/releases/latest"
5454
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"
5556

5657
uboot_data=download(uboot_release_url)
5758
uj=json.loads(uboot_data)
@@ -103,6 +104,24 @@ def download(url, file_name=None):
103104
#print("release-data:",json.dumps(rel,indent=2))
104105
#print("files:",json.dumps(kfiles,indent=2))
105106

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+
106125
ufile=None
107126
kfile=None
108127

@@ -149,6 +168,23 @@ def download(url, file_name=None):
149168
newconfig["kernelfile"]=fname
150169
else: print("no kernel defined!")
151170

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+
152188
with open(conffile, 'w') as f:
153189
for d in newconfig:
154190
s=d+'='+newconfig[d]

0 commit comments

Comments
 (0)