KLDLOAD(8)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

πŸ’– kldload β€” load a file into the kernel πŸ’–

okay so this is kldload(8) from the System Manager's Manual, and honestly it's giving "small command, big main character energy" ✨ because it's literally how you shove a .ko file into your running kernel. let's go 🫢


✨ SYNOPSIS ✨

kldload [-nqv] file ...

🌸 DESCRIPTION 🌸

bestie. kldload loads file.ko into the kernel using the kernel linker. that's the whole vibe. πŸ’…

lowkey important: if you specify multiple modules, it's gonna attempt to load them all, even if some of them fail. no cap, it doesn't bail on the first failure β€” it just keeps going. πŸ”₯

also cute: the .ko extension is not mandatory when loading a module with kldload. it doesn't hurt to specify it though β€” specify it, don't specify it, the kernel does not care. πŸŽ€

here's the part people trip on πŸ™ˆ β€” if you request a bare filename, it will only be loaded if it's found within the module path as defined by the sysctl kern.module_path. so if you're like "kldload foo" and foo is sitting in your current directory, it's not gonna load. to load a module from the current directory you've gotta specify it as a full or relative path. and the utility will warn you if a module is requested as a bare filename and is present in the current directory β€” it's looking out for you fr fr 🫢

the following options are available:

πŸŽ€ OPTIONS πŸŽ€

  • -n β€” don't try to load the module if it's already loaded. like, don't even try, it's already slaying πŸ’…
  • -v β€” be more verbose. more talking, more info, we love a chatty icon πŸ’–
  • -q β€” silence any extraneous warnings. quiet queen behavior 🀫

⭐ NOTES ⭐

the kernel security level settings may prevent a module from being loaded or unloaded, and when that happens it gives you Operation not permitted. not a bug, just the security level doing its thing. πŸ’€

πŸ¦‹ FILES πŸ¦‹

  • /boot/kernel β€” directory containing loadable modules. modules must have an extension of .ko.

🌈 EXIT STATUS 🌈

the kldload utility exits 0 on success, and >0 if an error occurs. simple. iconic. periodt. πŸ‘‘

πŸ“ EXAMPLES πŸ“

to load by module name:

> kldload foo

to load by file name within the module path:

> kldload foo.ko

to load by relative path:

> kldload ./foo.ko

to load by full path:

> kldload /boot/kernel/foo.ko

🧚 AUTOMATICALLY LOADING MODULES 🧚

some modules (pf, ipfw, ipf, etc.) may be automatically loaded at boot time when the corresponding rc.conf(5) statement is used. modules may also be auto-loaded through their addition to loader.conf(5) or kld_list in rc.conf(5). so you don't even have to type anything β€” it just happens ✨

but listen πŸ‘€ only those modules necessary for booting the system, including those required for mounting the root filesystem, should be handled by loader.conf(5).

πŸ’œ SEE ALSO πŸ’œ

kenv(1), kldload(2), loader.conf(5), rc.conf(5), security(7), kldconfig(8), kldstat(8), kldunload(8), kldxref(8)

πŸŽ€ HISTORY πŸŽ€

the kldload utility first appeared in FreeBSD 3.0, replacing the lkm interface. glow-up of the century honestly πŸ’…βœ¨

πŸ‘‘ AUTHORS πŸ‘‘

Doug Rabson <dfr@FreeBSD.org>


okay that's the whole page, you're officially a kernel module loading girlie now πŸŒΈπŸ¦‹πŸ’–

mwah πŸ’‹ β€” this Debian build is dated December 20, 2023, and it's sourced from the System Manager's Manual, KLDLOAD(8). go load something iconic πŸŽ€

πŸ“¦ where this page comes from