Test-case (kmod-stopper.c) ---------
$ sudo apt-get -y install gcc make libelf-dev linux-headers-$(uname -r)
$ touch Makefile # fake it, and use this make line: $ make -C /lib/modules/$(uname -r)/build M=$(pwd) obj-m=kmod-stopper.o modules
$ echo 9 | sudo tee /proc/sys/kernel/printk
$ sudo insmod kmod-stopper.ko <watch console for messages> <it either hangs / finishes>
$ sudo rmmod kmod-stopper
Test-case (kmod-stopper.c)
---------
$ sudo apt-get -y install gcc make libelf-dev linux-headers- $(uname -r)
$ touch Makefile # fake it, and use this make line: $(uname -r)/build M=$(pwd) obj-m=kmod- stopper. o modules
$ make -C /lib/modules/
$ echo 9 | sudo tee /proc/sys/ kernel/ printk
$ sudo insmod kmod-stopper.ko
<watch console for messages>
<it either hangs / finishes>
$ sudo rmmod kmod-stopper