diff mbox series

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

Message ID 20260220200939.4022679-1-radian.dc@gmail.com
State Accepted
Headers show
Series swupdate.inc: fix '10-mongoose-args' usage of 'wwwdir' build constant | expand

Commit Message

Adrian DC Feb. 20, 2026, 8:09 p.m. UTC
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: Adrian DC <radian.dc@gmail.com>
---
 recipes-support/swupdate/swupdate.inc                 | 6 ++++--
 recipes-support/swupdate/swupdate/10-mongoose-args    | 1 -
 recipes-support/swupdate/swupdate/10-mongoose-args.in | 1 +
 3 files changed, 5 insertions(+), 3 deletions(-)
 delete mode 100644 recipes-support/swupdate/swupdate/10-mongoose-args
 create mode 100644 recipes-support/swupdate/swupdate/10-mongoose-args.in

Comments

Stefano Babic March 20, 2026, 1:45 p.m. UTC | #1
On 2/20/26 21:09, Adrian DC wrote:
> 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: Adrian DC <radian.dc@gmail.com>
> ---
>   recipes-support/swupdate/swupdate.inc                 | 6 ++++--
>   recipes-support/swupdate/swupdate/10-mongoose-args    | 1 -
>   recipes-support/swupdate/swupdate/10-mongoose-args.in | 1 +
>   3 files changed, 5 insertions(+), 3 deletions(-)
>   delete mode 100644 recipes-support/swupdate/swupdate/10-mongoose-args
>   create mode 100644 recipes-support/swupdate/swupdate/10-mongoose-args.in
> 
> diff --git a/recipes-support/swupdate/swupdate.inc b/recipes-support/swupdate/swupdate.inc
> index cb39134..6909ad3 100644
> --- a/recipes-support/swupdate/swupdate.inc
> +++ b/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 \
>   "
>   
> @@ -295,7 +295,9 @@ do_install () {
>       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/
> +        install -m 644 ${WORKDIR}/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 ${WORKDIR}/swupdate.service ${D}${systemd_system_unitdir}
> diff --git a/recipes-support/swupdate/swupdate/10-mongoose-args b/recipes-support/swupdate/swupdate/10-mongoose-args
> deleted file mode 100644
> index 896e66b..0000000
> --- a/recipes-support/swupdate/swupdate/10-mongoose-args
> +++ /dev/null
> @@ -1 +0,0 @@
> -SWUPDATE_WEBSERVER_ARGS="-r /www ${SWUPDATE_MONGOOSE_EXTRA_ARGS:--p 8080}"
> diff --git a/recipes-support/swupdate/swupdate/10-mongoose-args.in b/recipes-support/swupdate/swupdate/10-mongoose-args.in
> new file mode 100644
> index 0000000..a2ca1a6
> --- /dev/null
> +++ b/recipes-support/swupdate/swupdate/10-mongoose-args.in
> @@ -0,0 +1 @@
> +SWUPDATE_WEBSERVER_ARGS="-r @@wwwdir@@ ${SWUPDATE_MONGOOSE_EXTRA_ARGS:--p 8080}"

Applied to -scarthgap.

Adjusted and then applied to whinlatter and master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/recipes-support/swupdate/swupdate.inc b/recipes-support/swupdate/swupdate.inc
index cb39134..6909ad3 100644
--- a/recipes-support/swupdate/swupdate.inc
+++ b/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 \
 "
 
@@ -295,7 +295,9 @@  do_install () {
     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/
+        install -m 644 ${WORKDIR}/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 ${WORKDIR}/swupdate.service ${D}${systemd_system_unitdir}
diff --git a/recipes-support/swupdate/swupdate/10-mongoose-args b/recipes-support/swupdate/swupdate/10-mongoose-args
deleted file mode 100644
index 896e66b..0000000
--- a/recipes-support/swupdate/swupdate/10-mongoose-args
+++ /dev/null
@@ -1 +0,0 @@ 
-SWUPDATE_WEBSERVER_ARGS="-r /www ${SWUPDATE_MONGOOSE_EXTRA_ARGS:--p 8080}"
diff --git a/recipes-support/swupdate/swupdate/10-mongoose-args.in b/recipes-support/swupdate/swupdate/10-mongoose-args.in
new file mode 100644
index 0000000..a2ca1a6
--- /dev/null
+++ b/recipes-support/swupdate/swupdate/10-mongoose-args.in
@@ -0,0 +1 @@ 
+SWUPDATE_WEBSERVER_ARGS="-r @@wwwdir@@ ${SWUPDATE_MONGOOSE_EXTRA_ARGS:--p 8080}"