106.13. networkmanager-1.58.1
Network connection manager (Wi-Fi, Ethernet, mobile broadband, VPN; libnm for the panel's network surface)
| Version | 1.58.1, release 2 |
| Shelf | network — Host network configuration and connection management: links, Wi-Fi, DHCP, DNS forwarding, time, modems, firewall and VPN |
| Phase | 41_system (System), 652 of 1047 in build order |
| Licence | GPL-2.0-or-later AND LGPL-2.1-or-later |
| Homepage | https://networkmanager.dev/ |
| Build time | 1.3 SBU |
| Installed size | 11.7 MiB in 239 files |
| Recipe | ports/core/network/networkmanager/kpkgbuild |
About
NetworkManager is the daemon that brings links up and keeps them up: Ethernet, Wi-Fi through wpa_supplicant, mobile broadband through ModemManager, PPPoE and serial modems through pppd, Bluetooth tethering, VPNs and a shared hotspot. It also installs nmcli, nmtui and libnm, the client library that networkmanager-qt and the OpenVPN plugin networkmanager-openvpn build on. Plasma’s network applet, plasma-nm, drives it through networkmanager-qt. /etc/init.d/42_networkmanager.sh starts it under the supervisor with --no-daemon, after polkit and ModemManager.
What sets the KDOS build apart is what is missing around it. There is no systemd, so the build names no unit directory and no journal; logins are tracked by elogind, which NetworkManager asks which users have a session and when the machine is about to suspend. Every helper program it runs (dnsmasq, pppd, dhcpcd, nft, resolvconf, modprobe) is named by absolute path at configure time, so the paths compiled into the binary are the ones the image installs.
build.sh adds two files of its own. /usr/lib/NetworkManager/conf.d/10-kdos-dns.conf sets dns=dnsmasq, so NetworkManager starts a caching dnsmasq on 127.0.0.1 and ::1 and feeds it each connection’s servers (Networking describes the result). nmtui.desktop gives nmtui a menu entry under its own name, described as Network connections in a terminal and run in one. Its categories are Network;ConsoleOnly; and not Settings, so it sits beside the network applications rather than among the settings pages, and a search for network lists System Settings’ Wi-Fi & Networking page and it as two plainly different things.
Sources
networkmanager-1.58.1.tar.xz(6.2 MiB)
sha256262864cfd198123d3e5dbe91937441b97ee9059d6d712e1a5bfbb1c54668d14d
upstream: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/releases/1.58.1/downloads/NetworkManager-1.58.1.tar.xz
archive copy: sources-3/network--networkmanager-1.58.1.tar.xz
Dependencies
Depends on: meson, glib, dbus, libnl, libndp, jansson, libgudev, polkit, wpa_supplicant, nftables, dnsmasq, openresolv, modemmanager, mobile-broadband-provider-info, bluez, ppp, libpsl, newt, curl, readline, libbpf, clang, bpftool, gnutls, elogind.
Required by (4): networkmanager-openvpn, networkmanager-qt, plasma-nm, tlp.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/41_system/phase.env && kpkg install networkmanager'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/network/networkmanager.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/network/networkmanager
echo '262864cfd198123d3e5dbe91937441b97ee9059d6d712e1a5bfbb1c54668d14d networkmanager-1.58.1.tar.xz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/networkmanager
SRC=$SRC_ROOT/networkmanager-1.58.1
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf networkmanager-1.58.1.tar.xz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
meson setup build --buildtype=release \
--prefix=/usr --sysconfdir=/etc --libdir=lib --libexecdir=/usr/lib --localstatedir=/var \
-Dintrospection=false \
-Ddocs=false \
-Dman=true \
-Dvapi=false \
-Dtests=no \
-Dsystemd_journal=false \
-Dsystemdsystemunitdir=no \
-Dsystemdsystemgeneratordir=no \
-Dsession_tracking=elogind \
-Dsession_tracking_consolekit=false \
-Dpolkit=true \
-Dpolkit_agent_helper_1=/usr/lib/polkit-1/polkit-agent-helper-1 \
-Dsuspend_resume=elogind \
-Dmodem_manager=true \
-Dofono=false \
-Dbluez5_dun=true \
-Dteamdctl=false \
-Dovs=false \
-Dclat=true \
-Dbpf-compiler=clang \
-Dppp=true \
-Dpppd=/usr/sbin/pppd \
-Dconcheck=true \
-Dnm_cloud_setup=false \
-Dfirewalld_zone=false \
-Difupdown=false \
-Dnmcli=true \
-Dnmtui=true \
-Dreadline=libreadline \
-Dwifi=true \
-Diptables=/usr/sbin/iptables \
-Dip6tables=/usr/sbin/ip6tables \
-Dnft=/usr/sbin/nft \
-Ddhcpcd=/usr/sbin/dhcpcd \
-Ddnsmasq=/usr/sbin/dnsmasq \
-Dmodprobe=/usr/sbin/modprobe \
-Dresolvconf=/usr/sbin/resolvconf \
-Dnetconfig=no \
-Diwd=false \
-Dlibpsl=true \
-Dnbft=false \
-Dconfig_dhcp_default=internal \
-Dconfig_logging_backend_default=syslog \
-Dcrypto=gnutls \
-Dqt=false \
-Dselinux=false \
-Dlibaudit=no
meson compile -C build
DESTDIR=$PKG meson install --no-rebuild -C build
install -d "$PKG/usr/lib/NetworkManager/conf.d"
cat > "$PKG/usr/lib/NetworkManager/conf.d/10-kdos-dns.conf" <<'EOF'
[main]
dns=dnsmasq
EOF
chmod 644 "$PKG/usr/lib/NetworkManager/conf.d/10-kdos-dns.conf"
install -d "$PKG/usr/share/applications"
cat > "$PKG/usr/share/applications/nmtui.desktop" <<'EOF'
[Desktop Entry]
Type=Application
Name=nmtui
GenericName=Network connections in a terminal
Comment=Wi-Fi, Ethernet and VPN connections
Exec=nmtui
Icon=network-wired
Terminal=true
Categories=Network;ConsoleOnly;
Keywords=network;wifi;wireless;ethernet;vpn;nmtui;
EOF
chmod 644 "$PKG/usr/share/applications/nmtui.desktop"
The switches, and why each is set:
--libexecdir=/usr/lib— Put the helper programs NetworkManager runs itself (nm-dhcp-helper,nm-dispatcher,nm-daemon-helperand the rest) in/usr/librather than/usr/libexec.-Dintrospection=false— Build no GObject introspection data forlibnm, so no language binding can load it through GObject introspection. The Vala bindings and the API documentation are made from that data, so they cannot be built either.-Ddocs=false— Build no API reference forlibnm. Upstream refuses-Ddocs=truewithout introspection.-Dman=true— Install the manual pages:NetworkManager(8),NetworkManager.conf(5),nmcli(1),nmtui(1)and the settings references. The release tarball carries them already built.-Dvapi=false— Build no Vala bindings. They are generated from the introspection data, which this build does not make.-Dtests=no— Build none of upstream’s test programs.-Dsystemd_journal=false— Log withoutlibsystemd’s journal API. KDOS has no systemd (No systemd), and upstream’s default needs it.-Dsystemdsystemunitdir=no,-Dsystemdsystemgeneratordir=no— Install no systemd unit files and no generator. Left empty, each is looked up through systemd’s pkg-config file and the configure step stops when that is missing.-Dsession_tracking=elogind— Track logins through elogind’slibelogind(upstream’s choices aresystemd,elogindandno). NetworkManager then knows which users have a session, so a profile that names an owner in itspermissionslist (auser:profile, which Plasma’s network applet creates for a connection marked as not shared with other users) is visible to that user and connects on its own while they are logged in. Without a tracker every user counts as having no session, and such a profile is invisible and never connects.-Dsession_tracking_consolekit=false— Build no ConsoleKit session tracker beside elogind’s. ConsoleKit is not in the tree, and with it on NetworkManager would watch ConsoleKit’s database for sessions that never appear.-Dpolkit=true— Ask polkit before every privileged request a client makes. The actionswheelis granted, and those it is not, are listed in polkit and the authentication agent.-Dpolkit_agent_helper_1=/usr/lib/polkit-1/polkit-agent-helper-1— The setuid helpernmcliruns when it acts as a polkit authentication agent itself (nmcli agent polkit). The path is where the polkit port installs it, compiled in rather than searched for.-Dsuspend_resume=elogind— Listen for elogind’sPrepareForSleepsignal and take a delay inhibitor, so NetworkManager takes its devices down before the machine sleeps and brings them back after it wakes, whatever started the suspend: the lid, the power menu orloginctl. Nothing else may call NetworkManager’sSleep()around a suspend, or it sleeps and wakes twice.-Dmodem_manager=true— Drive mobile broadband modems through modemmanager’s D-Bus interface, with mobile-broadband-provider-info for a carrier’s APN.-Dofono=false— Build no oFono modem support, which upstream marks experimental. oFono is not in the tree.-Dbluez5_dun=true— Support Bluetooth dial-up networking through a phone, built against bluez’s headers.-Dteamdctl=false— Build no support for team devices. It needslibteamdctl, which is not in the tree.-Dovs=false— Build no Open vSwitch support. Open vSwitch is not in the tree.-Dclat=true— Build CLAT (464XLAT), which lets an IPv4-only program reach the IPv4 internet over an IPv6-only network through that network’s NAT64 gateway. It is a BPF program loaded into the kernel, built with libbpf and bpftool, and is off in every connection until itsipv4.clatproperty, or anipv4.clatdefault inNetworkManager.conf, turns it on.-Dbpf-compiler=clang— Compile that BPF program withclang -target bpf. Upstream’s other choice is abpf-gcccross compiler, which is not in the tree; clang is a dependency of this port for this one program.-Dppp=true,-Dpppd=/usr/sbin/pppd— Build the PPP plugin, which carries PPPoE and serial modem connections, and name where ppp installspppd.-Dconcheck=true— Build connectivity checking, which fetches a known URL over curl to tell a working link from a captive portal. It runs only when a[connectivity]section inNetworkManager.confnames auri, and KDOS ships no such section.-Dnm_cloud_setup=false— Build nonm-cloud-setup, the tool that configures networking from a cloud provider’s metadata service.-Dfirewalld_zone=false— Install no firewalld zone for shared connections. firewalld is not in the tree; the firewall is nftables, and/etc/nftables.confopens what a hotspot needs.-Difupdown=false— Build no plugin that reads Debian’s/etc/network/interfaces. Left atauto, upstream turns it on when/etc/debian_versionexists on the build machine.-Dnmcli=true,-Dnmtui=true— Build the command line client and the text interface.nmtuidraws with newt.-Dreadline=libreadline— Linknmcli’s interactive editor with GNU readline, and stop the configure step if it is missing, rather than falling back to libedit.-Dwifi=true— Build Wi-Fi support, with wpa_supplicant as the back end.-Diptables=/usr/sbin/iptables,-Dip6tables=/usr/sbin/ip6tables,-Dnft=/usr/sbin/nft— The firewall commands NetworkManager runs to install a shared connection’s NAT, by the paths the image installs them at.-Ddhcpcd=/usr/sbin/dhcpcd— Build support for dhcpcd as an alternative DHCP client (main.dhcp=dhcpcd), at this path. The default stays the internal client.-Ddnsmasq=/usr/sbin/dnsmasq— ThednsmasqNetworkManager starts, both as the local caching resolver that10-kdos-dns.confasks for and as the DHCP and DNS server of a shared hotspot. Left empty and not found at configure time, upstream compiles in no path at all.-Dmodprobe=/usr/sbin/modprobe— ThemodprobeNetworkManager runs to load a kernel module before it needs one, such asppp_genericor the netfilter modules a shared connection uses.-Dresolvconf=/usr/sbin/resolvconf— Write/etc/resolv.confthrough openresolv’sresolvconf, the one writer of that file on KDOS, so NetworkManager,dhcpcdandwg-quicknever overwrite each other’s entries.-Dnetconfig=no— Build no support for SUSE’snetconfig, the other resolv.conf manager upstream knows.-Diwd=false— Build no iwd Wi-Fi back end. iwd is not in the tree.-Dlibpsl=true— Link libpsl, the public suffix list. When the host name is a full domain name, NetworkManager adds its domain part to the DNS search list, and libpsl keeps it from adding a public suffix such asco.ukthere; without it every domain counts as private.-Dnbft=false— Build no NBFT support, which reads the firmware’s table for an NVMe-over-TCP boot disk and configures its network. It lives innm-initrd-generator, which nothing in the KDOS boot path runs, and with it on the configure step needs libnvme.-Dconfig_dhcp_default=internal— Make NetworkManager’s built-in DHCP client the default. A second client on the same link would take a second lease, so/etc/init.d/30_network.shkeepsdhcpcddown while NetworkManager runs; see One DHCP client on the link.-Dconfig_logging_backend_default=syslog— Log to syslog by default, where KDOS’s logs are kept. It is also what upstream picks when the journal is off.-Dcrypto=gnutls— Read certificates and private keys (for 802.1X profiles) with gnutls instead of upstream’s default, NSS.-Dqt=false— Build none of upstream’s Qt example programs.-Dselinux=false— Build without SELinux labelling, which needslibselinux; KDOS has no SELinux.-Dlibaudit=no— Send no records to the Linux audit daemon, which is not in the tree. Each audited operation is still logged by NetworkManager itself, atinfolevel in itsAUDITlogging domain.
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/networkmanager, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf networkmanager-1.58.1-2.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/networkmanager, and runs the triggers its paths call for.
Contents
Installed programs: NetworkManager, nm-online, nmcli, nmtui, nmtui-connect, nmtui-edit, nmtui-hostname.
Installed libraries: libnm.so.
Installed directories: /etc/NetworkManager, /usr/include/libnm, /usr/lib/NetworkManager/1.58.1, /usr/lib/NetworkManager/conf.d, /usr/lib/NetworkManager/dispatcher.d/no-wait.d, /usr/lib/NetworkManager/dispatcher.d/pre-down.d, /usr/lib/NetworkManager/dispatcher.d/pre-up.d, /usr/lib/NetworkManager/system-connections, /usr/share/doc/NetworkManager, /usr/share/licenses/networkmanager, /var/lib/NetworkManager.
Short descriptions
NetworkManager |
network management daemon |
nm-online |
ask NetworkManager whether the network is connected |
nmcli |
command-line tool for controlling NetworkManager |
nmtui |
Text User Interface for controlling NetworkManager |
nmtui-connect |
Text User Interface for controlling NetworkManager |
nmtui-edit |
Text User Interface for controlling NetworkManager |
nmtui-hostname |
Text User Interface for controlling NetworkManager |
libnm.pc |
Convenience library for clients of NetworkManager |
Notes
dhcpcd and NetworkManager must not both run. /etc/init.d/30_network.sh (see Services) stands down when /usr/sbin/NetworkManager is executable and /etc/service.disabled/networkmanager is absent, and the marker alone keeps NetworkManager off. With systemd off the build installs no D-Bus activation file for org.freedesktop.NetworkManager, and the image adds none, so the system bus never starts NetworkManager: a call plasma-nm makes while the name has no owner is refused rather than answered by a second, unsupervised NetworkManager; see /etc/service.disabled/<name>.
ModemManager has to be on the bus first. 42_modemmanager.sh sorts before 42_networkmanager.sh and returns once ModemManager holds its name: NetworkManager’s WWAN and Bluetooth DUN devices are ModemManager’s modems, and NetworkManager calls the name as it starts. The call can start nothing, because the modemmanager port deletes the activation file its build installs; see How polkit and ModemManager are started.
A file of the same name in /etc/NetworkManager/conf.d overrides 10-kdos-dns.conf, which is how a machine opts out of the local resolver without editing a packaged file.