aboutsummaryrefslogtreecommitdiff
path: root/net/nut/Makefile
diff options
context:
space:
mode:
authorDaniel F. Dickinson <cshored@thecshore.com>2018-08-27 16:06:58 -0400
committerDaniel F. Dickinson <cshored@thecshore.com>2018-08-29 00:12:53 -0400
commit1cd4dcfa99f1c619874ee75b978d59118a43934b (patch)
tree6a6da78efe1a6fa7482380026bacacb864f12461 /net/nut/Makefile
parentceff68837d4b8d5a9bd8bf1962e913b5203d95e5 (diff)
nut: Add USB hotplug support
usbhid-ups has the necessary information in the source, so let's support USB hotplugging out of the box. Takes advantage of the procd support now in nut-server initscript. Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
Diffstat (limited to 'net/nut/Makefile')
-rw-r--r--net/nut/Makefile11
1 files changed, 11 insertions, 0 deletions
diff --git a/net/nut/Makefile b/net/nut/Makefile
index 972056959..d5a573ede 100644
--- a/net/nut/Makefile
+++ b/net/nut/Makefile
@@ -80,6 +80,16 @@ define Package/nut-server/install
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/upsdrvctl $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/nut/driver.list $(1)/usr/share/nut/
ln -sf /var/etc/nut/ups.conf $(1)/etc/nut/ups.conf
+ # Mangle libhid.usermap into a format (hotplug shell script) useful for OpenWrt
+ $(INSTALL_DIR) $(1)/etc/hotplug.d/usb
+ $(INSTALL_BIN) ./files/30-libhid-ups.head $(1)/etc/hotplug.d/usb/30-libhid-ups
+ $(CP) $(PKG_INSTALL_DIR)/etc/hotplug/usb/libhid.usermap $(PKG_BUILD_DIR)/30-libhid-ups.middle
+ $(SED) '/^$$$$/d' \
+ -e '/^#/d' \
+ -E -e 's:^[^ ][^ ]* *0x0003 *0x0{0,3}([^ ][^ ]*) *0x{0,3}*([^ ][^ ]*).*:\1/\2/* | \\:' \
+ $(PKG_BUILD_DIR)/30-libhid-ups.middle
+ tail -n+2 $(PKG_BUILD_DIR)/30-libhid-ups.middle >>$(1)/etc/hotplug.d/usb/30-libhid-ups
+ cat ./files/30-libhid-ups.tail >>$(1)/etc/hotplug.d/usb/30-libhid-ups
endef
define Package/nut-common
@@ -515,6 +525,7 @@ CONFIGURE_ARGS += \
--without-neon \
--without-powerman \
--without-wrap \
+ --with-hotplug-dir=/etc/hotplug \
--with-cgi \
--without-ipmi \
--without-freeipmi \