diff options
author | Adrian Freihofer <adrian.freihofer@gmail.com> | 2022-06-07 00:01:34 +0200 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2022-06-06 16:34:28 -0700 |
commit | 009bc195629ac4e885d7ae5148a175c8c8147e8f (patch) | |
tree | f21cc55e9e6a110d2a1c322783e0ae85796fb873 /meta-networking | |
parent | fb14a4ca4937c39a5a26b0c9ae02e3867e2fd55d (diff) | |
download | meta-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.bb | 115 |
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 | " |
22 | DEPENDS:append:class-target = " bash-completion" | ||
22 | 23 | ||
23 | GNOMEBASEBUILDCLASS = "meson" | 24 | GNOMEBASEBUILDCLASS = "meson" |
24 | inherit gnomebase gettext update-rc.d systemd gobject-introspection gtk-doc update-alternatives upstream-version-is-even | 25 | inherit 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 | ||
74 | inherit ${@bb.utils.contains('PACKAGECONFIG', 'nmcli', 'bash-completion', '', d)} | ||
75 | inherit ${@bb.utils.contains('PACKAGECONFIG', 'vala', 'vala', '', d)} | 75 | inherit ${@bb.utils.contains('PACKAGECONFIG', 'vala', 'vala', '', d)} |
76 | 76 | ||
77 | PACKAGECONFIG[systemd] = "\ | 77 | PACKAGECONFIG[systemd] = "\ |
@@ -105,25 +105,42 @@ PACKAGECONFIG[concheck] = "-Dconcheck=true,-Dconcheck=false" | |||
105 | 105 | ||
106 | 106 | ||
107 | PACKAGES =+ " \ | 107 | PACKAGES =+ " \ |
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 | ||
119 | SYSTEMD_PACKAGES = "${PN} ${PN}-cloud-setup" | 122 | SYSTEMD_PACKAGES = "${PN}-daemon ${PN}-cloud-setup" |
123 | INITSCRIPT_PACKAGES = "${PN}-daemon" | ||
120 | 124 | ||
121 | NETWORKMANAGER_PLUGINDIR = "${libdir}/NetworkManager/${PV}" | 125 | NETWORKMANAGER_PLUGINDIR = "${libdir}/NetworkManager/${PV}" |
126 | NETWORKMANAGER_DISPATCHERDIR = "${nonarch_libdir}/NetworkManager/dispatcher.d" | ||
122 | 127 | ||
128 | |||
129 | SUMMARY:libnm = "Libraries for adding NetworkManager support to applications" | ||
130 | FILES:libnm = "\ | ||
131 | ${libdir}/libnm.so.* \ | ||
132 | ${libdir}/girepository-1.0/NM-1.0.typelib \ | ||
133 | " | ||
134 | |||
135 | SUMMARY:${PN}-adsl = "ADSL device plugin for NetworkManager" | ||
123 | FILES:${PN}-adsl = "${NETWORKMANAGER_PLUGINDIR}/libnm-device-plugin-adsl.so" | 136 | FILES:${PN}-adsl = "${NETWORKMANAGER_PLUGINDIR}/libnm-device-plugin-adsl.so" |
137 | RDEPENDS:${PN}-adsl += "${PN}-daemon" | ||
124 | 138 | ||
139 | SUMMARY:${PN}-bluetooth = "Bluetooth device plugin for NetworkManager" | ||
125 | FILES:${PN}-bluetooth = "${NETWORKMANAGER_PLUGINDIR}/libnm-device-plugin-bluetooth.so" | 140 | FILES:${PN}-bluetooth = "${NETWORKMANAGER_PLUGINDIR}/libnm-device-plugin-bluetooth.so" |
141 | RDEPENDS:${PN}-bluetooth += "${PN}-daemon ${@bb.utils.contains('PACKAGECONFIG', 'bluez5', '${PN}-wwan bluez5', '', d)}" | ||
126 | 142 | ||
143 | SUMMARY:${PN}-cloud-setup = "Automatically configure NetworkManager in cloud" | ||
127 | FILES:${PN}-cloud-setup = " \ | 144 | FILES:${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 | " |
151 | RDEPENDS:${PN}-cloud-setup += "${PN}-daemon" | ||
134 | ALLOW_EMPTY:${PN}-cloud-setup = "1" | 152 | ALLOW_EMPTY:${PN}-cloud-setup = "1" |
135 | SYSTEMD_SERVICE:${PN}-cloud-setup = "${@bb.utils.contains('PACKAGECONFIG', 'cloud-setup', 'nm-cloud-setup.service nm-cloud-setup.timer', '', d)}" | 153 | SYSTEMD_SERVICE:${PN}-cloud-setup = "${@bb.utils.contains('PACKAGECONFIG', 'cloud-setup', 'nm-cloud-setup.service nm-cloud-setup.timer', '', d)}" |
136 | 154 | ||
155 | SUMMARY:${PN}-nmcli = "NetworkManager command line client" | ||
137 | FILES:${PN}-nmcli = " \ | 156 | FILES:${PN}-nmcli = " \ |
138 | ${bindir}/nmcli \ | 157 | ${bindir}/nmcli \ |
139 | " | 158 | " |
159 | RDEPENDS:${PN}-nmcli += "${PN}-daemon" | ||
140 | 160 | ||
141 | FILES:${PN}-nmcli-doc = " \ | 161 | SUMMARY:${PN}-nmcli-bash-completion = "NetworkManager command line client bash completion" |
142 | ${mandir}/man1/nmcli* \ | 162 | FILES:${PN}-nmcli-bash-completion = "${datadir}/bash-completion/completions/nmcli" |
143 | " | 163 | RDEPENDS:${PN}-nmcli-bash-completion = "bash-completion" |
144 | 164 | ||
165 | SUMMARY:${PN}-nmtui = "NetworkManager curses-based UI" | ||
145 | FILES:${PN}-nmtui = " \ | 166 | FILES:${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 | " |
172 | RDEPENDS:${PN}-nmtui += "${PN}-daemon" | ||
151 | 173 | ||
152 | FILES:${PN}-nmtui-doc = " \ | 174 | SUMMARY:${PN}-wifi = "Wifi plugin for NetworkManager" |
153 | ${mandir}/man1/nmtui* \ | ||
154 | " | ||
155 | |||
156 | FILES:${PN}-wifi = "\ | 175 | FILES:${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 '' |
169 | RRECOMMENDS:${PN}-wifi += "${@get_wifi_deps(d)}" | 188 | RDEPENDS:${PN}-wifi += "${PN}-daemon ${@get_wifi_deps(d)}" |
170 | 189 | ||
190 | SUMMARY:${PN}-wwan = "Mobile broadband device plugin for NetworkManager" | ||
171 | FILES:${PN}-wwan = "\ | 191 | FILES:${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 | " |
175 | RRECOMMENDS:${PN}-wwan += "${@bb.utils.contains('PACKAGECONFIG','modemmanager','modemmanager','',d)}" | 195 | RDEPENDS:${PN}-wwan += "${PN}-daemon ${@bb.utils.contains('PACKAGECONFIG','modemmanager','modemmanager','',d)}" |
176 | 196 | ||
197 | SUMMARY:${PN}-ovs = "Open vSwitch device plugin for NetworkManager" | ||
177 | FILES:${PN}-ovs = "\ | 198 | FILES:${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 | " |
202 | RDEPENDS:${PN}-ovs += "${PN}-daemon" | ||
181 | 203 | ||
182 | FILES:${PN}-ovs-doc = "\ | 204 | SUMMARY:${PN}-ppp = "PPP plugin for NetworkManager" |
183 | ${mandir}/man7/nm-openvswitch.7* \ | ||
184 | " | ||
185 | |||
186 | FILES:${PN}-ppp = "\ | 205 | FILES:${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 | " |
190 | RRECOMMENDS:${PN}-ppp += "${@bb.utils.contains('PACKAGECONFIG','ppp','ppp','',d)}" | 209 | RDEPENDS:${PN}-ppp += "${PN}-daemon ${@bb.utils.contains('PACKAGECONFIG','ppp','ppp','',d)}" |
191 | 210 | ||
192 | FILES:${PN}-dev += " \ | 211 | FILES:${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 | ||
198 | FILES:${PN} += " \ | 218 | SUMMARY:${PN}-daemon += "The NetworkManager daemon" |
199 | ${libexecdir} \ | 219 | FILES:${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 | 240 | RRECOMMENDS:${PN}-daemon += "\ | |
215 | RRECOMMENDS:${PN} += "\ | ||
216 | iptables \ | 241 | iptables \ |
217 | ${@bb.utils.filter('PACKAGECONFIG', 'dnsmasq', d)} \ | 242 | ${@bb.utils.filter('PACKAGECONFIG', 'dnsmasq', d)} \ |
243 | " | ||
244 | INITSCRIPT_NAME:${PN}-daemon = "network-manager" | ||
245 | SYSTEMD_SERVICE:${PN}-daemon = "\ | ||
246 | NetworkManager.service \ | ||
247 | NetworkManager-dispatcher.service \ | ||
248 | " | ||
249 | RCONFLICTS:${PN}-daemon += "connman" | ||
250 | ALTERNATIVE_PRIORITY = "100" | ||
251 | ALTERNATIVE:${PN}-daemon = "${@bb.utils.contains('DISTRO_FEATURES','systemd','resolv-conf','',d)}" | ||
252 | ALTERNATIVE_TARGET[resolv-conf] = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${sysconfdir}/resolv-conf.NetworkManager','',d)}" | ||
253 | ALTERNATIVE_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. | ||
260 | ALLOW_EMPTY:${PN} = "1" | ||
261 | RRECOMMENDS:${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 | " |
228 | RCONFLICTS:${PN} = "connman" | ||
229 | |||
230 | |||
231 | INITSCRIPT_NAME = "network-manager" | ||
232 | SYSTEMD_SERVICE:${PN} = "\ | ||
233 | NetworkManager.service \ | ||
234 | NetworkManager-dispatcher.service \ | ||
235 | " | ||
236 | |||
237 | ALTERNATIVE_PRIORITY = "100" | ||
238 | ALTERNATIVE:${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','resolv-conf','',d)}" | ||
239 | ALTERNATIVE_TARGET[resolv-conf] = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${sysconfdir}/resolv-conf.NetworkManager','',d)}" | ||
240 | ALTERNATIVE_LINK_NAME[resolv-conf] = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${sysconfdir}/resolv.conf','',d)}" | ||
241 | 272 | ||
242 | do_install:append() { | 273 | do_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 |