mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-25 19:21:35 +01:00
Motivation: userland is getting several new subdirectories, it would be too insane to just dump all of that in the guest root filesystem. To alleviate the cd pain, .profile puts user inside /lkmc by default.
9 lines
150 B
Bash
Executable File
9 lines
150 B
Bash
Executable File
#!/bin/sh
|
|
set -e
|
|
f=/sys/kernel/debug/lkmc_kstrto
|
|
insmod kstrto.ko
|
|
printf 123 > "$f"
|
|
[ "$(cat "$f")" = 124 ]
|
|
echo foobar > "$f" && exit 1
|
|
rmmod kstrto
|