summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Freihofer <adrian.freihofer@gmail.com>2022-03-02 21:05:48 +0100
committerKhem Raj <raj.khem@gmail.com>2022-03-03 08:50:19 -0800
commit9632eca6d27f29dc229d7a4c6663f97fc036661e (patch)
tree0e10851d299ddaab959f120d6d0039208bfe7eee
parentb5a5ffb033f5b1e2987923f74d183b153e9b4429 (diff)
downloadmeta-openembedded-9632eca6d27f29dc229d7a4c6663f97fc036661e.tar.gz
networkmanager: new configure options
- Allow to compile nmcli with libedit (alternative to gplv3 readline) - Support iwd as well as wpa-supplicant for wifi - Make vala build-time dependency optional - Split all plugins into packages. By default all packages are installed acc. to features in the PACKAGECONFIG but it's now possible to build images where only some plugins are installed. - Move FILES:networkmanager to last position to increase the FILES priority of other packages. Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-networking/recipes-connectivity/networkmanager/networkmanager/enable-dhcpcd.conf2
-rw-r--r--meta-networking/recipes-connectivity/networkmanager/networkmanager/enable-iwd.conf3
-rw-r--r--meta-networking/recipes-connectivity/networkmanager/networkmanager_1.36.0.bb127
3 files changed, 100 insertions, 32 deletions
diff --git a/meta-networking/recipes-connectivity/networkmanager/networkmanager/enable-dhcpcd.conf b/meta-networking/recipes-connectivity/networkmanager/networkmanager/enable-dhcpcd.conf
new file mode 100644
index 000000000..8da4fe048
--- /dev/null
+++ b/meta-networking/recipes-connectivity/networkmanager/networkmanager/enable-dhcpcd.conf
@@ -0,0 +1,2 @@
1[main]
2dhcp=dhcpcd
diff --git a/meta-networking/recipes-connectivity/networkmanager/networkmanager/enable-iwd.conf b/meta-networking/recipes-connectivity/networkmanager/networkmanager/enable-iwd.conf
new file mode 100644
index 000000000..abb593734
--- /dev/null
+++ b/meta-networking/recipes-connectivity/networkmanager/networkmanager/enable-iwd.conf
@@ -0,0 +1,3 @@
1[device]
2wifi.iwd.autoconnect=yes
3wifi.backend=iwd
diff --git a/meta-networking/recipes-connectivity/networkmanager/networkmanager_1.36.0.bb b/meta-networking/recipes-connectivity/networkmanager/networkmanager_1.36.0.bb
index 18541cbc0..2f8b616a6 100644
--- a/meta-networking/recipes-connectivity/networkmanager/networkmanager_1.36.0.bb
+++ b/meta-networking/recipes-connectivity/networkmanager/networkmanager_1.36.0.bb
@@ -26,6 +26,8 @@ inherit gnomebase gettext update-rc.d systemd gobject-introspection gtk-doc upda
26SRC_URI = " \ 26SRC_URI = " \
27 ${GNOME_MIRROR}/NetworkManager/${@gnome_verdir("${PV}")}/NetworkManager-${PV}.tar.xz \ 27 ${GNOME_MIRROR}/NetworkManager/${@gnome_verdir("${PV}")}/NetworkManager-${PV}.tar.xz \
28 file://${BPN}.initd \ 28 file://${BPN}.initd \
29 file://enable-dhcpcd.conf \
30 file://enable-iwd.conf \
29 file://0001-do-not-ask-host-for-ifcfg-defaults.patch \ 31 file://0001-do-not-ask-host-for-ifcfg-defaults.patch \
30" 32"
31SRC_URI[sha256sum] = "faa389c9e9ca78243cfab4a8bed6db132f82e5b5e66bb9d44af93379d1348398" 33SRC_URI[sha256sum] = "faa389c9e9ca78243cfab4a8bed6db132f82e5b5e66bb9d44af93379d1348398"
@@ -61,7 +63,7 @@ do_compile:prepend() {
61 export GI_TYPELIB_PATH="${B}}/src/libnm-client-impl${GI_TYPELIB_PATH:+:$GI_TYPELIB_PATH}" 63 export GI_TYPELIB_PATH="${B}}/src/libnm-client-impl${GI_TYPELIB_PATH:+:$GI_TYPELIB_PATH}"
62} 64}
63 65
64PACKAGECONFIG ??= "nss ifupdown dnsmasq nmcli \ 66PACKAGECONFIG ??= "readline nss ifupdown dnsmasq nmcli vala \
65 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d), d)} \ 67 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d), d)} \
66 ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez5', '', d)} \ 68 ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez5', '', d)} \
67 ${@bb.utils.filter('DISTRO_FEATURES', 'wifi polkit', d)} \ 69 ${@bb.utils.filter('DISTRO_FEATURES', 'wifi polkit', d)} \
@@ -69,6 +71,7 @@ PACKAGECONFIG ??= "nss ifupdown dnsmasq nmcli \
69" 71"
70 72
71inherit ${@bb.utils.contains('PACKAGECONFIG', 'nmcli', 'bash-completion', '', d)} 73inherit ${@bb.utils.contains('PACKAGECONFIG', 'nmcli', 'bash-completion', '', d)}
74inherit ${@bb.utils.contains('PACKAGECONFIG', 'vala', 'vala', '', d)}
72 75
73PACKAGECONFIG[systemd] = "\ 76PACKAGECONFIG[systemd] = "\
74 -Dsystemdsystemunitdir=${systemd_unitdir}/system -Dsession_tracking=systemd,\ 77 -Dsystemdsystemunitdir=${systemd_unitdir}/system -Dsession_tracking=systemd,\
@@ -85,22 +88,40 @@ PACKAGECONFIG[nss] = "-Dcrypto=nss,,nss"
85PACKAGECONFIG[resolvconf] = "-Dresolvconf=${base_sbindir}/resolvconf,-Dresolvconf=no,,resolvconf" 88PACKAGECONFIG[resolvconf] = "-Dresolvconf=${base_sbindir}/resolvconf,-Dresolvconf=no,,resolvconf"
86PACKAGECONFIG[gnutls] = "-Dcrypto=gnutls,,gnutls" 89PACKAGECONFIG[gnutls] = "-Dcrypto=gnutls,,gnutls"
87PACKAGECONFIG[wifi] = "-Dwext=true -Dwifi=true,-Dwext=false -Dwifi=false" 90PACKAGECONFIG[wifi] = "-Dwext=true -Dwifi=true,-Dwext=false -Dwifi=false"
91PACKAGECONFIG[iwd] = "-Diwd=true,-Diwd=false"
88PACKAGECONFIG[ifupdown] = "-Difupdown=true,-Difupdown=false" 92PACKAGECONFIG[ifupdown] = "-Difupdown=true,-Difupdown=false"
89PACKAGECONFIG[cloud-setup] = "-Dnm_cloud_setup=true,-Dnm_cloud_setup=false" 93PACKAGECONFIG[cloud-setup] = "-Dnm_cloud_setup=true,-Dnm_cloud_setup=false"
90PACKAGECONFIG[nmcli] = "-Dnmcli=true,-Dnmcli=false" 94PACKAGECONFIG[nmcli] = "-Dnmcli=true,-Dnmcli=false"
95PACKAGECONFIG[readline] = "-Dreadline=libreadline,,readline"
96PACKAGECONFIG[libedit] = "-Dreadline=libedit,,libedit"
91PACKAGECONFIG[ovs] = "-Dovs=true,-Dovs=false,jansson" 97PACKAGECONFIG[ovs] = "-Dovs=true,-Dovs=false,jansson"
92PACKAGECONFIG[audit] = "-Dlibaudit=yes,-Dlibaudit=no" 98PACKAGECONFIG[audit] = "-Dlibaudit=yes,-Dlibaudit=no"
93PACKAGECONFIG[selinux] = "-Dselinux=true,-Dselinux=false,libselinux" 99PACKAGECONFIG[selinux] = "-Dselinux=true,-Dselinux=false,libselinux"
100PACKAGECONFIG[vala] = "-Dvapi=true,-Dvapi=false"
101PACKAGECONFIG[dhcpcd] = "-Ddhcpcd=yes,-Ddhcpcd=no,,dhcpcd"
102PACKAGECONFIG[dhclient] = "-Ddhclient=yes,-Ddhclient=no,,dhcp"
103PACKAGECONFIG[concheck] = "-Dconcheck=true,-Dconcheck=false"
104
94 105
95PACKAGES =+ " \ 106PACKAGES =+ " \
107 ${PN}-adsl \
108 ${PN}-bluetooth \
109 ${PN}-cloud-setup \
96 ${PN}-nmcli ${PN}-nmcli-doc \ 110 ${PN}-nmcli ${PN}-nmcli-doc \
97 ${PN}-nmtui ${PN}-nmtui-doc \ 111 ${PN}-nmtui ${PN}-nmtui-doc \
98 ${PN}-adsl ${PN}-cloud-setup \ 112 ${PN}-wifi \
113 ${PN}-wwan \
114 ${PN}-ovs ${PN}-ovs-doc \
115 ${PN}-ppp \
99" 116"
100 117
101SYSTEMD_PACKAGES = "${PN} ${PN}-cloud-setup" 118SYSTEMD_PACKAGES = "${PN} ${PN}-cloud-setup"
102 119
103FILES:${PN}-adsl = "${libdir}/NetworkManager/${PV}/libnm-device-plugin-adsl.so" 120NETWORKMANAGER_PLUGINDIR = "${libdir}/NetworkManager/${PV}"
121
122FILES:${PN}-adsl = "${NETWORKMANAGER_PLUGINDIR}/libnm-device-plugin-adsl.so"
123
124FILES:${PN}-bluetooth = "${NETWORKMANAGER_PLUGINDIR}/libnm-device-plugin-bluetooth.so"
104 125
105FILES:${PN}-cloud-setup = " \ 126FILES:${PN}-cloud-setup = " \
106 ${libexecdir}/nm-cloud-setup \ 127 ${libexecdir}/nm-cloud-setup \
@@ -112,9 +133,54 @@ FILES:${PN}-cloud-setup = " \
112ALLOW_EMPTY:${PN}-cloud-setup = "1" 133ALLOW_EMPTY:${PN}-cloud-setup = "1"
113SYSTEMD_SERVICE:${PN}-cloud-setup = "${@bb.utils.contains('PACKAGECONFIG', 'cloud-setup', 'nm-cloud-setup.service nm-cloud-setup.timer', '', d)}" 134SYSTEMD_SERVICE:${PN}-cloud-setup = "${@bb.utils.contains('PACKAGECONFIG', 'cloud-setup', 'nm-cloud-setup.service nm-cloud-setup.timer', '', d)}"
114 135
136FILES:${PN}-nmcli = " \
137 ${bindir}/nmcli \
138"
139
140FILES:${PN}-nmcli-doc = " \
141 ${mandir}/man1/nmcli* \
142"
143
144FILES:${PN}-nmtui = " \
145 ${bindir}/nmtui \
146 ${bindir}/nmtui-edit \
147 ${bindir}/nmtui-connect \
148 ${bindir}/nmtui-hostname \
149"
150
151FILES:${PN}-nmtui-doc = " \
152 ${mandir}/man1/nmtui* \
153"
154
155FILES:${PN}-wifi = "${NETWORKMANAGER_PLUGINDIR}/libnm-device-plugin-wifi.so"
156
157FILES:${PN}-wwan = "\
158 ${NETWORKMANAGER_PLUGINDIR}/libnm-device-plugin-wwan.so \
159 ${NETWORKMANAGER_PLUGINDIR}/libnm-wwan.so \
160"
161
162FILES:${PN}-ovs = "\
163 ${NETWORKMANAGER_PLUGINDIR}/libnm-device-plugin-ovs.so \
164 ${systemd_system_unitdir}/NetworkManager.service.d/NetworkManager-ovs.conf \
165"
166
167FILES:${PN}-ovs-doc = "\
168 ${mandir}/man7/nm-openvswitch.7* \
169"
170
171FILES:${PN}-ppp = "\
172 ${NETWORKMANAGER_PLUGINDIR}/libnm-ppp-plugin.so \
173 ${libdir}/pppd/*/nm-pppd-plugin.so \
174"
175
176FILES:${PN}-dev += " \
177 ${libdir}/pppd/*/*.la \
178 ${libdir}/NetworkManager/*.la \
179 ${NETWORKMANAGER_PLUGINDIR}/*.la \
180"
181
115FILES:${PN} += " \ 182FILES:${PN} += " \
116 ${libexecdir} \ 183 ${libexecdir} \
117 ${libdir}/NetworkManager/${PV}/*.so \
118 ${libdir}/NetworkManager \ 184 ${libdir}/NetworkManager \
119 ${libdir}/firewalld/zones \ 185 ${libdir}/firewalld/zones \
120 ${nonarch_libdir}/NetworkManager/conf.d \ 186 ${nonarch_libdir}/NetworkManager/conf.d \
@@ -128,42 +194,29 @@ FILES:${PN} += " \
128 ${datadir}/dbus-1 \ 194 ${datadir}/dbus-1 \
129 ${nonarch_base_libdir}/udev/* \ 195 ${nonarch_base_libdir}/udev/* \
130 ${systemd_system_unitdir} \ 196 ${systemd_system_unitdir} \
131 ${libdir}/pppd \
132" 197"
133 198
134RRECOMMENDS:${PN} += "iptables \ 199RRECOMMENDS:${PN} += "\
200 iptables \
135 ${@bb.utils.filter('PACKAGECONFIG', 'dnsmasq', d)} \ 201 ${@bb.utils.filter('PACKAGECONFIG', 'dnsmasq', d)} \
202 ${@bb.utils.contains('PACKAGECONFIG','adsl','${PN}-adsl','',d)} \
203 ${@bb.utils.contains('PACKAGECONFIG','bluez5','${PN}-bluetooth','',d)} \
204 ${@bb.utils.contains('PACKAGECONFIG','cloud-setup','${PN}-cloud-setup','',d)} \
205 ${@bb.utils.contains('PACKAGECONFIG','nmcli','${PN}-nmcli','',d)} \
206 ${@bb.utils.contains('PACKAGECONFIG','nmtui','${PN}-nmtui','',d)} \
207 ${@bb.utils.contains('PACKAGECONFIG','wifi','${PN}-wifi','',d)} \
208 ${@bb.utils.contains('PACKAGECONFIG','wwan','${PN}-wwan','',d)} \
209 ${@bb.utils.contains('PACKAGECONFIG','ovs','${PN}-ovs','',d)} \
210 ${@bb.utils.contains('PACKAGECONFIG','ppp','${PN}-ppp','',d)} \
136" 211"
137RCONFLICTS:${PN} = "connman" 212RCONFLICTS:${PN} = "connman"
138 213
139FILES:${PN}-dev += " \
140 ${datadir}/NetworkManager/gdb-cmd \
141 ${libdir}/pppd/*/*.la \
142 ${libdir}/NetworkManager/*.la \
143 ${libdir}/NetworkManager/${PV}/*.la \
144"
145
146FILES:${PN}-nmcli = " \
147 ${bindir}/nmcli \
148"
149
150FILES:${PN}-nmcli-doc = " \
151 ${mandir}/man1/nmcli* \
152"
153
154FILES:${PN}-nmtui = " \
155 ${bindir}/nmtui \
156 ${bindir}/nmtui-edit \
157 ${bindir}/nmtui-connect \
158 ${bindir}/nmtui-hostname \
159"
160
161FILES:${PN}-nmtui-doc = " \
162 ${mandir}/man1/nmtui* \
163"
164 214
165INITSCRIPT_NAME = "network-manager" 215INITSCRIPT_NAME = "network-manager"
166SYSTEMD_SERVICE:${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'systemd', 'NetworkManager.service NetworkManager-dispatcher.service', '', d)}" 216SYSTEMD_SERVICE:${PN} = "\
217 NetworkManager.service \
218 NetworkManager-dispatcher.service \
219"
167 220
168ALTERNATIVE_PRIORITY = "100" 221ALTERNATIVE_PRIORITY = "100"
169ALTERNATIVE:${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','resolv-conf','',d)}" 222ALTERNATIVE:${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','resolv-conf','',d)}"
@@ -182,4 +235,14 @@ do_install:append() {
182 # systemd v210 and newer do not need this rule file 235 # systemd v210 and newer do not need this rule file
183 rm ${D}/${nonarch_base_libdir}/udev/rules.d/84-nm-drivers.rules 236 rm ${D}/${nonarch_base_libdir}/udev/rules.d/84-nm-drivers.rules
184 fi 237 fi
238
239 # Enable iwd if compiled
240 if ${@bb.utils.contains('PACKAGECONFIG','iwd','true','false',d)}; then
241 install -Dm 0644 ${WORKDIR}/enable-iwd.conf ${D}${libdir}/NetworkManager/conf.d/enable-iwd.conf
242 fi
243
244 # Enable dhcpd if compiled
245 if ${@bb.utils.contains('PACKAGECONFIG','dhcpcd','true','false',d)}; then
246 install -Dm 0644 ${WORKDIR}/enable-dhcpcd.conf ${D}${libdir}/NetworkManager/conf.d/enable-dhcpcd.conf
247 fi
185} 248}