*: refactor

Documentation will be rewritten and added later.
This commit is contained in:
illiliti
2021-07-31 20:20:16 +03:00
parent 7bfc7fe315
commit a468c11a30
45 changed files with 618 additions and 2161 deletions

14
hook/mdev/mdev Normal file
View File

@ -0,0 +1,14 @@
# vim: set ft=sh:
# shellcheck shell=sh
#
# https://shellcheck.net/wiki/SC2154
# shellcheck disable=2154
for _bin in mdev find kill; do
copy_exec "$_bin"
done
cat > "${tmpdir}/etc/mdev.conf" << EOF
SUBSYSTEM=block;.* 0:0 660 @/sbin/helper
\$MODALIAS=.* 0:0 660 @/sbin/helper
EOF

24
hook/mdev/mdev.init Normal file
View File

@ -0,0 +1,24 @@
# vim: set ft=sh:
# shellcheck shell=sh
#
# https://shellcheck.net/wiki/SC2154
# shellcheck disable=2154
mdev -s
mdev -df 2> /dev/null &
# https://shellcheck.net/wiki/SC2034
# shellcheck disable=2034
mdev_pid=$!
find /sys/devices -name uevent |
while read -r uevent; do
printf add > "$uevent"
done 2> /dev/null
find /sys/devices -name uevent |
while read -r uevent; do
printf add > "$uevent"
done 2> /dev/null

7
hook/mdev/mdev.init.late Normal file
View File

@ -0,0 +1,7 @@
# vim: set ft=sh:
# shellcheck shell=sh
#
# https://shellcheck.net/wiki/SC2154
# shellcheck disable=2154
kill "$mdev_pid"