[Toybox] [PATCH] rmmod: various fixes.

Rob Landley rob at landley.net
Sat Sep 11 11:39:52 PDT 2021


On 9/11/21 12:25 PM, enh wrote:
> i'm not usually a pro-bloat kind of guy, but whenever i'm dealing with modules i
> wish the kernel just came with example1.ko and example2.ko for me to mess around
> with without actually causing any problems!

I could presumably build some myself, but usually I just play with net/dummy.ko
when smoketesting:

$ sudo insmod /lib/modules/$(uname -r)/kernel/drivers/net/dummy.ko
$ sudo ifconfig dummy0
dummy0: flags=130<BROADCAST,NOARP>  mtu 1500
        ether 6e:c7:3c:2a:ee:47  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

$ sudo rmmod /lib/modules/$(uname -r)/kernel/drivers/net/dummy.ko
$ sudo ifconfig dummy0
dummy0: error fetching interface information: Device not found

Or I can insmod and rmmod a filesystem driver and see if it shows up in
/proc/filesystems. (insmod squashfs, rmmod squashfs...)

That's just basic smoketesting though. Testing module _arguments_, I'd have to
dig further. (It would be lovely if modinfo told you what the module's arguments
were, but modules don't seem to _export_ this information in a readable format.

Rob



More information about the Toybox mailing list