mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-29 04:54:27 +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:
11
rootfs_overlay/lkmc/sysfs.sh
Executable file
11
rootfs_overlay/lkmc/sysfs.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
insmod sysfs.ko
|
||||
f=/sys/kernel/lkmc_sysfs/foo
|
||||
# write
|
||||
printf 12345 > "$f"
|
||||
# read
|
||||
[ "$(cat "$f")" = 1234 ]
|
||||
# seek
|
||||
[ "$(dd if="$f" bs=1 count=2 skip=1 status=none)" = 23 ]
|
||||
rmmod sysfs
|
||||
Reference in New Issue
Block a user