move device managers to hooks
This commit is contained in:
9
hooks/proc/proc
Normal file
9
hooks/proc/proc
Normal file
@@ -0,0 +1,9 @@
|
||||
# vim: set ft=sh:
|
||||
# shellcheck shell=sh
|
||||
#
|
||||
# handle_proc()
|
||||
{
|
||||
print "configuring /proc hotplugger"
|
||||
|
||||
copy_binary find
|
||||
}
|
||||
19
hooks/proc/proc.init
Normal file
19
hooks/proc/proc.init
Normal file
@@ -0,0 +1,19 @@
|
||||
# vim: set ft=sh:
|
||||
# shellcheck shell=sh
|
||||
#
|
||||
# false positive
|
||||
# shellcheck disable=2154
|
||||
#
|
||||
# run_proc()
|
||||
{
|
||||
[ "$break" = devmgr ] && { print "break before run_proc()"; sh; }
|
||||
|
||||
command -v device-helper > /proc/sys/kernel/hotplug
|
||||
|
||||
# get ready for fork bomb. kek
|
||||
find /sys/devices -name uevent |
|
||||
|
||||
while read -r uevent; do
|
||||
printf add > "$uevent"
|
||||
done 2> /dev/null
|
||||
}
|
||||
7
hooks/proc/proc.init.late
Normal file
7
hooks/proc/proc.init.late
Normal file
@@ -0,0 +1,7 @@
|
||||
# vim: set ft=sh:
|
||||
# shellcheck shell=sh
|
||||
#
|
||||
# stop_proc()
|
||||
{
|
||||
printf '\n' > /proc/sys/kernel/hotplug
|
||||
}
|
||||
Reference in New Issue
Block a user