mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-28 04:24:26 +01:00
move all our stuff into /lkmc in guest
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.
This commit is contained in:
20
rootfs_overlay/lkmc/params.sh
Executable file
20
rootfs_overlay/lkmc/params.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
d=/sys/module/params/parameters
|
||||
i="${d}/i"
|
||||
j="${d}/j"
|
||||
f=/sys/kernel/debug/lkmc_params
|
||||
|
||||
insmod params.ko
|
||||
[ "$(cat "$i")" = 0 ]
|
||||
[ "$(cat "$j")" = 0 ]
|
||||
[ "$(cat "$f")" = '0 0' ]
|
||||
printf 1 > "$i"
|
||||
[ "$(cat "$f")" = '1 0' ]
|
||||
printf 2 > "$j"
|
||||
[ "$(cat "$f")" = '1 2' ]
|
||||
rmmod params
|
||||
|
||||
insmod params.ko i=3 j=4
|
||||
[ "$(cat "$f")" = '3 4' ]
|
||||
rmmod params
|
||||
Reference in New Issue
Block a user