move device managers to hooks

This commit is contained in:
illiliti
2020-07-27 11:32:22 +03:00
parent 32a38b17a5
commit 5eae5cd6a9
18 changed files with 237 additions and 125 deletions

22
hooks/mdevd/mdevd Normal file
View File

@ -0,0 +1,22 @@
# vim: set ft=sh:
# shellcheck shell=sh
#
# false positive
# shellcheck disable=2154,2016
#
# handle_mdevd()
{
print "configuring mdevd"
for _binary in mdevd mdevd-coldplug; do
copy_binary "$_binary"
done
printf "%s\n" \
'SUBSYSTEM=block;.* 0:0 660 @device-helper' \
> "${tmpdir}/etc/mdev.conf"
[ "$monolith" = 1 ] || printf "%s\n" \
'$MODALIAS=.* 0:0 660 @modprobe "$MODALIAS"' \
>> "${tmpdir}/etc/mdev.conf"
}