I have a pretty simple udev rule which is executed when a USB is plugged into my Debian machine:
SUBSYSTEMS=="usb", KERNEL=="sd?", ACTION=="add", RUN+="/usr/local/bin/USB/t.sh \ %k"
t.sh is also pretty simple and it does two things:
- Prints helloworld in
foo.komodule into kernel with simple
#!/bin/bash echo 'Hello World!' >>"/home/salman/Desktop/udev.out" insmod helloworld.ko exit
When I plug in my USB,
udev.out is correctly printed on Desktop but the following line
insmod helloworld.ko fails to load the module in the kernel.
I checked with
lsmod | grep helloworld but it doesn't show
helloworld loaded into kernel.
I am running a Debian machine inside Virtual Box.