mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-25 11:11: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.
11 lines
392 B
Bash
Executable File
11 lines
392 B
Bash
Executable File
#!/bin/sh
|
|
set -e
|
|
f=/sys/kernel/debug/lkmc_seq_file
|
|
insmod seq_file.ko
|
|
[ "$(cat "$f")" = "$(printf '0\n1\n2\n')" ]
|
|
[ "$(cat "$f")" = "$(printf '0\n1\n2\n')" ]
|
|
[ "$(dd if="$f" bs=1 count=2 skip=0 status=none)" = "$(printf '0\n')" ]
|
|
[ "$(dd if="$f" bs=1 count=2 skip=2 status=none)" = "$(printf '1\n')" ]
|
|
[ "$(dd if="$f" bs=4 count=1 skip=0 status=none)" = "$(printf '0\n1\n')" ]
|
|
rmmod seq_file
|