233.4. kpmcore-26.08.2
KDE Partition Manager core: partition and filesystem backend with a polkit root helper
26.08.2-1 · GPL-3.0-or-later AND MIT AND CC0-1.0 AND CC-BY-4.0 · 2.5 SBU · 2.3 MiB, 100 files · 43_toolkits, 85 of 344 · ports/core/disk/kpmcore
Homepage: https://invent.kde.org/system/kpmcore
KPMcore is the engine of KDE Partition Manager: it reads the disks and their partition tables, models every filesystem it knows, and runs the operations (create, delete, resize, move, copy, check, label, format, encrypt) as a queue of jobs. The library itself runs as the user. Every command that touches a device goes through kpmcore_externalcommand, a root helper that D-Bus starts on the system bus when the library first asks for it, after polkit has allowed the request. partitionmanager is built on it, and the graphical KDOS installer opens Partition Manager when a person lays out the disk by hand.
Depends on: cmake, ninja, extra-cmake-modules, pkgconf, qt6-qtbase, kcoreaddons, ki18n, kwidgetsaddons, polkit-qt6, polkit, dbus, util-linux, eudev, e2fsprogs, dosfstools, exfatprogs, btrfs-progs, xfsprogs, f2fs-tools, ntfs-3g, udftools, nilfs-utils, jfsutils, cryptsetup, lvm2, mdadm, smartmontools.
Required by (1): partitionmanager.
Sources: kpmcore-26.08.2.tar.xz (666.9 KiB). Every step kpkg takes applies to this port.
Install: script/chroot/exec.sh bash -c 'source script/phases/43_toolkits/phase.env && kpkg install kpmcore'
build.sh:
cmake -S . -B build -G Ninja \
-D CMAKE_INSTALL_PREFIX=/usr \
-D KDE_INSTALL_LIBDIR=lib \
-D CMAKE_BUILD_TYPE=Release \
-D KDE_INSTALL_USE_QT_SYS_PATHS=ON \
-D BUILD_TESTING=OFF \
-D KF_SKIP_PO_PROCESSING=ON \
-D PARTMAN_SFDISKBACKEND=ON \
-D PARTMAN_DUMMYBACKEND=OFF \
-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build
-D PARTMAN_SFDISKBACKEND=ON— Builds the sfdisk backend,pmsfdiskbackendplugin, the one backend for Linux disks and the library’s default. It reads disks withlsblk,blkidandsfdisk --jsonand writes partition tables withsfdisk, all from util-linux. Upstream’s default is the same; the switch is pinned because without it the library finds no disks.-D PARTMAN_DUMMYBACKEND=OFF— Builds no dummy backend. It is a stand-in for the test suite that reports an invented disk, and Partition Manager’s settings would offer it as a backend a person could choose.-D KF_SKIP_PO_PROCESSING=ON— Builds none of the translation catalogues underpo/, which the package-wide English-only rule would remove anyway (see Size and language policy).
Libraries: libkpmcore.so.
Directories: /usr/include/kpmcore, /usr/lib/cmake/KPMcore, /usr/lib/qt6/plugins/kpmcore, /usr/share/licenses/kpmcore.
The helper is installed as /usr/lib/libexec/kpmcore_externalcommand with a system-bus activation file, org.kde.kpmcore.helperinterface.service (User=root) under /usr/share/dbus-1/system-services, and a bus policy under /usr/share/dbus-1/system.d that lets only root own the name. D-Bus starts it through the setuid dbus-daemon-launch-helper of dbus. Its one polkit action, org.kde.kpmcore.externalcommand.init, is auth_admin_keep for an active session and no for an inactive one, with no allow_any: a request from outside an active elogind session is refused outright, and one from the person at the machine raises the authentication agent’s prompt for an administrator’s password. The live medium is the exception: there the installer’s polkit rule, which /etc/init.d/63_live-installer.sh copies into /etc/polkit-1/rules.d at boot, grants the action to the local active session with no password; see kdos-installer-gui.
The helper runs only the commands on its compiled allowlist, and only from the trusted prefixes /, /usr and /usr/local, looking in bin/ before sbin/ under each. A toybox applet in /usr/bin therefore wins over a util-linux tool of the same name in /usr/sbin; each tool it runs must be the real one wherever both exist.
Every filesystem is supported only as far as its tools are installed, so the run-time tools are in depends: e2fsprogs, dosfstools, exfatprogs, btrfs-progs, xfsprogs, f2fs-tools, ntfs-3g, udftools, nilfs-utils and jfsutils; LUKS through cryptsetup, LVM through lvm2, software RAID through mdadm, and the SMART status page through smartctl from smartmontools. udevadm from eudev waits for the kernel to settle after a table changes. ReiserFS, OCFS2, HFS+ and bcachefs have no tools in the tree, so Partition Manager offers no operation on those filesystems beyond deleting the partition.