Explorar o código

swupdate.inc: fix '10-mongoose-args' usage of 'wwwdir' build constant

If 'wwwdir' is changed to '/usr/share/swupdate/www' for example,
the service configuration does not adapt and shows an empty page

Signed-off-by: Stefano Babic <stefano.babic@swupdate.org>
Signed-off-by: Adrian DC <radian.dc@gmail.com>
Adrian DC hai 2 meses
pai
achega
0390b97c09

+ 4 - 2
recipes-support/swupdate/swupdate.inc

@@ -38,7 +38,7 @@ SRC_URI = "git://github.com/sbabic/swupdate.git;protocol=https;branch=${SRCBRANC
     file://swupdate-usb@.service \
     file://swupdate-progress.service \
     file://tmpfiles-swupdate.conf \
-    file://10-mongoose-args \
+    file://10-mongoose-args.in \
     file://90-start-progress \
 "
 
@@ -294,7 +294,9 @@ do_install () {
     install -m 755 ${UNPACKDIR}/swupdate.sh ${D}${libdir}/swupdate
     sed -i 's#@LIBDIR@#${libdir}#g' ${D}${libdir}/swupdate/swupdate.sh
     if ${SWUPDATE_MONGOOSE}; then
-        install -m 644 ${UNPACKDIR}/10-mongoose-args ${D}${libdir}/swupdate/conf.d/
+        install -m 644 ${UNPACKDIR}/10-mongoose-args.in ${D}${libdir}/swupdate/conf.d/10-mongoose-args
+        sed -e "s#@@wwwdir@@#${wwwdir}#g" \
+            -i ${D}${libdir}/swupdate/conf.d/10-mongoose-args
     fi
     install -d ${D}${systemd_unitdir}/system
     install -m 644 ${UNPACKDIR}/swupdate.service ${D}${systemd_system_unitdir}

+ 0 - 1
recipes-support/swupdate/swupdate/10-mongoose-args

@@ -1 +0,0 @@
-SWUPDATE_WEBSERVER_ARGS="-r /www ${SWUPDATE_MONGOOSE_EXTRA_ARGS:--p 8080}"

+ 1 - 0
recipes-support/swupdate/swupdate/10-mongoose-args.in

@@ -0,0 +1 @@
+SWUPDATE_WEBSERVER_ARGS="-r @@wwwdir@@ ${SWUPDATE_MONGOOSE_EXTRA_ARGS:--p 8080}"