tinyramfs/hooks/eudev/eudev
2020-09-04 01:29:37 +03:00

21 lines
541 B
Bash

# vim: set ft=sh:
# shellcheck shell=sh
#
# false positive
# shellcheck disable=2154
{
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"
}