rpcd: reload rpcd on installation of rpcd-mod-*

When installing additional rpcd modules, a restart of rpcd is required.
This often confuses users as even after installing rpcd-mod-rpcsys the
relevant ubus objects are still missing until rpcd has been reloaded
(or the system has been rebooted, obviously).
Let rpcd-mod-* reload rpcd as post-install action.

Fixes: #10220

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
This commit is contained in:
Daniel Golle 2021-10-29 12:14:16 +01:00 committed by AmadeusGhost
parent 10f73c2bd0
commit 2a0953e837

View File

@ -72,7 +72,7 @@ endef
# 3: plugin title/description # 3: plugin title/description
define BuildPlugin define BuildPlugin
PKG_CONFIG_DEPENDS += CONFIG_PACKAGE_luci-rpc-mod-$(1) PKG_CONFIG_DEPENDS += CONFIG_PACKAGE_rpcd-mod-$(1)
define Package/rpcd-mod-$(1) define Package/rpcd-mod-$(1)
$(Package/rpcd/default) $(Package/rpcd/default)
@ -84,6 +84,11 @@ define BuildPlugin
$(3) $(3)
endef endef
define Package/rpcd-mod-$(1)/postinst
#!/bin/sh
[ -n "$$$${IPKG_INSTROOT}" ] || /etc/init.d/rpcd reload
endef
define Package/rpcd-mod-$(1)/install define Package/rpcd-mod-$(1)/install
$(INSTALL_DIR) $$(1)/usr/lib/rpcd $(INSTALL_DIR) $$(1)/usr/lib/rpcd
$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(1).so $$(1)/usr/lib/rpcd/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(1).so $$(1)/usr/lib/rpcd/
@ -97,3 +102,4 @@ $(eval $(call BuildPackage,rpcd))
$(eval $(call BuildPlugin,file,,Provides ubus calls for file and directory operations.)) $(eval $(call BuildPlugin,file,,Provides ubus calls for file and directory operations.))
$(eval $(call BuildPlugin,rpcsys,,Provides ubus calls for sysupgrade and password changing.)) $(eval $(call BuildPlugin,rpcsys,,Provides ubus calls for sysupgrade and password changing.))
$(eval $(call BuildPlugin,iwinfo,+libiwinfo,Provides ubus calls for accessing iwinfo data.)) $(eval $(call BuildPlugin,iwinfo,+libiwinfo,Provides ubus calls for accessing iwinfo data.))
$(eval $(call BuildPlugin,ucode,+libucode,Allows implementing plugins using ucode scripts.))