diff mbox series

[meta-swupdate] Fix start of daemon in case of MULTILIB

Message ID 20200706163732.3824781-1-sbabic@denx.de
State Accepted
Headers show
Series [meta-swupdate] Fix start of daemon in case of MULTILIB | expand

Commit Message

Stefano Babic July 6, 2020, 4:37 p.m. UTC
In case of multilib, swupdate.sh is put on /usr/lib64 instead of
/usr/lib. Replace the path during the install.

Signed-off-by: Stefano Babic <sbabic@denx.de>
---
 recipes-support/swupdate/swupdate.inc              | 2 ++
 recipes-support/swupdate/swupdate/swupdate.service | 2 +-
 recipes-support/swupdate/swupdate/swupdate.sh      | 4 ++--
 3 files changed, 5 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/recipes-support/swupdate/swupdate.inc b/recipes-support/swupdate/swupdate.inc
index 9ea0a8a..18c9919 100644
--- a/recipes-support/swupdate/swupdate.inc
+++ b/recipes-support/swupdate/swupdate.inc
@@ -216,11 +216,13 @@  do_install () {
     # shell based configuration loader allows to place code snippets into this folder
     install -d ${D}${libdir}/swupdate/conf.d
     install -m 755 ${WORKDIR}/swupdate.sh ${D}${libdir}/swupdate
+    sed -i 's#@LIBDIR@#${libdir}#g' ${D}${libdir}/swupdate/swupdate.sh
     if ${SWUPDATE_MONGOOSE}; then
         install -m 644 ${WORKDIR}/10-mongoose-args ${D}${libdir}/swupdate/conf.d/
     fi
     install -d ${D}${systemd_unitdir}/system
     install -m 644 ${WORKDIR}/swupdate.service ${D}${systemd_system_unitdir}
+    sed -i 's#@LIBDIR@#${libdir}#' ${D}${systemd_system_unitdir}/swupdate.service
     install -m 644 ${WORKDIR}/swupdate.socket.tmpl ${D}${systemd_system_unitdir}/swupdate.socket
     sed -e "s,@@SWUPDATE_SOCKET_CTRL_PATH@@,${SWUPDATE_SOCKET_CTRL_PATH},g" \
         -e "s,@@SWUPDATE_SOCKET_PROGRESS_PATH@@,${SWUPDATE_SOCKET_PROGRESS_PATH},g" \
diff --git a/recipes-support/swupdate/swupdate/swupdate.service b/recipes-support/swupdate/swupdate/swupdate.service
index a3d8d19..7f36619 100644
--- a/recipes-support/swupdate/swupdate/swupdate.service
+++ b/recipes-support/swupdate/swupdate/swupdate.service
@@ -4,7 +4,7 @@  Documentation=https://github.com/sbabic/swupdate
 Documentation=https://sbabic.github.io/swupdate
 
 [Service]
-ExecStart=/usr/lib/swupdate/swupdate.sh
+ExecStart=@LIBDIR@/swupdate/swupdate.sh
 KillMode=mixed
 
 [Install]
diff --git a/recipes-support/swupdate/swupdate/swupdate.sh b/recipes-support/swupdate/swupdate/swupdate.sh
index 8798e2d..c7cc505 100644
--- a/recipes-support/swupdate/swupdate/swupdate.sh
+++ b/recipes-support/swupdate/swupdate/swupdate.sh
@@ -8,11 +8,11 @@  SWUPDATE_SURICATTA_ARGS=""
 
 # source all files from /etc/swupdate/conf.d and /usr/lib/swupdate/conf.d/
 # A file found in /etc replaces the same file in /usr
-for f in `(test -d /usr/lib/swupdate/conf.d/ && ls -1 /usr/lib/swupdate/conf.d/; test -d /etc/swupdate/conf.d && ls -1 /etc/swupdate/conf.d) | sort -u`; do
+for f in `(test -d @LIBDIR@/swupdate/conf.d/ && ls -1 @LIBDIR@/swupdate/conf.d/; test -d /etc/swupdate/conf.d && ls -1 /etc/swupdate/conf.d) | sort -u`; do
   if [ -f /etc/swupdate/conf.d/$f ]; then
     . /etc/swupdate/conf.d/$f
   else
-    . /usr/lib/swupdate/conf.d/$f
+    . @LIBDIR@/swupdate/conf.d/$f
   fi
 done