tinyramfs/hooks/eudev/eudev
2020-07-27 11:32:22 +03:00

25 lines
591 B
Bash

# vim: set ft=sh:
# shellcheck shell=sh
#
# false positive
# shellcheck disable=2154
#
# handle_eudev()
{
print "configuring eudev"
for _binary in udevd udevadm; do
copy_binary "$_binary"
done
mkdir -p "${tmpdir}/lib/udev/rules.d"
printf "%s\n" \
'SUBSYSTEMS=="block", ACTION=="add", RUN+="/bin/device-helper"' \
> "${tmpdir}/lib/udev/rules.d/device-helper.rules"
[ "$monolith" = 1 ] || printf "%s\n" \
'ENV{MODALIAS}=="?*", ACTION=="add", RUN+="/bin/modprobe %E{MODALIAS}"' \
>> "${tmpdir}/lib/udev/rules.d/device-helper.rules"
}