diff mbox series

[2/2,meta-swupdate] Support for web-app if choosen in defconfig

Message ID 1519228732-20082-2-git-send-email-sbabic@denx.de
State Accepted
Headers show
Series None | expand

Commit Message

Stefano Babic Feb. 21, 2018, 3:58 p.m. UTC
The swupdate-www package will be filled with the new web application
or with the legacy Website if the Mongoose server is set to compatibility.

Signed-off-by: Stefano Babic <sbabic@denx.de>
---
 recipes-support/swupdate/swupdate.inc | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/recipes-support/swupdate/swupdate.inc b/recipes-support/swupdate/swupdate.inc
index 7175848..6af320f 100644
--- a/recipes-support/swupdate/swupdate.inc
+++ b/recipes-support/swupdate/swupdate.inc
@@ -91,6 +91,8 @@  python () {
     if 'CONFIG_UBIVOL=y\n' in features:
         depends = d.getVar('DEPENDS', False)
         d.setVar('DEPENDS', depends + ' mtd-utils')
+    if 'CONFIG_MONGOOSE_WEB_API_V2=y\n' in features:
+        d.setVar('SWUPDATE_WWW', 'webapp')
 }
 
 do_configure () {
@@ -112,7 +114,11 @@  do_install () {
   install -m 0755 swupdate ${D}${bindir}/
 
   install -m 0755 -d ${D}/www
-  install -m 0755 ${S}www/* ${D}/www
+  if [ x${SWUPDATE_WWW} == "xwebapp" ];then
+	cp -R --no-dereference --preserve=mode,links -v ${S}examples/www/V2/* ${D}/www
+  else
+	install -m 0755 ${S}www/* ${D}/www
+  fi
 
   install -d ${D}${libdir}/
   install -d ${D}${includedir}/