mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
Fix inittab back to adding /proc, fops sketch, scripts to automate debugfs
This commit is contained in:
8
rootfs_overlay/debugfs.sh
Executable file
8
rootfs_overlay/debugfs.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
set -ex
|
||||
mkdir -p /debugfs
|
||||
mount -t debugfs none /debugfs
|
||||
insmod /debugfs.ko
|
||||
cd /debugfs/kernel_module_cheat
|
||||
cat myfile
|
||||
# => 42
|
||||
@@ -1,3 +1,14 @@
|
||||
# /etc/inittab
|
||||
::sysinit:/bin/mount -t proc proc /proc
|
||||
::sysinit:/bin/mount -o remount,rw /
|
||||
::sysinit:/bin/mkdir -p /dev/pts
|
||||
::sysinit:/bin/mkdir -p /dev/shm
|
||||
::sysinit:/bin/mount -a
|
||||
::sysinit:/bin/hostname -F /etc/hostname
|
||||
::sysinit:/etc/init.d/rcS
|
||||
# https://unix.stackexchange.com/questions/299408/how-to-login-automatically-without-typing-root-in-buildroot-x86-64-qemu
|
||||
console::respawn:/bin/sh
|
||||
::ctrlaltdel:/sbin/reboot
|
||||
::shutdown:/etc/init.d/rcK
|
||||
::shutdown:/sbin/swapoff -a
|
||||
::shutdown:/bin/umount -a -r
|
||||
|
||||
12
rootfs_overlay/fops.sh
Executable file
12
rootfs_overlay/fops.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
set -ex
|
||||
insmod /fops.ko
|
||||
mkdir -p /fops
|
||||
mount -t debugfs none /fops
|
||||
cd /fops/kernel_module_cheat
|
||||
cat fops
|
||||
# => open
|
||||
# => read
|
||||
# => close
|
||||
# TODO.
|
||||
#echo a >fops
|
||||
Reference in New Issue
Block a user