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.
14 lines
322 B
Bash
Executable File
14 lines
322 B
Bash
Executable File
#!/bin/sh
|
|
set -e
|
|
d=/debugfs
|
|
mkdir -p "$d"
|
|
mount -t debugfs none "$d"
|
|
insmod debugfs.ko
|
|
[ "$(cat "${d}/lkmc_debugfs/myfile")" = 42 ]
|
|
echo 13 > "${d}/lkmc_debugfs/myfile"
|
|
[ "$(cat "${d}/lkmc_debugfs/myfile")" = 13 ]
|
|
echo 666 > "${d}/lkmc_debugfs_file"
|
|
[ "$(cat "${d}/lkmc_debugfs/myfile")" = 666 ]
|
|
rmmod debugfs
|
|
umount "$d"
|