Repository navigation
Releases
Releases · rustutils/linuxutils
Release v0.2.0
Added
Libraries
linuxutils-mount: Rust-native crate for the mount subsystem. It has
parsers for/proc/self/mountinfo,/etc/fstaband/proc/swaps, the
MountEntryandMountTabletypes,MountFlagsbitflags, anOptionList
parser, an option classifier (optmap), and wrappers for themount(2)and
umount2(2)syscalls. See libs/mount/README.md.linuxutils-blkid: Rust-native crate for tag resolution through the
/dev/disk/by-*udev symlinks. There is no on-disk probe layer yet. See
libs/blkid/README.md.compat/libmount: ABI-compatiblelibmount.soshim backed by
linuxutils-mount. The first version covers read-only parsing and lookup of
fstab, mountinfo and/proc/swaps(mnt_table_*, themnt_fs_*getters,
and iteration). Context, cache, lock, monitor and setters come later. See
compat/libmount/README.md.compat/libblkid: ABI-compatiblelibblkid.soshim backed by
linuxutils-blkid. The first version covers the udev symlink resolution
layer: cache lifecycle,blkid_evaluate_tag,blkid_evaluate_spec,
blkid_get_devname, device queries (blkid_get_dev,blkid_dev_has_tag,
blkid_find_dev_with_tag,blkid_get_tag_value), and iteration over
devices and tags. The probe layer (blkid_probe_*, partitions, topology) is
out of scope. See compat/libblkid/README.md.TagandTagKindinlinuxutils-common, shared between
linuxutils-mountandlinuxutils-blkid.- Placeholder
libkmodcrate for the upcoming kmod tools.
Tools
mount(first version): list, fstab lookup and direct forms, with the-L
and-Ushortcuts and routing for bind, rbind and remount.-a/--allwalks
fstab with the-tand-Ofilters, skippingnoauto, swap, ignored and
already mounted entries.umount(first version): resolves targets, sources and tags, with-f,
-l,-r,-nand-v.findmnt(first version): listsmountinfo,fstabor/proc/swaps, with
filters for target, source and filesystem type.findfs: resolvesLABEL=andUUID=throughlinuxutils-blkid.blkid(first version): listing mode and-Land-Ulookups, without a
probe layer.fincore: reports page cache residency usingmincore(2).exch: exchanges two paths atomically usingrenameat2(RENAME_EXCHANGE).bits: converts bit masks between the mask, grouped mask, list, binary and
expanded formats.--listcompresses runs of three or more evenly spaced
bits intostart-end[:stride], as upstream does.getino: reports pidfd and namespace inodes.wdctl: shows hardware watchdog status (identity, timeouts, feature and
status flags, boot status) using theWDIOC_*ioctls. It does the magic
close write on exit, so the kernel doesn't fire the watchdog whenwdctl
returns. The options that change settings (--settimeout,
--setpretimeout) come later.setarch: runs a program with a different architecture or personality
flags, usingpersonality(2)andexecvp. It covers the cross-host
architecture names (linux32,linux64), the common host-specific ones,
and all the standard personality flags (--addr-no-randomize,
--uname-2.6,--mmap-page-zeroand so on). The--listand--show
modes are supported.- The
linuxutilsmulticall binary now includes every tool.bits,blkid,
exch,fincore,findfs,findmnt,getino,mountandumountwere
missing before. A test now checks that no tool is left out. linuxutils --listprints the name of every tool, one per line. The Nix
flake uses it to create the symlinks for the multicall package.
Packaging and CI
- Release packages:
.deband.rpmpackages, tarballs and static binaries
for x86_64, aarch64 and riscv64, built withjust package. They install
next to util-linux rather than replacing it, with the multicall binary in
/usr/bin, a symlink for each tool in/usr/lib/linuxutils/binand the
man pages in/usr/share/linuxutils/man. - GitLab CI runs formatting, clippy, rustdoc and
cargo denychecks and the
test suite on every push. Version tags build the packages and publish a
release on GitLab and GitHub. deny.tomlforcargo deny.
Tests and infrastructure
- Vendored the upstream util-linux test suite under
tests/util-linux/, with
a wrapper (tests/util-linux-runner.sh) and a Justfile target
(just test-util-linux) that builds the workspace and runs the upstream
tests against ourtarget/debug/binaries. Tests for tools we haven't
written yet are skipped automatically, and the failures make up the roadmap
for a 1.0 release. testutilcrate with support for/procand/sysfixtures.- Fixture-backed tests for
lslocks,lsmem,lsirqandlsns. - Snapshot tests of argument parsing for every tool group (
disk,login,
misc,sched,system,term,text). --helpsnapshot tests, with fixed wrapping throughHELP_WIDTH_MAX.
Documentation
- mdbook scaffold under
docs/with a landing page for each group. - Project branding (banner SVGs for light and dark themes).
- Status tables in
libs/mount/README.mdandlibs/blkid/README.mdthat
track gaps compared to upstream libmount and libblkid.
Changed
- Man pages for system administration tools are now in section 8, as
upstream has them, andcargo xtask mangenwrites them intoman1and
man8directories. - Release builds use LTO, a single codegen unit,
panic = "abort", and are
stripped. - Updated rustix to 1.1.6, which fixes RUSTSEC-2026-0486.
- Reorganised the library layout.
libs/*is now for Rust-native crates, and
the ABI-compatible shims moved tocompat/*(for example,libs/libuuid
moved tocompat/libuuid). - Raised the MSRV to Rust 1.87 (was 1.85) to use
u*::is_multiple_of. ipcslearned upstream's-t/--time,-p/--pidand-c/--creator
display modes, and prints sections in upstream's order (messages, shared
memory, semaphores) in every mode.renamenow matches the output format and matching rules of upstream
rename(1):- Symlink mode prints
file: `old' -> `new'. - With
--no-overwrite, skipped files printSkipping existing file: `name'to stdout. - The
`old' -> `new'line is only printed on success. - The search is limited to the basename when neither side of the
substitution contains/. - Trailing slashes on input paths are removed before processing.
- Symlink mode prints
bits --listoutput is compressed into ranges, as upstream does. The flat
form moved to the new-x/--expandmode.
Fixed
- The tools now build for musl.
chrtcalls the scheduler system calls
directly, since musl's wrappers for them always fail withENOSYS, and
the ioctl calls inblockdev,blkdiscard,eject,fsfreeze,fstrim,
losetupandwdctlpass their request numbers in the type that musl
expects. cargo xtask mangennow writes a man page for every tool. It used to skip
the same nine tools that were missing from the multicall binary, because it
kept its own list. It now uses the multicall binary's list.rev --helpandcolumn --helpdescribed the wholelinuxutils-text
crate instead of the tool.- The
--helptext of many tools is easier to read. Descriptions that were
written as Markdown lists no longer run together into one paragraph, notes
about the implementation are no longer shown to users, and Markdown
formatting such as backticks is gone. - The Nix flake builds again. Its source filter dropped files the build
needs (the hand-written man page sections and the test snapshots). It now
also installs every tool, and the C headers fromcompat/. Two kinds of
test that failed in its sandbox are fixed: the fixture tests now skip when
unsharecan't run, and thewhereis -mtest no longer needs a man page
forlson the host. setarch:--show=VALnow decodes hex and decimal personality values into
upstream's format ofPER_*plus a flag list (for example,0x00880000
becomesPER_LINUX (FDPIC_FUNCPTRS ADDR_LIMIT_32BIT)). Before, it treated
the value as an architecture name.- New
--pid=PIDoption reads another process's personality from
/proc/PID/personality. - Verbose output (
Switching on FLAG.,Execute command `name'.) and
error messages (Unrecognized architecture,failed to execute) now
match upstream.
copyfilerange:--rangescan be given more than once.- Verbose mode prints
copy_file_range SRC to DST OFF:OFF:LENto stdout.
Before, it printed a different format to stderr. - It refuses to copy from beyond the end of the source, with upstream's
offset N is beyond file size of Merror.
waitpid:- Accepts the race-free
PID:INODEform printed bygetino -p, and checks
that the pidfs inode hasn't been reused. --timeoutaccepts fractional seconds.- With
--verbose, printsTimeout expiredto stdout on timeout. Before,
it printed a different message to stderr. - The message for a process that already exited now reads
PID N has exited, skipping, as upstream does.
- Accepts the race-free
line:- Reads one byte at a time from file descriptor 0. A
BufReaderused to
read too far, which broke(line && line) <pipe. - Ignores extra positional arguments.
- At EOF without a final
\n, adds the newline that POSIX requires.
- Reads one byte at a time from file descriptor 0. A
mountpoint:--nofollowno longer reports a symlink as a mountpoint. The path used
to be canonicalised, which resolved the symlink before the mountinfo
lookup.- Rejects
--devnowith--nofollow, with upstream's
mountpoint: --devno and --nofollow are mutually exclusiveerror.
lsmem:- Column alignment matches upstream (
SIZE,STATE,NODEandZONES
are now right-aligned). - The kernel's lower-case
none...
- Column alignment matches upstream (