Revert "kodi: service addon wrapper call fix"

This reverts commit 3fc36563b1ae228e26979751439a6a069e078136.

This fixes service addons not being started after installation.

Signed-off-by: Matthias Reichl <hias@horus.com>
This commit is contained in:
Matthias Reichl 2021-03-17 16:24:18 +01:00
parent c5d7822663
commit addab9b783
2 changed files with 8 additions and 9 deletions

View File

@ -17,8 +17,8 @@
+ case LE_ADDON_DISABLED: + case LE_ADDON_DISABLED:
+ contextStr = "disable"; + contextStr = "disable";
+ break; + break;
+ case LE_ADDON_POST_UPDATE: + case LE_ADDON_POST_INSTALL:
+ contextStr = "post-update"; + contextStr = "post-install";
+ break; + break;
+ case LE_ADDON_PRE_UNINSTALL: + case LE_ADDON_PRE_UNINSTALL:
+ contextStr = "pre-uninstall"; + contextStr = "pre-uninstall";
@ -38,13 +38,12 @@
void OnPreInstall(const AddonPtr& addon) void OnPreInstall(const AddonPtr& addon)
{ {
//Fallback to the pre-install callback in the addon. //Fallback to the pre-install callback in the addon.
@@ -409,6 +440,9 @@ void OnPostInstall(const AddonPtr& addon @@ -409,6 +440,8 @@ void OnPostInstall(const AddonPtr& addon
} }
closedir(addonsDir); closedir(addonsDir);
} }
+ +
+ if (update) + LEAddonHook(addon, LE_ADDON_POST_INSTALL);
+ LEAddonHook(addon, LE_ADDON_POST_UPDATE);
// OE // OE
addon->OnPostInstall(update, modal); addon->OnPostInstall(update, modal);
@ -66,7 +65,7 @@
+typedef enum { +typedef enum {
+ LE_ADDON_ENABLED, + LE_ADDON_ENABLED,
+ LE_ADDON_DISABLED, + LE_ADDON_DISABLED,
+ LE_ADDON_POST_UPDATE, + LE_ADDON_POST_INSTALL,
+ LE_ADDON_PRE_UNINSTALL, + LE_ADDON_PRE_UNINSTALL,
+} LE_ADDON_CONTEXT; +} LE_ADDON_CONTEXT;
+ +

View File

@ -29,8 +29,8 @@ if [ -f "${SERVICE_FILE}" ] ; then
systemctl stop "${ADDON_ID}.service" systemctl stop "${ADDON_ID}.service"
systemctl disable "${ADDON_ID}.service" systemctl disable "${ADDON_ID}.service"
;; ;;
post-update) post-install)
# post-update is triggered on update, # post-install is triggered on update as well,
# make sure to stop and re-install service # make sure to stop and re-install service
systemctl stop "${ADDON_ID}.service" systemctl stop "${ADDON_ID}.service"
systemctl disable "${ADDON_ID}.service" systemctl disable "${ADDON_ID}.service"
@ -77,7 +77,7 @@ if [ -d "${OVERLAY_PATH}" ] ; then
OVERLAY_CONF="/storage/.cache/kernel-overlays/50-${ADDON_ID}.conf" OVERLAY_CONF="/storage/.cache/kernel-overlays/50-${ADDON_ID}.conf"
case "${CONTEXT}" in case "${CONTEXT}" in
enable | post-update ) enable | post-install )
create_overlay_conf create_overlay_conf
;; ;;
disable | pre-uninstall ) disable | pre-uninstall )