KLDCONFIG(8)
π KLDCONFIG β the manual page, but make it cute
okay bestie, welcome to the kldconfig(8) glow-up β¨ it lives in section 8 of the System Manager's Manual and it's literally the glow-up artist for your kernel module search path. let's get into it π«Ά
πΈ NAME πΈ
kldconfig β display or modify the kernel module search path. that's it. that's the whole vibe check π
β¨ SYNOPSIS β¨
kldconfig [-dfimnUv] [-S sysctlname] [path ...]
kldconfig -r
two moods, bestie. one with paths, one with just -r. pick your fighter π
π DESCRIPTION π
so the kldconfig utility displays or modifies the search path β and that's the search path the kernel uses when it's loading modules via the kldload(8) utility or the kldload(2) syscall. it's giving behind-the-scenes main character energy, honestly π₯
here are the options, and yes i'm listing every single one because we don't skip π
π¦ OPTIONS π¦
-dβ remove the specified paths from the module search path. bye bestie π-fβ do not fail if a path you specified for adding is already present in the search path, or if a path you specified for removing is not present in the search path. this may be useful in startup/shutdown scripts for adding a path to a file system which is still not mounted, or in shutdown scripts for unconditionally removing a path that may have been added during startup. it's the "no thoughts, just vibes" flag π«Ά-iβ add the specified paths to the beginning of the search path, not to the end. front of the line energy π this option can only be used when adding paths β don't get cute with it.-mβ instead of replacing the module search path with the set of paths specified, "merge" in the new entries. like, keep the old stuff AND the new stuff. both. both is good π-nβ do not actually change the module search path. it's a dress rehearsal, a simulation, a little delulu where nothing is real π-rβ display the current search path. this option cannot be used if any paths are also specified. periodt.-Ssysctlname β specify the sysctl name to use instead of the defaultkern.module_path. custom name, custom vibe.-Uβ "Unique-ify" the current search path. if any of the directories is repeated one or more times, only the first occurrence remains. this option implies-m. slay, but tidy π-vβ verbose output: display the new module search path. and if the path has been changed, and the-vflag is specified more than once, the old path is displayed as well. double-v= the before AND after pics πΈ
π FILES π
/boot/kernel,/boot/modules,/modulesβ the default module search path used by the kernel. the OGs π
π EXIT STATUS π
the kldconfig utility exits 0 on success, and >0 if an error occurs. clean exit = iconic. error = we don't talk about it π
π₯ EXAMPLES π₯
okay this is the fun part, let's actually do things π
Show the module search path β the classic, the starter pack:
$ kldconfig -r
/boot/kernel;/boot/modules;/boot/dtb;/boot/dtb/overlays
Try to delete the /boot directory from the search path. the command will fail. not me getting rejected π
$ kldconfig -d /boot
kldconfig: not in module search path: /boot
$ echo $?
1
Same as above but forcing the operation. this time the command will succeed. -f said "i got you" π«Ά
$ kldconfig -d -f /boot
$ echo $?
0
Add the /boot directory to the beginning of the search path and display extra verbose output β watch it scoot to the front:
$ kldconfig -i -m -vv /boot
/boot/kernel;/boot/modules -> /boot;/boot/kernel;/boot/modules
Without -m the -i flag will overwrite the contents of the search path list. yeahβ¦ it really does that. that's the whole list gone, bestie π
$ kldconfig -i -vv /boot
/boot;/boot/kernel;/boot/modules;/boot/dtb;/boot/dtb/overlays -> /boot
Same as above but using -n to simulate the operation without actually doing it β the simulation arc π
$ kldconfig -i -n -vv /boot
/boot;/boot/kernel;/boot/modules;/boot/dtb;/boot/dtb/overlays -> /boot
Add directories to the search path removing duplicates. note the need of -f to force the operation in case any of the directories is already in the search path. the /boot/kernel directory will be added once β unique, one of a kind, literally main character energy π
$ kldconfig -f -U /boot/kernel /boot/kernel /boot/modules /boot/dtb /boot/dtb/overlays
π§ SEE ALSO π§
kldload(2), kldload(8), kldxref(8), sysctl(8) β go read those too, i'll wait π
β HISTORY β
the kldconfig utility first appeared in FreeBSD 4.4. vintage. retro. a legacy icon π
π AUTHORS π
Peter Pentchev <roam@FreeBSD.org> β thank you for this, king π«Ά
and that's the whole page, bestie!! this Debian build is dated September 29, 2020 and it's KLDCONFIG(8) in the System Manager's Manual, so you know exactly which era of slay you're reading π β¨ π¦
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2001 Peter Pentchev
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms