From 1bc3d97eb556d7ffb8b91d9119fa299f552140d0 Mon Sep 17 00:00:00 2001 From: hgy59 Date: Tue, 4 Feb 2020 21:28:30 +0100 Subject: [PATCH] add workaround for mono bug with armv5 - ref: https://github.com/mono/mono/issues/12537 --- spk/jackett/src/service-setup.sh | 8 ++++++-- spk/lidarr/src/service-setup.sh | 9 +++++++-- spk/radarr/src/service-setup.sh | 9 +++++++-- spk/sonarr/src/service-setup.sh | 7 ++++++- 4 files changed, 26 insertions(+), 7 deletions(-) diff --git a/spk/jackett/src/service-setup.sh b/spk/jackett/src/service-setup.sh index 69cb7b6bde52..7a6bfbce7cec 100644 --- a/spk/jackett/src/service-setup.sh +++ b/spk/jackett/src/service-setup.sh @@ -5,13 +5,17 @@ service_prestart () { # Replace generic service startup - MONO_PATH="${SYNOPKG_PKGDEST}/../mono/bin" PATH="${SYNOPKG_PKGDEST}/bin:${MONO_PATH}:${PATH}" MONO="${MONO_PATH}/mono" JACKETT="${SYNOPKG_PKGDEST}/share/${SYNOPKG_PKGNAME}/JackettConsole.exe" HOME_DIR="${SYNOPKG_PKGDEST}/var" + # workaround for mono bug with armv5 (https://github.com/mono/mono/issues/12537) + if [ "$SYNOPKG_DSM_ARCH" == "88f8621" -o "$SYNOPKG_DSM_ARCH" == "88f8622" ]; then + MONO="MONO_ENV_OPTIONS='-O=-aot,-float32' ${MONO_PATH}/mono" + fi + echo "Starting Jackett as user ${EFF_USER}" >> ${LOG_FILE} COMMAND="env HOME=${HOME_DIR} PATH=${PATH} LD_LIBRARY_PATH=${SYNOPKG_PKGDEST}/lib ${MONO} ${JACKETT} --PIDFile ${PID_FILE}" @@ -30,5 +34,5 @@ service_postinst () $BIN/delgroup "${USER}" "users" >> ${INST_LOG} $BIN/deluser "${USER}" >> ${INST_LOG} - echo "service_postinst ${SYNOPKG_PKG_STATUS}" >> $INST_LOG + echo "service_postinst ${SYNOPKG_PKG_STATUS}" >> ${INST_LOG} } diff --git a/spk/lidarr/src/service-setup.sh b/spk/lidarr/src/service-setup.sh index 4a1863eb4836..3fabe87a2d7b 100644 --- a/spk/lidarr/src/service-setup.sh +++ b/spk/lidarr/src/service-setup.sh @@ -1,5 +1,5 @@ PATH="${SYNOPKG_PKGDEST}/bin:${PATH}" -MONO_PATH="/usr/local/mono/bin" +MONO_PATH="${SYNOPKG_PKGDEST}/../mono/bin" MONO="${MONO_PATH}/mono" # Check versions during upgrade @@ -14,6 +14,11 @@ PID_FILE="${CONFIG_DIR}/Lidarr/lidarr.pid" # Some have it stored in the root of package LEGACY_CONFIG_DIR="${SYNOPKG_PKGDEST}/.config" +# workaround for mono bug with armv5 (https://github.com/mono/mono/issues/12537) +if [ "$SYNOPKG_DSM_ARCH" == "88f8621" -o "$SYNOPKG_DSM_ARCH" == "88f8622" ]; then + MONO="MONO_ENV_OPTIONS='-O=-aot,-float32' ${MONO_PATH}/mono" +fi + GROUP="sc-download" SERVICE_COMMAND="env PATH=${MONO_PATH}:${PATH} HOME=${HOME_DIR} LD_LIBRARY_PATH=${SYNOPKG_PKGDEST}/lib ${MONO} ${LIDARR}" @@ -46,7 +51,7 @@ service_preupgrade () service_postupgrade () { - # Restore Current Lidarr Binary If Current Ver. >= SPK Ver. + # Restore Current Lidarr Binary if Current Ver. >= SPK Ver. . ${CONFIG_DIR}/KEEP_VAR if [ "$KEEP_CUR" == "yes" ]; then echo "Restoring Lidarr version from before upgrade" >> ${INST_LOG} diff --git a/spk/radarr/src/service-setup.sh b/spk/radarr/src/service-setup.sh index 790db62cef2f..78727fd0f948 100644 --- a/spk/radarr/src/service-setup.sh +++ b/spk/radarr/src/service-setup.sh @@ -1,5 +1,5 @@ PATH="${SYNOPKG_PKGDEST}/bin:${PATH}" -MONO_PATH="/usr/local/mono/bin" +MONO_PATH="${SYNOPKG_PKGDEST}/../mono/bin" MONO="${MONO_PATH}/mono" # Check versions during upgrade @@ -14,6 +14,11 @@ PID_FILE="${CONFIG_DIR}/Radarr/nzbdrone.pid" # Some have it stored in the root of package LEGACY_CONFIG_DIR="${SYNOPKG_PKGDEST}/.config" +# workaround for mono bug with armv5 (https://github.com/mono/mono/issues/12537) +if [ "$SYNOPKG_DSM_ARCH" == "88f8621" -o "$SYNOPKG_DSM_ARCH" == "88f8622" ]; then + MONO="MONO_ENV_OPTIONS='-O=-aot,-float32' ${MONO_PATH}/mono" +fi + GROUP="sc-download" LEGACY_GROUP="sc-media" @@ -68,7 +73,7 @@ service_preupgrade () service_postupgrade () { - # Restore Current Radarr Binary If Current Ver. >= SPK Ver. + # Restore Current Radarr Binary if Current Ver. >= SPK Ver. . ${CONFIG_DIR}/KEEP_VAR if [ "$KEEP_CUR" == "yes" ]; then echo "Restoring Radarr version from before upgrade" >> ${INST_LOG} diff --git a/spk/sonarr/src/service-setup.sh b/spk/sonarr/src/service-setup.sh index 4deb247957b7..f02a919d9d25 100644 --- a/spk/sonarr/src/service-setup.sh +++ b/spk/sonarr/src/service-setup.sh @@ -1,5 +1,5 @@ PATH="${SYNOPKG_PKGDEST}/bin:${PATH}" -MONO_PATH="/usr/local/mono/bin" +MONO_PATH="${SYNOPKG_PKGDEST}/../mono/bin" MONO="${MONO_PATH}/mono" # Sonarr uses the home directory to store it's ".config" @@ -29,6 +29,11 @@ fi # Some have it stored in the root of package LEGACY_CONFIG_DIR="${SYNOPKG_PKGDEST}/.config" +# workaround for mono bug with armv5 (https://github.com/mono/mono/issues/12537) +if [ "$SYNOPKG_DSM_ARCH" == "88f8621" -o "$SYNOPKG_DSM_ARCH" == "88f8622" ]; then + MONO="MONO_ENV_OPTIONS='-O=-aot,-float32' ${MONO_PATH}/mono" +fi + GROUP="sc-download" LEGACY_GROUP="sc-media"