From 28917e9dfc9911b84e7b73713dfb7698df46694e Mon Sep 17 00:00:00 2001 From: Tomas M Date: Tue, 23 May 2017 04:04:40 -0400 Subject: [PATCH] force refresh devices so it works even without hotplug --- livekitlib | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/livekitlib b/livekitlib index 8e9f4f0..1efee53 100644 --- a/livekitlib +++ b/livekitlib @@ -158,6 +158,17 @@ modprobe_everything() echo "Probing for hardware" >&2 find /lib/modules/ | fgrep .ko | xargs -n 1 modprobe 2>/dev/null + refresh_devs +} + + +refresh_devs() +{ + debug_log "refresh_devs" "$*" + if [ -r /proc/sys/kernel/hotplug ]; then + echo /sbin/mdev > /proc/sys/kernel/hotplug + fi + mdev -s } @@ -165,12 +176,11 @@ modprobe_everything() init_devs() { debug_log "init_devs" "$*" - echo /sbin/mdev > /proc/sys/kernel/hotplug - mdev -s modprobe zram 2>/dev/null modprobe loop 2>/dev/null modprobe squashfs 2>/dev/null modprobe fuse 2>/dev/null + refresh_devs } # Activate zram (auto-compression of RAM) @@ -198,6 +208,7 @@ init_aufs() # TODO maybe check here if aufs support is working at all # and produce useful error message if user has no aufs modprobe aufs 2>/dev/null + refresh_devs } # Setup empty union