mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-22 17:55:57 +01:00
13 lines
438 B
Bash
Executable File
13 lines
438 B
Bash
Executable File
#!/bin/sh
|
|
set -e
|
|
f=/sys/kernel/debug/lkmc_seq_file
|
|
mod="${1:-seq_file.ko}"
|
|
[ $# -gt 1 ] && shift
|
|
insmod "$mod" "$@"
|
|
[ "$(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
|