networkmanager: implement wireless configuration

https://jira.digi.com/browse/DEL-4289

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
This commit is contained in:
Javier Viguera 2017-05-18 17:41:14 +02:00
parent 09b7d4f2b1
commit e700b4d0c3
3 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,10 @@
[connection]
id=wlan0
type=wifi
interface-name=wlan0
[wifi]
ssid=""
[ipv4]
method=auto

View File

@ -0,0 +1,12 @@
[connection]
id=wlan0
type=wifi
interface-name=wlan0
[wifi]
ssid=""
[ipv4]
address1=##WLAN0_STATIC_CIDR##,##WLAN0_STATIC_GATEWAY##
dns=##WLAN0_STATIC_DNS##;
method=manual

View File

@ -9,6 +9,8 @@ SRC_URI += " \
file://nm.eth0.static \ file://nm.eth0.static \
file://nm.eth1.dhcp \ file://nm.eth1.dhcp \
file://nm.eth1.static \ file://nm.eth1.static \
file://nm.wlan0.dhcp \
file://nm.wlan0.static \
" "
PACKAGECONFIG_remove = "dnsmasq netconfig" PACKAGECONFIG_remove = "dnsmasq netconfig"
@ -27,6 +29,7 @@ def ipaddr_to_cidr(iface, d):
ETH0_STATIC_CIDR = "${@ipaddr_to_cidr('eth0', d)}" ETH0_STATIC_CIDR = "${@ipaddr_to_cidr('eth0', d)}"
ETH1_STATIC_CIDR = "${@ipaddr_to_cidr('eth1', d)}" ETH1_STATIC_CIDR = "${@ipaddr_to_cidr('eth1', d)}"
WLAN0_STATIC_CIDR = "${@ipaddr_to_cidr('wlan0', d)}"
inherit update-rc.d inherit update-rc.d
@ -53,6 +56,13 @@ do_install_append() {
-e "s,##ETH1_STATIC_GATEWAY##,${ETH1_STATIC_GATEWAY},g" \ -e "s,##ETH1_STATIC_GATEWAY##,${ETH1_STATIC_GATEWAY},g" \
-e "s,##ETH1_STATIC_DNS##,${ETH1_STATIC_DNS},g" \ -e "s,##ETH1_STATIC_DNS##,${ETH1_STATIC_DNS},g" \
${D}${sysconfdir}/NetworkManager/system-connections/nm.eth1 ${D}${sysconfdir}/NetworkManager/system-connections/nm.eth1
# Wireless (only IP settings; connection settings need to be provided at runtime)
install -m 0600 ${WORKDIR}/nm.wlan0.${WLAN0_MODE} ${D}${sysconfdir}/NetworkManager/system-connections/nm.wlan0
sed -i -e "s,##WLAN0_STATIC_CIDR##,${WLAN0_STATIC_CIDR},g" \
-e "s,##WLAN0_STATIC_GATEWAY##,${WLAN0_STATIC_GATEWAY},g" \
-e "s,##WLAN0_STATIC_DNS##,${WLAN0_STATIC_DNS},g" \
${D}${sysconfdir}/NetworkManager/system-connections/nm.wlan0
} }
# NetworkManager needs to be started after DBUS # NetworkManager needs to be started after DBUS