Skip to content

Commit 7c7a15a

Browse files
committed
buildimg.sh: allow replacing other binaries like iperf and iproute2
1 parent bb4c0f1 commit 7c7a15a

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

buildimg.sh

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,21 @@ if [[ ${board} != "bpi-r2pro" ]];then
184184
#add wifi.sh to rc.local (autostart)
185185
sed -i '/^exit/s/^/\/usr\/sbin\/wifi.sh &\n/' $targetdir/etc/rc.local
186186
else
187-
if [[ -n "$replacehostapd" ]];then
188-
tar -tzf $hostapdfile #currently only show content
189-
echo "unpack hostapd to bpi-root loopdev..."
190-
sudo tar -xzf $hostapdfile -C mnt/BPI-ROOT/usr/local/sbin/
191-
ls -lh mnt/BPI-ROOT/usr/local/sbin/
192-
fi
187+
for a in hostapd iperf wpa_supplicant iproute2;
188+
do
189+
varname="replace${a}"
190+
if [[ -n "${!varname}" ]];then
191+
varname2="${a}file"
192+
#tar -tzf ${!varname2} #currently only show content
193+
echo "unpack $a to bpi-root loopdev..."
194+
if [[ "$a" =~ hostap|wpa_supplicant ]];then
195+
sudo tar -xzf ${!varname2} -C mnt/BPI-ROOT/usr/local/sbin/
196+
else
197+
sudo tar -xzf ${!varname2} -C mnt/BPI-ROOT/usr/local/
198+
fi
199+
fi
200+
done
201+
ls -lh mnt/BPI-ROOT/usr/local/{,s}bin/
193202
sudo chroot $targetdir bash -c "ln -fs hostapd_wlan0.conf /etc/hostapd/hostapd.conf"
194203
fi
195204
#copy firmware

0 commit comments

Comments
 (0)