tinyramfs/hooks/eudev/eudev
2021-05-10 14:30:22 +03:00

20 lines
522 B
Bash

# vim: set ft=sh:
# shellcheck shell=sh
#
# https://www.shellcheck.net/wiki/SC2154
# 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"