mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-13 20:12:26 +00:00
12 lines
199 B
Bash
Executable File
12 lines
199 B
Bash
Executable File
#!/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
|