aboutsummaryrefslogtreecommitdiff
path: root/board/network.sh
blob: 65a56400a4127045e8f7a793b49f3bdb009ed13d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
###########################
#                         #
#  Network configuration  #
#                         #
###########################

# Add default wpa_supplicant.conf if it exists
if [ -f "$BR2_EXTERNAL_PIAUDIO_PATH/wpa_supplicant.conf" ]; then
    create_missing_dir "/etc/wpa_supplicant/"
    cat "$BR2_EXTERNAL_PIAUDIO_PATH/wpa_supplicant.conf" > "${TARGET_DIR}/etc/wpa_supplicant/wpa_supplicant-wlan0.conf"


    cat << __EOF__ > "${TARGET_DIR}/etc/systemd/network/wireless.network"
[Match]
Name=wlan0

[Network]
DHCP=yes
__EOF__

    # Create the link to interface wlan0 directly in the system configuration
    ln -sf /usr/lib/systemd/system/wpa_supplicant@.service "${TARGET_DIR}/usr/lib/systemd/system/multi-user.target.wants/wpa_supplicant@wlan0.service"
    
fi