summaryrefslogtreecommitdiffstats
path: root/meta-networking
diff options
context:
space:
mode:
authorAdrian Freihofer <adrian.freihofer@gmail.com>2022-06-07 00:01:34 +0200
committerKhem Raj <raj.khem@gmail.com>2022-06-06 16:34:28 -0700
commit009bc195629ac4e885d7ae5148a175c8c8147e8f (patch)
treef21cc55e9e6a110d2a1c322783e0ae85796fb873 /meta-networking
parentfb14a4ca4937c39a5a26b0c9ae02e3867e2fd55d (diff)
downloadmeta-openembedded-009bc195629ac4e885d7ae5148a175c8c8147e8f.tar.gz
networkmanager: simplify selective installation
The main motivation for this rework is to support compiling the NetworkManager with many plugins, but to install only a few of them in a firmware image. This is advantageous when different products with different network interfaces should be supported by only one binary distribution. This is more in line with the way NetworkManager is designed and used by other binary Linux distributions. Basically this is already supported since the last rework of the networkmanager recipe. However, the rrecomments from networkmanager to all available plugins is not straight forward to be used in such a scenario. Installing only a subset of the compiled plugins required to override the rrecommends from networkmanager to the plugins in some way. To simplify the usage the networkmanager package is now an empty meta package and networkmanager itself gets moved to a new networkmanager-daemon package. This allows to keep backward compatibility: Installing the networkmanager package still adds all compiled plugins to the firmware. But with the new package splitting it's also possible to install for example only the networkmanager-wifi but not the networkmanager-wwan package even if networkamanger has been compiled with the modemmanager PACAKGECONFIG flag enabled as well. The relation from plugins to services is now a stronger rdepends which reflects better how NetworkManager is supposed to be used. If a plugin is installed but the required service is not the plugin periodically tries to connect to the service and reports error messages to the syslog if the service is not available. Therefore it's better to make the installation of the plugin optional but not the installation of the services. The bash-completion package adds support for the nmcli command line utility. This change also moves the bash completion configuration to a new package networkmanager-nmcli-bash-completion. This is more consistent anyway but gets even more important when the networkmanager package gets optional. To simplify the usage of all these packages a SUMMARY:${PN}-.. for each packages has been added. The separation of the doc packages has been removed. Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-networking')
-rw-r--r--meta-networking/recipes-connectivity/networkmanager/networkmanager_1.36.2.bb115
1 files changed, 73 insertions, 42 deletions
diff --git a/meta-networking/recipes-connectivity/networkmanager/networkmanager_1.36.2.bb b/meta-networking/recipes-connectivity/networkmanager/networkmanager_1.36.2.bb
index ab8fc136a..9fc43dceb 100644
--- a/meta-networking/recipes-connectivity/networkmanager/networkmanager_1.36.2.bb
+++ b/meta-networking/recipes-connectivity/networkmanager/networkmanager_1.36.2.bb
@@ -19,6 +19,7 @@ DEPENDS = " \
19 curl \ 19 curl \
20 dbus \ 20 dbus \
21" 21"
22DEPENDS:append:class-target = " bash-completion"
22 23
23GNOMEBASEBUILDCLASS = "meson" 24GNOMEBASEBUILDCLASS = "meson"
24inherit gnomebase gettext update-rc.d systemd gobject-introspection gtk-doc update-alternatives upstream-version-is-even 25inherit gnomebase gettext update-rc.d systemd gobject-introspection gtk-doc update-alternatives upstream-version-is-even
@@ -71,7 +72,6 @@ PACKAGECONFIG ??= "readline nss ifupdown dnsmasq nmcli vala \
71 ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux audit', '', d)} \ 72 ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux audit', '', d)} \
72" 73"
73 74
74inherit ${@bb.utils.contains('PACKAGECONFIG', 'nmcli', 'bash-completion', '', d)}
75inherit ${@bb.utils.contains('PACKAGECONFIG', 'vala', 'vala', '', d)} 75inherit ${@bb.utils.contains('PACKAGECONFIG', 'vala', 'vala', '', d)}
76 76
77PACKAGECONFIG[systemd] = "\ 77PACKAGECONFIG[systemd] = "\
@@ -105,25 +105,42 @@ PACKAGECONFIG[concheck] = "-Dconcheck=true,-Dconcheck=false"
105 105
106 106
107PACKAGES =+ " \ 107PACKAGES =+ " \
108 libnm \
108 ${PN}-adsl \ 109 ${PN}-adsl \
109 ${PN}-bluetooth \ 110 ${PN}-bluetooth \
110 ${PN}-cloud-setup \ 111 ${PN}-cloud-setup \
111 ${PN}-nmcli ${PN}-nmcli-doc \ 112 ${PN}-nmcli \
112 ${PN}-nmtui ${PN}-nmtui-doc \ 113 ${PN}-nmcli-bash-completion \
114 ${PN}-nmtui \
113 ${PN}-wifi \ 115 ${PN}-wifi \
114 ${PN}-wwan \ 116 ${PN}-wwan \
115 ${PN}-ovs ${PN}-ovs-doc \ 117 ${PN}-ovs \
116 ${PN}-ppp \ 118 ${PN}-ppp \
119 ${PN}-daemon \
117" 120"
118 121
119SYSTEMD_PACKAGES = "${PN} ${PN}-cloud-setup" 122SYSTEMD_PACKAGES = "${PN}-daemon ${PN}-cloud-setup"
123INITSCRIPT_PACKAGES = "${PN}-daemon"
120 124
121NETWORKMANAGER_PLUGINDIR = "${libdir}/NetworkManager/${PV}" 125NETWORKMANAGER_PLUGINDIR = "${libdir}/NetworkManager/${PV}"
126NETWORKMANAGER_DISPATCHERDIR = "${nonarch_libdir}/NetworkManager/dispatcher.d"
122 127
128
129SUMMARY:libnm = "Libraries for adding NetworkManager support to applications"
130FILES:libnm = "\
131 ${libdir}/libnm.so.* \
132 ${libdir}/girepository-1.0/NM-1.0.typelib \
133"
134
135SUMMARY:${PN}-adsl = "ADSL device plugin for NetworkManager"
123FILES:${PN}-adsl = "${NETWORKMANAGER_PLUGINDIR}/libnm-device-plugin-adsl.so" 136FILES:${PN}-adsl = "${NETWORKMANAGER_PLUGINDIR}/libnm-device-plugin-adsl.so"
137RDEPENDS:${PN}-adsl += "${PN}-daemon"
124 138
139SUMMARY:${PN}-bluetooth = "Bluetooth device plugin for NetworkManager"
125FILES:${PN}-bluetooth = "${NETWORKMANAGER_PLUGINDIR}/libnm-device-plugin-bluetooth.so" 140FILES:${PN}-bluetooth = "${NETWORKMANAGER_PLUGINDIR}/libnm-device-plugin-bluetooth.so"
141RDEPENDS:${PN}-bluetooth += "${PN}-daemon ${@bb.utils.contains('PACKAGECONFIG', 'bluez5', '${PN}-wwan bluez5', '', d)}"
126 142
143SUMMARY:${PN}-cloud-setup = "Automatically configure NetworkManager in cloud"
127FILES:${PN}-cloud-setup = " \ 144FILES:${PN}-cloud-setup = " \
128 ${libexecdir}/nm-cloud-setup \ 145 ${libexecdir}/nm-cloud-setup \
129 ${systemd_system_unitdir}/nm-cloud-setup.service \ 146 ${systemd_system_unitdir}/nm-cloud-setup.service \
@@ -131,28 +148,30 @@ FILES:${PN}-cloud-setup = " \
131 ${libdir}/NetworkManager/dispatcher.d/90-nm-cloud-setup.sh \ 148 ${libdir}/NetworkManager/dispatcher.d/90-nm-cloud-setup.sh \
132 ${libdir}/NetworkManager/dispatcher.d/no-wait.d/90-nm-cloud-setup.sh \ 149 ${libdir}/NetworkManager/dispatcher.d/no-wait.d/90-nm-cloud-setup.sh \
133" 150"
151RDEPENDS:${PN}-cloud-setup += "${PN}-daemon"
134ALLOW_EMPTY:${PN}-cloud-setup = "1" 152ALLOW_EMPTY:${PN}-cloud-setup = "1"
135SYSTEMD_SERVICE:${PN}-cloud-setup = "${@bb.utils.contains('PACKAGECONFIG', 'cloud-setup', 'nm-cloud-setup.service nm-cloud-setup.timer', '', d)}" 153SYSTEMD_SERVICE:${PN}-cloud-setup = "${@bb.utils.contains('PACKAGECONFIG', 'cloud-setup', 'nm-cloud-setup.service nm-cloud-setup.timer', '', d)}"
136 154
155SUMMARY:${PN}-nmcli = "NetworkManager command line client"
137FILES:${PN}-nmcli = " \ 156FILES:${PN}-nmcli = " \
138 ${bindir}/nmcli \ 157 ${bindir}/nmcli \
139" 158"
159RDEPENDS:${PN}-nmcli += "${PN}-daemon"
140 160
141FILES:${PN}-nmcli-doc = " \ 161SUMMARY:${PN}-nmcli-bash-completion = "NetworkManager command line client bash completion"
142 ${mandir}/man1/nmcli* \ 162FILES:${PN}-nmcli-bash-completion = "${datadir}/bash-completion/completions/nmcli"
143" 163RDEPENDS:${PN}-nmcli-bash-completion = "bash-completion"
144 164
165SUMMARY:${PN}-nmtui = "NetworkManager curses-based UI"
145FILES:${PN}-nmtui = " \ 166FILES:${PN}-nmtui = " \
146 ${bindir}/nmtui \ 167 ${bindir}/nmtui \
147 ${bindir}/nmtui-edit \ 168 ${bindir}/nmtui-edit \
148 ${bindir}/nmtui-connect \ 169 ${bindir}/nmtui-connect \
149 ${bindir}/nmtui-hostname \ 170 ${bindir}/nmtui-hostname \
150" 171"
172RDEPENDS:${PN}-nmtui += "${PN}-daemon"
151 173
152FILES:${PN}-nmtui-doc = " \ 174SUMMARY:${PN}-wifi = "Wifi plugin for NetworkManager"
153 ${mandir}/man1/nmtui* \
154"
155
156FILES:${PN}-wifi = "\ 175FILES:${PN}-wifi = "\
157 ${NETWORKMANAGER_PLUGINDIR}/libnm-device-plugin-wifi.so \ 176 ${NETWORKMANAGER_PLUGINDIR}/libnm-device-plugin-wifi.so \
158 ${libdir}/NetworkManager/conf.d/enable-iwd.conf \ 177 ${libdir}/NetworkManager/conf.d/enable-iwd.conf \
@@ -166,55 +185,80 @@ def get_wifi_deps(d):
166 return 'wpa-supplicant' 185 return 'wpa-supplicant'
167 else: 186 else:
168 return '' 187 return ''
169RRECOMMENDS:${PN}-wifi += "${@get_wifi_deps(d)}" 188RDEPENDS:${PN}-wifi += "${PN}-daemon ${@get_wifi_deps(d)}"
170 189
190SUMMARY:${PN}-wwan = "Mobile broadband device plugin for NetworkManager"
171FILES:${PN}-wwan = "\ 191FILES:${PN}-wwan = "\
172 ${NETWORKMANAGER_PLUGINDIR}/libnm-device-plugin-wwan.so \ 192 ${NETWORKMANAGER_PLUGINDIR}/libnm-device-plugin-wwan.so \
173 ${NETWORKMANAGER_PLUGINDIR}/libnm-wwan.so \ 193 ${NETWORKMANAGER_PLUGINDIR}/libnm-wwan.so \
174" 194"
175RRECOMMENDS:${PN}-wwan += "${@bb.utils.contains('PACKAGECONFIG','modemmanager','modemmanager','',d)}" 195RDEPENDS:${PN}-wwan += "${PN}-daemon ${@bb.utils.contains('PACKAGECONFIG','modemmanager','modemmanager','',d)}"
176 196
197SUMMARY:${PN}-ovs = "Open vSwitch device plugin for NetworkManager"
177FILES:${PN}-ovs = "\ 198FILES:${PN}-ovs = "\
178 ${NETWORKMANAGER_PLUGINDIR}/libnm-device-plugin-ovs.so \ 199 ${NETWORKMANAGER_PLUGINDIR}/libnm-device-plugin-ovs.so \
179 ${systemd_system_unitdir}/NetworkManager.service.d/NetworkManager-ovs.conf \ 200 ${systemd_system_unitdir}/NetworkManager.service.d/NetworkManager-ovs.conf \
180" 201"
202RDEPENDS:${PN}-ovs += "${PN}-daemon"
181 203
182FILES:${PN}-ovs-doc = "\ 204SUMMARY:${PN}-ppp = "PPP plugin for NetworkManager"
183 ${mandir}/man7/nm-openvswitch.7* \
184"
185
186FILES:${PN}-ppp = "\ 205FILES:${PN}-ppp = "\
187 ${NETWORKMANAGER_PLUGINDIR}/libnm-ppp-plugin.so \ 206 ${NETWORKMANAGER_PLUGINDIR}/libnm-ppp-plugin.so \
188 ${libdir}/pppd/*/nm-pppd-plugin.so \ 207 ${libdir}/pppd/*/nm-pppd-plugin.so \
189" 208"
190RRECOMMENDS:${PN}-ppp += "${@bb.utils.contains('PACKAGECONFIG','ppp','ppp','',d)}" 209RDEPENDS:${PN}-ppp += "${PN}-daemon ${@bb.utils.contains('PACKAGECONFIG','ppp','ppp','',d)}"
191 210
192FILES:${PN}-dev += " \ 211FILES:${PN}-dev += " \
193 ${libdir}/pppd/*/*.la \ 212 ${libdir}/pppd/*/*.la \
194 ${libdir}/NetworkManager/*.la \ 213 ${libdir}/NetworkManager/*.la \
195 ${NETWORKMANAGER_PLUGINDIR}/*.la \ 214 ${NETWORKMANAGER_PLUGINDIR}/*.la \
215 ${datadir}/dbus-1/interfaces/*.xml \
196" 216"
197 217
198FILES:${PN} += " \ 218SUMMARY:${PN}-daemon += "The NetworkManager daemon"
199 ${libexecdir} \ 219FILES:${PN}-daemon += " \
220 ${bindir}/nm-online \
221 ${datadir}/dbus-1 \
222 ${datadir}/polkit-1 \
200 ${libdir}/NetworkManager \ 223 ${libdir}/NetworkManager \
201 ${nonarch_libdir}/firewalld/zones \ 224 ${libexecdir} \
225 ${localstatedir}/lib/NetworkManager \
226 ${NETWORKMANAGER_DISPATCHERDIR} \
227 ${nonarch_base_libdir}/udev/* \
228 ${nonarch_libdir}/firewalld \
202 ${nonarch_libdir}/NetworkManager/conf.d \ 229 ${nonarch_libdir}/NetworkManager/conf.d \
203 ${nonarch_libdir}/NetworkManager/dispatcher.d \
204 ${nonarch_libdir}/NetworkManager/dispatcher.d/pre-down.d \ 230 ${nonarch_libdir}/NetworkManager/dispatcher.d/pre-down.d \
205 ${nonarch_libdir}/NetworkManager/dispatcher.d/pre-up.d \ 231 ${nonarch_libdir}/NetworkManager/dispatcher.d/pre-up.d \
206 ${nonarch_libdir}/NetworkManager/dispatcher.d/no-wait.d \ 232 ${nonarch_libdir}/NetworkManager/dispatcher.d/no-wait.d \
207 ${nonarch_libdir}/NetworkManager/VPN \
208 ${nonarch_libdir}/NetworkManager/system-connections \ 233 ${nonarch_libdir}/NetworkManager/system-connections \
209 ${datadir}/polkit-1 \ 234 ${nonarch_libdir}/NetworkManager/VPN \
210 ${datadir}/dbus-1 \ 235 ${sbindir}/NetworkManager \
211 ${nonarch_base_libdir}/udev/* \ 236 ${sysconfdir}/init.d/network-manager \
237 ${sysconfdir}/NetworkManager \
212 ${systemd_system_unitdir} \ 238 ${systemd_system_unitdir} \
213" 239"
214 240RRECOMMENDS:${PN}-daemon += "\
215RRECOMMENDS:${PN} += "\
216 iptables \ 241 iptables \
217 ${@bb.utils.filter('PACKAGECONFIG', 'dnsmasq', d)} \ 242 ${@bb.utils.filter('PACKAGECONFIG', 'dnsmasq', d)} \
243"
244INITSCRIPT_NAME:${PN}-daemon = "network-manager"
245SYSTEMD_SERVICE:${PN}-daemon = "\
246 NetworkManager.service \
247 NetworkManager-dispatcher.service \
248"
249RCONFLICTS:${PN}-daemon += "connman"
250ALTERNATIVE_PRIORITY = "100"
251ALTERNATIVE:${PN}-daemon = "${@bb.utils.contains('DISTRO_FEATURES','systemd','resolv-conf','',d)}"
252ALTERNATIVE_TARGET[resolv-conf] = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${sysconfdir}/resolv-conf.NetworkManager','',d)}"
253ALTERNATIVE_LINK_NAME[resolv-conf] = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${sysconfdir}/resolv.conf','',d)}"
254
255
256# The networkmanager package is an empty meta package which weakly depends on all the compiled features.
257# Install this package to get all plugins and related dependencies installed. Alternatively just install
258# plugins and related dependencies e.g. by installing networkmanager-wifi or networkmanager-wwan
259# packages to the firmware.
260ALLOW_EMPTY:${PN} = "1"
261RRECOMMENDS:${PN} += "\
218 ${@bb.utils.contains('PACKAGECONFIG','adsl','${PN}-adsl','',d)} \ 262 ${@bb.utils.contains('PACKAGECONFIG','adsl','${PN}-adsl','',d)} \
219 ${@bb.utils.contains('PACKAGECONFIG','bluez5','${PN}-bluetooth','',d)} \ 263 ${@bb.utils.contains('PACKAGECONFIG','bluez5','${PN}-bluetooth','',d)} \
220 ${@bb.utils.contains('PACKAGECONFIG','cloud-setup','${PN}-cloud-setup','',d)} \ 264 ${@bb.utils.contains('PACKAGECONFIG','cloud-setup','${PN}-cloud-setup','',d)} \
@@ -225,19 +269,6 @@ RRECOMMENDS:${PN} += "\
225 ${@bb.utils.contains('PACKAGECONFIG','ovs','${PN}-ovs','',d)} \ 269 ${@bb.utils.contains('PACKAGECONFIG','ovs','${PN}-ovs','',d)} \
226 ${@bb.utils.contains('PACKAGECONFIG','ppp','${PN}-ppp','',d)} \ 270 ${@bb.utils.contains('PACKAGECONFIG','ppp','${PN}-ppp','',d)} \
227" 271"
228RCONFLICTS:${PN} = "connman"
229
230
231INITSCRIPT_NAME = "network-manager"
232SYSTEMD_SERVICE:${PN} = "\
233 NetworkManager.service \
234 NetworkManager-dispatcher.service \
235"
236
237ALTERNATIVE_PRIORITY = "100"
238ALTERNATIVE:${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','resolv-conf','',d)}"
239ALTERNATIVE_TARGET[resolv-conf] = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${sysconfdir}/resolv-conf.NetworkManager','',d)}"
240ALTERNATIVE_LINK_NAME[resolv-conf] = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${sysconfdir}/resolv.conf','',d)}"
241 272
242do_install:append() { 273do_install:append() {
243 install -Dm 0755 ${WORKDIR}/${BPN}.initd ${D}${sysconfdir}/init.d/network-manager 274 install -Dm 0755 ${WORKDIR}/${BPN}.initd ${D}${sysconfdir}/init.d/network-manager