File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments