Skip to content

Commit

Permalink
use wpa_supplicant to configure wifi
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth Jiang committed Jul 22, 2016
1 parent 2fa71c6 commit 22ec5ac
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 22 deletions.
28 changes: 20 additions & 8 deletions src/chroot_script
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,26 @@ echo "# enable raspicam" >> /boot/config.txt
echo "start_x=1" >> /boot/config.txt
echo "gpu_mem=128" >> /boot/config.txt

# allow network configuration via /boot/octopi-network.txt
sed -i "s@iface wlan0 @iface wlan0-raspbian @g" /etc/network/interfaces
sed -i "s@iface wlan1 @iface wlan1-raspbian @g" /etc/network/interfaces
echo "mapping wlan0" >> /etc/network/interfaces
echo " script /root/bin/map_iface" >> /etc/network/interfaces
echo "mapping wlan1" >> /etc/network/interfaces
echo " script /root/bin/map_iface" >> /etc/network/interfaces
echo "source /boot/octopi-network.txt" >> /etc/network/interfaces
# allow ethernet network configuration via /boot/octopi-ethernet.txt
echo "source /boot/octopi-ethernet.txt" >> /etc/network/interfaces

# allow wifi network configuration via /boot/octopi-wifi.txt
mv /etc/wpa_supplicant/wpa_supplicant.conf /boot/octopi-wifi.txt
ln -s /boot/octopi-wifi.txt /etc/wpa_supplicant/wpa_supplicant.conf
cat <<EOT >> /etc/wpa_supplicant/wpa_supplicant.conf
# Uncomment the following section to add your wifi SSID and password
# `man -s 5 wpa_supplicant.conf` for more details
#network={
#ssid="Your Wifi SSID"
#psk="supersecretwifipassword"
#}
## You can configure more than 1 wifi networks by adding more 'network' blocks
#network={
#ssid="Another Wifi"
#psk="password"
#}
EOT

# copy /etc/wpa_supplicant/ifupdown.sh to /etc/ifplugd/action.d/ifupdown - for wlan auto reconnect
[ -f /etc/ifplugd/action.d/ifupdown ] && mv /etc/ifplugd/action.d/ifupdown /etc/ifplugd/action.d/ifupdown.original
Expand Down
13 changes: 0 additions & 13 deletions src/filesystem/home/root/bin/map_iface

This file was deleted.

2 changes: 1 addition & 1 deletion src/variants/armbian/post_chroot_script
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sed -i -e "s@manual@dhcp@g" /boot/octopi-network.txt
sed -i -e "s@manual@dhcp@g" /etc/network/interfaces

0 comments on commit 22ec5ac

Please sign in to comment.