Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

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

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:

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.