23 releases

0.4.1 May 25, 2023
0.3.6 May 22, 2023
0.3.2 Jul 24, 2021
0.2.5 Mar 31, 2021
0.2.0 Mar 27, 2020

#223 in Unix APIs

MIT/Apache

38KB
233 lines

Linux Modules

standard-readme compliant linux_modules crates.io version and link linux_modules Crates.io license linux_modules docs.rs badge

Tool To Manage Linux Kernel Modules

This is a tool to manage your Linux Kernel Modules. It is an alternative to modprobe, and supports listing, adding, and removing modules, as well as displaying information on them.

It does not yet support modprobe style dependencies or aliases, and is not capable of displaying module signature data, except whether one exists or not.

Install

cargo install linux_modules

Usage

CLI

$ nms info loop
╭───────────────────┬──────────────────────────────────────╮
 File              ┆ /lib/modules/6.3.1-arch2-1/kernel/dr │
                   ┆ ivers/block/loop.ko.zst              │
╞═══════════════════╪══════════════════════════════════════╡
 Authors           ┆                                      │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
 License           ┆ GPL                                  │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
 Description       ┆                                      │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
 Version           ┆                                      │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
 Firmware          ┆                                      │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
 Alias             ┆ devname:loop-control                 │
                   ┆ char-major-10-237                    │
                   ┆ block-major-7-*
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
 Dependencies      ┆                                      │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
 Soft Dependencies ┆                                      │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
 Imports           ┆                                      │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
 In Tree           ┆ true                                 │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
 Retpoline         ┆ true                                 │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
 Staging           ┆ false                                │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
 Version Magic     ┆ 6.3.1-arch2-1 SMP preempt mod_unload │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
 Source Checksum   ┆ B9EBD1F7F134B1C20C5B09B              │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
 Parameters        ┆ ╭────────────┬───────────┬─────────╮ │
                   ┆ │ Name       ┆ Descripti ┆ Type    │ │
                   ┆ │            ┆ on        ┆         │ │
                   ┆ ╞════════════╪═══════════╪═════════╡ │
                   ┆ │ hw_queue_d ┆ Queue     ┆ Unknown │ │
                   ┆ │ epth       ┆ depth for ┆         │ │
                   ┆ │            ┆ each      ┆         │ │
                   ┆ │            ┆ hardware  ┆         │ │
                   ┆ │            ┆ queue.    ┆         │ │
                   ┆ │            ┆ Default:  ┆         │ │
                   ┆ │            ┆ 128       ┆         │ │
                   ┆ ├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤ │
                   ┆ │ max_loop   ┆ Maximum   ┆ Int     │ │
                   ┆ │            ┆ number of ┆         │ │
                   ┆ │            ┆ loop      ┆         │ │
                   ┆ │            ┆ devices   ┆         │ │
                   ┆ ├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤ │
                   ┆ │ max_part   ┆ Maximum   ┆ Int     │ │
                   ┆ │            ┆ number of ┆         │ │
                   ┆ │            ┆ partition ┆         │ │
                   ┆ │            ┆ s per     ┆         │ │
                   ┆ │            ┆ loop      ┆         │ │
                   ┆ │            ┆ device    ┆         │ │
                   ┆ ╰────────────┴───────────┴─────────╯ │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
 Certificate       ┆ ╭───────────┬──────────────────────╮ │
                   ┆ │ Issuer    ┆ Build time           │ │
                   ┆ │           ┆ autogenerated kernel │ │
                   ┆ │           ┆ key                  │ │
                   ┆ ├╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤ │
                   ┆ │ Key       ┆ 4E:B6:01:3E:90:BF:CB │ │
                   ┆ │           ┆ :2F:16:A8:7B:E8:BD:D │ │
                   ┆ │           ┆ 9:84:E2:62:13:DA:93  │ │
                   ┆ ├╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤ │
                   ┆ │ Hash      ┆ SHA-512              │ │
                   ┆ ├╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤ │
                   ┆ │ Signature ┆ 30:65:02:30:10:6E:4F │ │
                   ┆ │           ┆ :14:BB:47:BA:27:BD:3 │ │
                   ┆ │           ┆ 6:70:AE:1F:29:DD:DB: │ │
                   ┆ │           ┆ 8E:30:83:B1:BB:EF:62 │ │
                   ┆ │           ┆ :90:B1:8E:33:87:E2:5 │ │
                   ┆ │           ┆ 2:16:A4:19:DA:21:2B: │ │
                   ┆ │           ┆ 9D:44:89:EB:24:8A:07 │ │
                   ┆ │           ┆ :2E:5E:0D:F0:38:02:3 │ │
                   ┆ │           ┆ 1:00:CC:5E:DF:B0:15: │ │
                   ┆ │           ┆ EE:96:D9:49:98:A1:16 │ │
                   ┆ │           ┆ :75:28:45:80:4A:8B:7 │ │
                   ┆ │           ┆ B:9D:C7:11:06:C6:C6: │ │
                   ┆ │           ┆ 99:31:4C:56:8D:7D:37 │ │
                   ┆ │           ┆ :72:4E:83:6D:6F:4D:8 │ │
                   ┆ │           ┆ 9:6A:D8:29:14:D4:25: │ │
                   ┆ │           ┆ B1:83:C5             │ │
                   ┆ ╰───────────┴──────────────────────╯ │
╰───────────────────┴──────────────────────────────────────╯

Note that the table size will adapt to your terminal. This example uses size 60, chosen for best fit on https://crates.io

Pager

nms info and nms list automatically pipe output to a pager, defaulting to less, but this may be customized through environment variables.

See the pager crate for details on how to customize what pager is used.

Changelog

Please see CHANGELOG for version history

Contributing

This crate is not looking for contributors at this time.

However, feel free to ask questions and request bindings using github issues, or suggest/discuss API improvements.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as below, without any additional terms or conditions.

License

Licensed under either of

at your option.

Dependencies

~8–19MB
~256K SLoC