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

98.20. libstoragemgmt-1.11.0

Storage array and local disk management library, the lsmd plugin daemon and lsmcli

Version 1.11.0, release 1
Shelf disk — Block devices: partitioning, RAID, LVM, block encryption, SMART, NVMe, recovery, image writing and async I/O
Phase 41_system (System), 402 of 1047 in build order
Licence LGPL-2.1-or-later
Homepage https://libstorage.github.io/libstoragemgmt-doc/
Build time 0.4 SBU
Installed size 4.1 MiB in 389 files
Recipe ports/core/disk/libstoragemgmt/kpkgbuild

About

libstoragemgmt is a vendor-neutral library for managing storage: RAID controllers, storage arrays and the local disks of the machine, through one API (liblsm), the lsmcli command and plugins for each kind of hardware. The plugins run under lsmd, a daemon that clients reach through sockets in /run/lsm/ipc. In KDOS its consumer is udisks2, built with --enable-lsm, whose LSM module reaches lsmd through those sockets. The port installs the library, lsmcli, lsmd, the plugins, and a service script that starts lsmd at boot.

Sources

Dependencies

Depends on: glib, sqlite, eudev, python3, libconfig, perl, pkgconf, bash-completion.

Required by (1): udisks2.

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 libstoragemgmt'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/disk/libstoragemgmt.

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/disk/libstoragemgmt
echo '07fd9c8e498a052b7ed201c56936120910ec4992fa1f3ade88a0c66e088bdc93  libstoragemgmt-1.11.0.tar.gz' | 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/libstoragemgmt
SRC=$SRC_ROOT/libstoragemgmt-1.11.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf libstoragemgmt-1.11.0.tar.gz -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:

export CFLAGS="$CFLAGS -Wno-error"
export CXXFLAGS="$CXXFLAGS -Wno-error"

./configure \
	--prefix=/usr \
	--sysconfdir=/etc \
	--libdir=/usr/lib \
	--localstatedir=/var \
	--disable-static \
	--without-test \
	--without-smispy \
	--without-ledmon \
	--with-bash-completion-dir=/usr/share/bash-completion/completions \
	--with-systemdsystemunitdir=no \
	--with-systemd-sysusersdir=no \
	--with-systemd-tmpfilesdir=no \
	PYTHON=python3
make
make DESTDIR=$PKG install

install -d "$PKG/etc/init.d"
cat > "$PKG/etc/init.d/51_lsmd.sh" <<'KDOS_SH'
#!/bin/bash
. /etc/init.d/service_helper

NAME="lsmd"
DAEMON="/usr/bin/lsmd"

case "$1" in
    start)
        [ ! -x "$DAEMON" ] && { echo "[SKIP] $NAME: $DAEMON not found"; exit 0; }
        echo "[KDOS] Starting $NAME..."
        install -d -m 775 -g libstoragemgmt /run/lsm /run/lsm/ipc
        # -d: stay in the foreground, so ksvc watches the daemon itself.
        supervise "$NAME" "$DAEMON" -d
        ;;
    stop)   stop_service "$NAME" ;;
    status) check_status "$NAME" ;;
    *)      echo "Usage: $0 {start|stop|status}"; exit 1 ;;
esac
KDOS_SH
chmod 755 "$PKG/etc/init.d/51_lsmd.sh"

The switches, and why each is set:

The common switches of each build system are explained in the Flag glossary.

postinstall.sh runs on the installed system after the package is adopted:

root="${PKG_ROOT:-/}"
grep -q '^libstoragemgmt:' "$root/etc/group" 2>/dev/null || groupadd -R "$root" -r libstoragemgmt
grep -q '^libstoragemgmt:' "$root/etc/passwd" 2>/dev/null || \
	useradd -R "$root" -r -g libstoragemgmt -d /run/lsm -s /sbin/nologin libstoragemgmt

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/libstoragemgmt, 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 libstoragemgmt-1.11.0-1.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/libstoragemgmt, and runs the triggers its paths call for.

Contents

Installed programs: arcconf_lsmplugin, hpsa_lsmplugin, local_lsmplugin, lsmcli, lsmd, megaraid_lsmplugin, nfs_lsmplugin, sim_lsmplugin, simc_lsmplugin, targetd_lsmplugin.

Installed libraries: libstoragemgmt.so.

Installed directories: /etc/lsm, /usr/include/libstoragemgmt, /usr/lib/python3.14/site-packages/arcconf_plugin, /usr/lib/python3.14/site-packages/hpsa_plugin, /usr/lib/python3.14/site-packages/local_plugin, /usr/lib/python3.14/site-packages/lsm, /usr/lib/python3.14/site-packages/megaraid_plugin, /usr/lib/python3.14/site-packages/nfs_plugin, /usr/lib/python3.14/site-packages/sim_plugin, /usr/lib/python3.14/site-packages/targetd_plugin, /usr/libexec/lsm.d, /usr/share/licenses/libstoragemgmt.

Short descriptions

arcconf_lsmplugin LibstorageMgmt Arcconf plugin
hpsa_lsmplugin LibstorageMgmt HP SmartArray plugin
local_lsmplugin LibstorageMgmt Local Pseudo plugin
lsmcli libStorageMgmt command line interface
lsmd lsmd
megaraid_lsmplugin LibstorageMgmt MegaRAID plugin
nfs_lsmplugin LibstorageMgmt local network file system plugin
sim_lsmplugin LibStorageMgmt simulator python plugin
simc_lsmplugin LibstorageMgmt Simulator C Plugin
targetd_lsmplugin libStorageMgmt targetd plugin
libstoragemgmt.pc Storage array management library

Notes