@@ -189,4 +189,12 @@ $(error No Swupdate configuration file specified, check your BR2_PACKAGE_SWUPDAT
endif
endif
+ifeq ($(BR2_PACKAGE_SWUPDATE_INSTALL_WEBSITE),y)
+define SWUPDATE_INSTALL_INIT_SYSTEMD
+ $(INSTALL) -D -m 644 package/swupdate/swupdate.service \
+ $(TARGET_DIR)/usr/lib/systemd/system/swupdate.service
+ mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+endef
+endif
+
$(eval $(kconfig-package))
new file mode 100644
@@ -0,0 +1,17 @@
+[Unit]
+Description=SWUpdate daemon
+Documentation=https://github.com/sbabic/swupdate
+Documentation=https://sbabic.github.io/swupdate
+
+[Service]
+# Default environment variables in case /etc/default/swupdate isn't providing them
+Environment=SWU_POST_UPDATE_CMD="touch /tmp/.swu_complete"
+Environment=SWU_WEBSERVER_ARGS="-p 8080 -r /var/www/swupdate/"
+
+# Always take what is in the environment files when exists
+EnvironmentFile=/etc/default/swupdate
+
+ExecStart=/usr/bin/swupdate ${SWU_KEY_ARGS} -p ${SWU_POST_UPDATE_CMD} -v -L -w "${SWU_WEBSERVER_ARGS}"
+
+[Install]
+WantedBy=multi-user.target