Skip to contentSkip to conversation

package/swupdate: new package

PATCH Superseded Jörg Krause 4 participants 8 messages Apr 21, 2015 – Apr 22, 2015

v3 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 package/swupdate: new package

This patch is based on an WIP version submitted by Romain Naour, commented by Arnout Vandecappelle:
https://patchwork.ozlabs.org/patch/401270/

This package provides a default configuration with all external dependencies enabled. This is necessary because upstream does not detect which dependencies are available. Furthermore, upstream does not implement a savedefconfig target.

Note that swupdate provides its own customized version of mongoose and lsqlite3.

swupdate provides a default website which can be installed to the target to enable firmware update with a browser. This patch adds the user option to install this website.

Cc Romain Naour <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Arnout Vandecappelle <[email protected]>

---
Changes v2 -> v3:
- bump to latest commit d7753be4fd8bdf2ba4ba56ee869550663b2cca80
- enable all dependencies (Arnout)
- rewrite help text for configuration file
- add option to install default website

Changes v1 -> v2:
- bump to latest commit d9f58b5a3263b1b00c6d011cd8cdd65e69890b46
- update Sob email address

---
 package/Config.in                                  |  1 +
 package/swupdate/Config.in                         | 42 +++++++++++
 ...wupdate-0001-Add-missing-header-for-off_t.patch | 25 +++++++
 package/swupdate/swupdate.config                   | 82 ++++++++++++++++++++++
 package/swupdate/swupdate.mk                       | 62 ++++++++++++++++
 5 files changed, 212 insertions(+)
 create mode 100644 package/swupdate/Config.in
 create mode 100644 package/swupdate/swupdate-0001-Add-missing-header-for-off_t.patch
 create mode 100644 package/swupdate/swupdate.config
 create mode 100644 package/swupdate/swupdate.mk
package/Config.in +1 -0
index 319f01a..9ffd9b6 100644
@@ -1402,6 +1402,7 @@ if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 	source "package/start-stop-daemon/Config.in"
 endif
 	source "package/supervisor/Config.in"
+	source "package/swupdate/Config.in"
 if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 	source "package/sysklogd/Config.in"
 endif
package/swupdate/Config.in new file +42 -0

42 lines not on this page · raw message

package/swupdate/swupdate-0001-Add-missing-header-for-off_t.patch new file +25 -0
new file mode 100644
index 0000000..4be0f7b
@@ -0,0 +1,25 @@
+From 4e382373cad64ca7e183336e33b72c53cfeed340 Mon Sep 17 00:00:00 2001
+From: Romain Naour <[email protected]>
+Date: Sun, 7 Sep 2014 17:31:09 +0200
+Subject: [PATCH 1/1] Add missing header for off_t
+
+Signed-off-by: Romain Naour <[email protected]>
+---
+ include/swupdate.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/include/swupdate.h b/include/swupdate.h
+index 78b7f85..c193397 100644
+--- a/include/swupdate.h
++++ b/include/swupdate.h
+@@ -23,6 +23,7 @@
+ #ifndef _SWUPDATE_H
+ #define _SWUPDATE_H
+ 
++#include <sys/types.h>
+ #include <sys/queue.h>
+ #include "flash.h"
+ #include "globals.h"
+-- 
+1.9.3
+
package/swupdate/swupdate.config new file +82 -0

82 lines not on this page · raw message

package/swupdate/swupdate.mk new file +62 -0

62 lines not on this page · raw message

Signature · 1 line
2.3.5
#1 lore raw

PATCH v3 1/1 package/swupdate: new package

This now depends on lua, which is an optional dependency for swupdate (I don't use it).

Mike

Quoted 298 lines · J?rg Krause

This patch is based on an WIP version submitted by Romain Naour, commented by Arnout Vandecappelle:
https://patchwork.ozlabs.org/patch/401270/

This package provides a default configuration with all external dependencies enabled. This is necessary because upstream does not detect which dependencies are available. Furthermore, upstream does not implement a savedefconfig target.

Note that swupdate provides its own customized version of mongoose and lsqlite3.

swupdate provides a default website which can be installed to the target to enable firmware update with a browser. This patch adds the user option to install this website.

Cc Romain Naour <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Arnout Vandecappelle <[email protected]>

---
Changes v2 -> v3:
- bump to latest commit d7753be4fd8bdf2ba4ba56ee869550663b2cca80
- enable all dependencies (Arnout)
- rewrite help text for configuration file
- add option to install default website

Changes v1 -> v2:
- bump to latest commit d9f58b5a3263b1b00c6d011cd8cdd65e69890b46
- update Sob email address

---
 package/Config.in                                  |  1 +
 package/swupdate/Config.in                         | 42 +++++++++++
 ...wupdate-0001-Add-missing-header-for-off_t.patch | 25 +++++++
 package/swupdate/swupdate.config                   | 82 ++++++++++++++++++++++
 package/swupdate/swupdate.mk                       | 62 ++++++++++++++++
 5 files changed, 212 insertions(+)
 create mode 100644 package/swupdate/Config.in
 create mode 100644 package/swupdate/swupdate-0001-Add-missing-header-for-off_t.patch
 create mode 100644 package/swupdate/swupdate.config
 create mode 100644 package/swupdate/swupdate.mk
package/Config.in +1 -0
index 319f01a..9ffd9b6 100644
@@ -1402,6 +1402,7 @@ if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
        source "package/start-stop-daemon/Config.in"
 endif
        source "package/supervisor/Config.in"
+       source "package/swupdate/Config.in"
 if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
        source "package/sysklogd/Config.in"
 endif
package/swupdate/Config.in new file +42 -0
new file mode 100644
index 0000000..6e86ee9
@@ -0,0 +1,42 @@
+config BR2_PACKAGE_SWUPDATE
+       bool "swupdate"
+       depends on BR2_TOOLCHAIN_HAS_THREADS # OpenSSL
+       depends on BR2_PACKAGE_LUA_5_2
+       select BR2_PACKAGE_LIBCONFIG
+       select BR2_PACKAGE_LIBCURL
+       select BR2_PACKAGE_MTD
+       select BR2_PACKAGE_OPENSSL
+       select BR2_PACKAGE_ZLIB
+       help
+         swupdate provides a reliable way to update the software on an
+         embedded system.
+
+         https://github.com/sbabic/swupdate.git
+
+if BR2_PACKAGE_SWUPDATE
+
+config BR2_PACKAGE_SWUPDATE_CONFIG
+       string "swupdate configuration file"
+       default "package/swupdate/swupdate.config"
+       help
+         The default swupdate configuration file will enable swupdate with
+         an image downloader, a webserver, and lua support, as well as
+         handlers for UBI volumes, raw NAND or NOR flash, SD cards, shell
+         scripts, and the U-Boot bootloader environment.
+
+         Most people will just use the default swupdate configuration file.
+         However, some people may wish to use their own modified swupdate
+         configuration file, and will specify their config file location
+         with this option.
+
+config BR2_PACKAGE_SWUPDATE_INSTALL_WEBSITE
+       bool "install default website"
+       help
+         Install the provided website to /var/www/swupdate.
+endif
+
+comment "swupate support needs toolchain w/ threads"
+       depends on !BR2_TOOLCHAIN_HAS_THREADS
+
+comment "swupate needs a Lua 5.2 interpreter"
+       depends on !BR2_PACKAGE_LUA_5_2
package/swupdate/swupdate-0001-Add-missing-header-for-off_t.patch new file +25 -0
new file mode 100644
index 0000000..4be0f7b
@@ -0,0 +1,25 @@
+From 4e382373cad64ca7e183336e33b72c53cfeed340 Mon Sep 17 00:00:00 2001
+From: Romain Naour <[email protected]>
+Date: Sun, 7 Sep 2014 17:31:09 +0200
+Subject: [PATCH 1/1] Add missing header for off_t
+
+Signed-off-by: Romain Naour <[email protected]>
+---
+ include/swupdate.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/include/swupdate.h b/include/swupdate.h
+index 78b7f85..c193397 100644
+--- a/include/swupdate.h
++++ b/include/swupdate.h
+@@ -23,6 +23,7 @@
+ #ifndef _SWUPDATE_H
+ #define _SWUPDATE_H
+
++#include <sys/types.h>
+ #include <sys/queue.h>
+ #include "flash.h"
+ #include "globals.h"
+--
+1.9.3
+
package/swupdate/swupdate.config new file +82 -0
new file mode 100644
index 0000000..cb75998
@@ -0,0 +1,82 @@
+#
+# Automatically generated make config: don't edit
+# swupdate version: 2014.07.0
+# Tue Apr 21 01:42:29 2015
+#
+CONFIG_HAVE_DOT_CONFIG=y
+
+#
+# Swupdate Settings
+#
+
+#
+# General Configuration
+#
+CONFIG_SCRIPTS=y
+# CONFIG_HW_COMPATIBILITY is not set
+CONFIG_HW_COMPATIBILITY_FILE=""
+CONFIG_LUA=y
+# CONFIG_FEATURE_SYSLOG is not set
+
+#
+# Build Options
+#
+# CONFIG_STATIC is not set
+CONFIG_CROSS_COMPILER_PREFIX=""
+CONFIG_SYSROOT=""
+CONFIG_EXTRA_CFLAGS=""
+CONFIG_EXTRA_LDFLAGS=""
+CONFIG_EXTRA_LDLIBS=""
+
+#
+# Debugging Options
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PESSIMIZE is not set
+# CONFIG_WERROR is not set
+# CONFIG_NOCLEANUP is not set
+CONFIG_DOWNLOAD=y
+CONFIG_WEBSERVER=y
+
+#
+# Webserver Features
+#
+CONFIG_MONGOOSE=y
+
+#
+# Mongoose Feature
+#
+CONFIG_MONGOOSELUA=y
+# CONFIG_MONGOOSESQL is not set
+CONFIG_MONGOOSEIPV6=y
+CONFIG_MONGOOSESSL=y
+
+#
+# Archival Features
+#
+CONFIG_CPIO=y
+CONFIG_GUNZIP=y
+
+#
+# Parser Features
+#
+CONFIG_LIBCONFIG=y
+CONFIG_LUAEXTERNAL=y
+# CONFIG_SETEXTPARSERNAME is not set
+CONFIG_EXTPARSERNAME=""
+# CONFIG_SETSWDESCRIPTION is not set
+CONFIG_SWDESCRIPTION=""
+
+#
+# Image Handlers
+#
+CONFIG_UBIVOL=y
+CONFIG_UBIBLACKLIST=""
+CONFIG_UBIVIDOFFSET=0
+CONFIG_CFI=y
+CONFIG_RAW=y
+CONFIG_LUASCRIPTHANDLER=y
+CONFIG_SHELLSCRIPTHANDLER=y
+CONFIG_HANDLER_IN_LUA=y
+CONFIG_UBOOT=y
+CONFIG_UBOOT_FWENV="/etc/fw_env.config"
package/swupdate/swupdate.mk new file +62 -1
new file mode 100644
index 0000000..c78092a
@@ -0,0 +1,62 @@
+################################################################################
+#
+# swupdate
+#
+################################################################################
+
+# Choose latest commit instead of release 2014.07 for getting bug fixes and
+# image downloading feature
+SWUPDATE_VERSION = 8f59c21a07a99b94b53ab9ae3579cd2014b3cedc
+SWUPDATE_SITE = $(call github,sbabic,swupdate,$(SWUPDATE_VERSION))
+SWUPDATE_LICENSE = GPLv2+
+SWUPDATE_LICENSE_FILES = COPYING
+
+# swupdate bundles its own mongoose and lsqlite3 versions
+SWUPDATE_DEPENDENCIES = libconfig libcurl lua mtd openssl zlib
+
+SWUPDATE_BUILD_CONFIG = $(SWUPDATE_DIR)/.config
+
+SWUPDATE_KCONFIG_FILE = $(call qstrip,$(BR2_PACKAGE_SWUPDATE_CONFIG))
+SWUPDATE_KCONFIG_EDITORS = menuconfig xconfig gconfig
+
+SWUPDATE_CFLAGS = $(TARGET_CFLAGS)
+SWUPDATE_LDFLAGS = $(TARGET_LDFLAGS)
+SWUPDATE_LDLIBS =
+
+# If we're using static libs do the same for swupdate
+ifeq ($(BR2_PREFER_STATIC_LIB),y)
+define SWUPDATE_PREFER_STATIC
+       $(call KCONFIG_ENABLE_OPT,CONFIG_STATIC,$(SWUPDATE_BUILD_CONFIG))
+endef
+endif
+
+define SWUPDATE_BUILD_OPTIONS
+       $(call KCONFIG_SET_OPT,CONFIG_CROSS_COMPILER_PREFIX,"$(TARGET_CROSS)", \
+               $(SWUPDATE_BUILD_CONFIG))
+       $(call KCONFIG_SET_OPT,CONFIG_SYSROOT,"$(SYSROOT_DIR)", \
+               $(SWUPDATE_BUILD_CONFIG))
+       $(call KCONFIG_SET_OPT,CONFIG_EXTRA_CFLAGS,"$(SWUPDATE_CFLAGS)", \
+               $(SWUPDATE_BUILD_CONFIG))
+       $(call KCONFIG_SET_OPT,CONFIG_EXTRA_LDFLAGS,"$(SWUPDATE_LDFLAGS)", \
+               $(SWUPDATE_BUILD_CONFIG))
+       $(call KCONFIG_SET_OPT,CONFIG_EXTRA_LDLIBS,"$(SWUPDATE_LDLIBS)", \
+               $(SWUPDATE_BUILD_CONFIG))
+endef
+
+define SWUPDATE_KCONFIG_FIXUP_CMDS
+       $(SWUPDATE_PREFER_STATIC)
+       $(SWUPDATE_BUILD_OPTIONS)
+endef
+
+define SWUPDATE_BUILD_CMDS
+       $(MAKE) -C $(@D)
+endef
+
+define SWUPDATE_INSTALL_TARGET_CMDS
+       $(INSTALL) -D -m 0755 $(@D)/swupdate $(TARGET_DIR)/usr/bin/swupdate
+       $(if $(BR2_PACKAGE_SWUPDATE_INSTALL_WEBSITE), \
+               mkdir -p $(TARGET_DIR)/var/www/swupdate; \
+               cp -dpf $(@D)/www/* $(TARGET_DIR)/var/www/swupdate)
+endef
+
+$(eval $(kconfig-package))
--

2.3.5

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#2 lore raw

PATCH v3 1/1 package/swupdate: new package

Hi Mike,

Quoted 2 lines · Mike Williams

This now depends on lua, which is an optional dependency for swupdate (I don't use it).

This was suggested by Arnout to reduce the configuration complexity:
https://patchwork.ozlabs.org/patch/451763/

J?rg

#3 lore raw

PATCH v3 1/1 package/swupdate: new package

Quoted 8 lines · J?rg Krause

Hi Mike,

Quoted 2 lines · Mike Williams

This now depends on lua, which is an optional dependency for swupdate (I don't use it).

This was suggested by Arnout to reduce the configuration complexity:
https://patchwork.ozlabs.org/patch/451763/

The idea is to have *some* swupdate support in buildroot now, and we can still
improve it later.

So a follow-up patch that gets rid of lua is certainly welcome!

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#4 lore raw

PATCH v3 1/1 package/swupdate: new package

In reply to Jörg Krause
Quoted 62 lines · J?rg Krause

This patch is based on an WIP version submitted by Romain Naour, commented by Arnout Vandecappelle:
https://patchwork.ozlabs.org/patch/401270/

This package provides a default configuration with all external dependencies enabled. This is necessary because upstream does not detect which dependencies are available. Furthermore, upstream does not implement a savedefconfig target.

Note that swupdate provides its own customized version of mongoose and lsqlite3.

swupdate provides a default website which can be installed to the target to enable firmware update with a browser. This patch adds the user option to install this website.

Cc Romain Naour <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Arnout Vandecappelle <[email protected]>

---
Changes v2 -> v3:
- bump to latest commit d7753be4fd8bdf2ba4ba56ee869550663b2cca80
- enable all dependencies (Arnout)
- rewrite help text for configuration file
- add option to install default website

Changes v1 -> v2:
- bump to latest commit d9f58b5a3263b1b00c6d011cd8cdd65e69890b46
- update Sob email address

---
 package/Config.in                                  |  1 +
 package/swupdate/Config.in                         | 42 +++++++++++
 ...wupdate-0001-Add-missing-header-for-off_t.patch | 25 +++++++
 package/swupdate/swupdate.config                   | 82 ++++++++++++++++++++++
 package/swupdate/swupdate.mk                       | 62 ++++++++++++++++
 5 files changed, 212 insertions(+)
 create mode 100644 package/swupdate/Config.in
 create mode 100644 package/swupdate/swupdate-0001-Add-missing-header-for-off_t.patch
 create mode 100644 package/swupdate/swupdate.config
 create mode 100644 package/swupdate/swupdate.mk
package/Config.in +1 -0
index 319f01a..9ffd9b6 100644
@@ -1402,6 +1402,7 @@ if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 	source "package/start-stop-daemon/Config.in"
 endif
 	source "package/supervisor/Config.in"
+	source "package/swupdate/Config.in"
 if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 	source "package/sysklogd/Config.in"
 endif
package/swupdate/Config.in new file +0 -0
new file mode 100644
index 0000000..6e86ee9

package/swupdate/Config.in line 4

Quoted 4 lines
package/swupdate/Config.in new file +4 -0
@@ -0,0 +1,42 @@
+config BR2_PACKAGE_SWUPDATE
+	bool "swupdate"
+	depends on BR2_TOOLCHAIN_HAS_THREADS # OpenSSL
+	depends on BR2_PACKAGE_LUA_5_2

Yikes, now I see this dependency so explicitly, it does look kind of scary...

Maybe it's a better idea to not support lua at all instead.

How big a difference does it make in rootfs size?

What do you think, Joerg? Romain? Others?

Quoted 44 lines
package/swupdate/Config.in new file +38 -0
+	select BR2_PACKAGE_LIBCONFIG
+	select BR2_PACKAGE_LIBCURL
+	select BR2_PACKAGE_MTD
+	select BR2_PACKAGE_OPENSSL
+	select BR2_PACKAGE_ZLIB
+	help
+	  swupdate provides a reliable way to update the software on an
+	  embedded system.
+
+	  https://github.com/sbabic/swupdate.git
+
+if BR2_PACKAGE_SWUPDATE
+
+config BR2_PACKAGE_SWUPDATE_CONFIG
+	string "swupdate configuration file"
+	default "package/swupdate/swupdate.config"
+	help
+	  The default swupdate configuration file will enable swupdate with
+	  an image downloader, a webserver, and lua support, as well as
+	  handlers for UBI volumes, raw NAND or NOR flash, SD cards, shell
+	  scripts, and the U-Boot bootloader environment.
+
+	  Most people will just use the default swupdate configuration file.
+	  However, some people may wish to use their own modified swupdate
+	  configuration file, and will specify their config file location
+	  with this option.
+
+config BR2_PACKAGE_SWUPDATE_INSTALL_WEBSITE
+	bool "install default website"
+	help
+	  Install the provided website to /var/www/swupdate.
+endif
+
+comment "swupate support needs toolchain w/ threads"
+	depends on !BR2_TOOLCHAIN_HAS_THREADS
+
+comment "swupate needs a Lua 5.2 interpreter"
+	depends on !BR2_PACKAGE_LUA_5_2
package/swupdate/swupdate-0001-Add-missing-header-for-off_t.patch new file +0 -0
new file mode 100644
index 0000000..4be0f7b

package/swupdate/swupdate-0001-Add-missing-header-for-off_t.patch line 6

Quoted 6 lines
package/swupdate/swupdate-0001-Add-missing-header-for-off_t.patch new file +6 -0
@@ -0,0 +1,25 @@
+From 4e382373cad64ca7e183336e33b72c53cfeed340 Mon Sep 17 00:00:00 2001
+From: Romain Naour <[email protected]>
+Date: Sun, 7 Sep 2014 17:31:09 +0200
+Subject: [PATCH 1/1] Add missing header for off_t
+
+Signed-off-by: Romain Naour <[email protected]>

What's the upstream status of this? Stefan is normally pretty reactive...

Quoted 25 lines
package/swupdate/swupdate-0001-Add-missing-header-for-off_t.patch new file +19 -0
+---
+ include/swupdate.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/include/swupdate.h b/include/swupdate.h
+index 78b7f85..c193397 100644
+--- a/include/swupdate.h
++++ b/include/swupdate.h
+@@ -23,6 +23,7 @@
+ #ifndef _SWUPDATE_H
+ #define _SWUPDATE_H
+ 
++#include <sys/types.h>
+ #include <sys/queue.h>
+ #include "flash.h"
+ #include "globals.h"
+-- 
+1.9.3
+
package/swupdate/swupdate.config new file +0 -0
new file mode 100644
index 0000000..cb75998
@@ -0,0 +1,82 @@

[snip]

package/swupdate/swupdate.config line 82

Quoted 2 lines
package/swupdate/swupdate.config new file +2 -0
+CONFIG_UBOOT=y
+CONFIG_UBOOT_FWENV="/etc/fw_env.config"

Does it still work correctly if fw_env.config is not installed on the target?
Probably not... So I think this should be mentioned in the help text.

Quoted 6 lines
package/swupdate/swupdate.mk new file +0 -0
new file mode 100644
index 0000000..c78092a

package/swupdate/swupdate.mk line 8

Quoted 8 lines
package/swupdate/swupdate.mk new file +8 -0
@@ -0,0 +1,62 @@
+################################################################################
+#
+# swupdate
+#
+################################################################################
+
+# Choose latest commit instead of release 2014.07 for getting bug fixes and
+# image downloading feature

This type of comment should be in the commit message, not in the .mk file.

package/swupdate/swupdate.mk line 17

Quoted 9 lines
package/swupdate/swupdate.mk new file +9 -0
+SWUPDATE_VERSION = 8f59c21a07a99b94b53ab9ae3579cd2014b3cedc
+SWUPDATE_SITE = $(call github,sbabic,swupdate,$(SWUPDATE_VERSION))
+SWUPDATE_LICENSE = GPLv2+
+SWUPDATE_LICENSE_FILES = COPYING
+
+# swupdate bundles its own mongoose and lsqlite3 versions
+SWUPDATE_DEPENDENCIES = libconfig libcurl lua mtd openssl zlib
+
+SWUPDATE_BUILD_CONFIG = $(SWUPDATE_DIR)/.config

In linux.mk we directly use $(@D)/.config, which is IMHO clearer than adding an
extra variable.

package/swupdate/swupdate.mk line 20

Quoted 3 lines
package/swupdate/swupdate.mk new file +3 -0
+
+SWUPDATE_KCONFIG_FILE = $(call qstrip,$(BR2_PACKAGE_SWUPDATE_CONFIG))
+SWUPDATE_KCONFIG_EDITORS = menuconfig xconfig gconfig

No nconfig?

package/swupdate/swupdate.mk line 24

Quoted 4 lines
package/swupdate/swupdate.mk new file +4 -0
+
+SWUPDATE_CFLAGS = $(TARGET_CFLAGS)
+SWUPDATE_LDFLAGS = $(TARGET_LDFLAGS)
+SWUPDATE_LDLIBS =

These are redundant, just use the appropriate variables directly below.

package/swupdate/swupdate.mk line 26

Quoted 2 lines
package/swupdate/swupdate.mk new file +2 -0
+
+# If we're using static libs do the same for swupdate

This comment is redundant.

package/swupdate/swupdate.mk line 33

Quoted 7 lines
package/swupdate/swupdate.mk new file +7 -0
+ifeq ($(BR2_PREFER_STATIC_LIB),y)
+define SWUPDATE_PREFER_STATIC
+	$(call KCONFIG_ENABLE_OPT,CONFIG_STATIC,$(SWUPDATE_BUILD_CONFIG))
+endef
+endif
+
+define SWUPDATE_BUILD_OPTIONS

Better name would be _SET_BUILD_OPTIONS.

package/swupdate/swupdate.mk line 36

Quoted 3 lines
package/swupdate/swupdate.mk new file +3 -0
+	$(call KCONFIG_SET_OPT,CONFIG_CROSS_COMPILER_PREFIX,"$(TARGET_CROSS)", \
+		$(SWUPDATE_BUILD_CONFIG))
+	$(call KCONFIG_SET_OPT,CONFIG_SYSROOT,"$(SYSROOT_DIR)", \

SYSROOT_DIR doesn't exist, you probably meant STAGING_DIR.

Quoted 6 lines
package/swupdate/swupdate.mk new file +6 -0
+		$(SWUPDATE_BUILD_CONFIG))
+	$(call KCONFIG_SET_OPT,CONFIG_EXTRA_CFLAGS,"$(SWUPDATE_CFLAGS)", \
+		$(SWUPDATE_BUILD_CONFIG))
+	$(call KCONFIG_SET_OPT,CONFIG_EXTRA_LDFLAGS,"$(SWUPDATE_LDFLAGS)", \
+		$(SWUPDATE_BUILD_CONFIG))
+	$(call KCONFIG_SET_OPT,CONFIG_EXTRA_LDLIBS,"$(SWUPDATE_LDLIBS)", \

package/swupdate/swupdate.mk line 52

Quoted 10 lines
package/swupdate/swupdate.mk new file +10 -0
+		$(SWUPDATE_BUILD_CONFIG))
+endef
+
+define SWUPDATE_KCONFIG_FIXUP_CMDS
+	$(SWUPDATE_PREFER_STATIC)
+	$(SWUPDATE_BUILD_OPTIONS)
+endef
+
+define SWUPDATE_BUILD_CMDS
+	$(MAKE) -C $(@D)

You should at least pass $(TARGET_MAKE_ENV) as well.

Regards,
Arnout

Quoted 11 lines
package/swupdate/swupdate.mk new file +10 -0
+endef
+
+define SWUPDATE_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/swupdate $(TARGET_DIR)/usr/bin/swupdate
+	$(if $(BR2_PACKAGE_SWUPDATE_INSTALL_WEBSITE), \
+		mkdir -p $(TARGET_DIR)/var/www/swupdate; \
+		cp -dpf $(@D)/www/* $(TARGET_DIR)/var/www/swupdate)
+endef
+
+$(eval $(kconfig-package))
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#5 lore raw

PATCH v3 1/1 package/swupdate: new package

Quoted 41 lines · Arnout Vandecappelle
Quoted 40 lines · J?rg Krause

This patch is based on an WIP version submitted by Romain Naour, commented by
Arnout Vandecappelle:
https://patchwork.ozlabs.org/patch/401270/

This package provides a default configuration with all external dependencies
enabled. This is necessary because upstream does not detect which dependencies
are available. Furthermore, upstream does not implement a savedefconfig target.

Note that swupdate provides its own customized version of mongoose and
lsqlite3.

swupdate provides a default website which can be installed to the target to
enable firmware update with a browser. This patch adds the user option to
install this website.

Cc Romain Naour <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Arnout Vandecappelle <[email protected]>

---
Changes v2 -> v3:
- bump to latest commit d7753be4fd8bdf2ba4ba56ee869550663b2cca80
- enable all dependencies (Arnout)
- rewrite help text for configuration file
- add option to install default website

Changes v1 -> v2:
- bump to latest commit d9f58b5a3263b1b00c6d011cd8cdd65e69890b46
- update Sob email address

---

[snip]

Quoted 11 lines

package/swupdate/Config.in line 4

Quoted 7 lines
package/swupdate/Config.in new file +4 -0
@@ -0,0 +1,42 @@
+config BR2_PACKAGE_SWUPDATE
+   bool "swupdate"
+   depends on BR2_TOOLCHAIN_HAS_THREADS # OpenSSL
+   depends on BR2_PACKAGE_LUA_5_2

Yikes, now I see this dependency so explicitly, it does look kind
of scary...

Quoted 3 lines

Maybe it's a better idea to not support lua at all instead.

How big a difference does it make in rootfs size?

Enabling lua adds 30KB for Lua 5.2 and 20KB for swupdate to rootfs.tar.

Quoted 1 line

What do you think, Joerg? Romain? Others?

The additional 50KB are neglectable for me. What I don't like is that I I have to select Lua 5.2 first to be able to select swupdate.

How about removing lua support from the default config and adding a check "ifeq($(BR2_PACKAGE_LUA_5_2),y)" which enables all lua features in swupdate.

Quoted 57 lines
Quoted 57 lines
package/swupdate/Config.in new file +7 -0
+   select BR2_PACKAGE_LIBCONFIG
+   select BR2_PACKAGE_LIBCURL
+   select BR2_PACKAGE_MTD
+   select BR2_PACKAGE_OPENSSL
+   select BR2_PACKAGE_ZLIB
+   help
+     swupdate provides a reliable way to update the software 

on an

package/swupdate/Config.in new file +11 -0
+     embedded system.
+
+     https://github.com/sbabic/swupdate.git
+
+if BR2_PACKAGE_SWUPDATE
+
+config BR2_PACKAGE_SWUPDATE_CONFIG
+   string "swupdate configuration file"
+   default "package/swupdate/swupdate.config"
+   help
+     The default swupdate configuration file will enable 

swupdate with
+ an image downloader, a webserver, and lua support, as
well as
+ handlers for UBI volumes, raw NAND or NOR flash, SD
cards, shell

package/swupdate/Config.in new file +3 -0
+     scripts, and the U-Boot bootloader environment.
+
+     Most people will just use the default swupdate 

configuration file.
+ However, some people may wish to use their own modified
swupdate
+ configuration file, and will specify their config file
location

package/swupdate/Config.in new file +13 -0
+     with this option.
+
+config BR2_PACKAGE_SWUPDATE_INSTALL_WEBSITE
+   bool "install default website"
+   help
+     Install the provided website to /var/www/swupdate.
+endif
+
+comment "swupate support needs toolchain w/ threads"
+   depends on !BR2_TOOLCHAIN_HAS_THREADS
+
+comment "swupate needs a Lua 5.2 interpreter"
+   depends on !BR2_PACKAGE_LUA_5_2
(quoted diff) +0 -2
-off_t.patch b/package/swupdate/swupdate-0001-Add-missing-header
-for-off_t.patch

new file mode 100644
index 0000000..4be0f7b

package/swupdate/swupdate-0001-Add-missing-header-for new file +1 -1
-off_t.patch
@@ -0,0 +1,25 @@
+From 4e382373cad64ca7e183336e33b72c53cfeed340 Mon Sep 17 00:00:00 

2001

Quoted 8 lines

package/swupdate/swupdate-0001-Add-missing-header-for

Quoted 5 lines
package/swupdate/swupdate-0001-Add-missing-header-for new file +5 -0
+From: Romain Naour <[email protected]>
+Date: Sun, 7 Sep 2014 17:31:09 +0200
+Subject: [PATCH 1/1] Add missing header for off_t
+
+Signed-off-by: Romain Naour <[email protected]>

What's the upstream status of this? Stefan is normally pretty
reactive...

It's not upstream yet. I will send the patch to Stefano.

Quoted 27 lines
Quoted 26 lines
+---
+ include/swupdate.h | 1 +

+ 1 file changed, 1 insertion(+)

package/swupdate/swupdate-0001-Add-missing-header-for new file +16 -0
+
+diff --git a/include/swupdate.h b/include/swupdate.h
+index 78b7f85..c193397 100644
+--- a/include/swupdate.h
++++ b/include/swupdate.h
+@@ -23,6 +23,7 @@
+ #ifndef _SWUPDATE_H
+ #define _SWUPDATE_H
+ 
++#include <sys/types.h>
+ #include <sys/queue.h>
+ #include "flash.h"
+ #include "globals.h"
+-- 
+1.9.3
+
package/swupdate/swupdate.config new file +0 -0
new file mode 100644
index 0000000..cb75998
@@ -0,0 +1,82 @@

[snip]

Quoted 6 lines

package/swupdate/swupdate.config line 82

Quoted 2 lines
package/swupdate/swupdate.config new file +2 -0
+CONFIG_UBOOT=y
+CONFIG_UBOOT_FWENV="/etc/fw_env.config"

Does it still work correctly if fw_env.config is not installed on
the target?
Probably not... So I think this should be mentioned in the help text.

I have not tested this.

Quoted 13 lines
Quoted 13 lines
package/swupdate/swupdate.mk new file +1 -0
new file mode 100644
index 0000000..c78092a
@@ -0,0 +1,62 @@
+##################################################################

##############

package/swupdate/swupdate.mk new file +4 -0
+#
+# swupdate
+#
+##################################################################
Quoted 8 lines
Quoted 5 lines

##############

package/swupdate/swupdate.mk new file +2 -0
+
+# Choose latest commit instead of release 2014.07 for getting bug 

fixes and
+# image downloading feature

This type of comment should be in the commit message, not in the
.mk file.

Ok

Quoted 5 lines
Quoted 5 lines
package/swupdate/swupdate.mk new file +5 -0
+SWUPDATE_VERSION = 8f59c21a07a99b94b53ab9ae3579cd2014b3cedc
+SWUPDATE_SITE = $(call github,sbabic,swupdate,$(SWUPDATE_VERSION))
+SWUPDATE_LICENSE = GPLv2+
+SWUPDATE_LICENSE_FILES = COPYING
+
Quoted 8 lines

package/swupdate/swupdate.mk line 17

Quoted 4 lines
package/swupdate/swupdate.mk new file +4 -0
+# swupdate bundles its own mongoose and lsqlite3 versions
+SWUPDATE_DEPENDENCIES = libconfig libcurl lua mtd openssl zlib
+
+SWUPDATE_BUILD_CONFIG = $(SWUPDATE_DIR)/.config

In linux.mk we directly use $(@D)/.config, which is IMHO clearer
than adding an
extra variable.

Ok

Quoted 5 lines
Quoted 3 lines

+SWUPDATE_KCONFIG_FILE = $(call qstrip,$(BR2_PACKAGE_SWUPDATE_CONFIG)) +SWUPDATE_KCONFIG_EDITORS = menuconfig xconfig gconfig

No nconfig?

No nconfig.

Quoted 6 lines

package/swupdate/swupdate.mk line 24

Quoted 3 lines
package/swupdate/swupdate.mk new file +3 -0
+SWUPDATE_CFLAGS = $(TARGET_CFLAGS)
+SWUPDATE_LDFLAGS = $(TARGET_LDFLAGS)
+SWUPDATE_LDLIBS =

These are redundant, just use the appropriate variables directly
below.

Ok

Quoted 4 lines

package/swupdate/swupdate.mk

Quoted 2 lines
package/swupdate/swupdate.mk new file +2 -0
+
+# If we're using static libs do the same for swupdate

This comment is redundant.

Ok

Quoted 10 lines

package/swupdate/swupdate.mk line 33

Quoted 8 lines
package/swupdate/swupdate.mk new file +3 -0
+ifeq ($(BR2_PREFER_STATIC_LIB),y)
+define SWUPDATE_PREFER_STATIC
+   $(call 

KCONFIG_ENABLE_OPT,CONFIG_STATIC,$(SWUPDATE_BUILD_CONFIG))

package/swupdate/swupdate.mk new file +4 -0
+endef
+endif
+
+define SWUPDATE_BUILD_OPTIONS

Better name would be _SET_BUILD_OPTIONS.

Ok

Quoted 6 lines

package/swupdate/swupdate.mk line 36

Quoted 4 lines

+ $(call
KCONFIG_SET_OPT,CONFIG_CROSS_COMPILER_PREFIX,"$(TARGET_CROSS)", \

package/swupdate/swupdate.mk new file +2 -0
+           $(SWUPDATE_BUILD_CONFIG))
+   $(call KCONFIG_SET_OPT,CONFIG_SYSROOT,"$(SYSROOT_DIR)", \

SYSROOT_DIR doesn't exist, you probably meant STAGING_DIR.

Correct.

Quoted 13 lines
Quoted 13 lines
package/swupdate/swupdate.mk new file +2 -0
+           $(SWUPDATE_BUILD_CONFIG))
+   $(call 

KCONFIG_SET_OPT,CONFIG_EXTRA_CFLAGS,"$(SWUPDATE_CFLAGS)", \

package/swupdate/swupdate.mk new file +2 -0
+           $(SWUPDATE_BUILD_CONFIG))
+   $(call 

KCONFIG_SET_OPT,CONFIG_EXTRA_LDFLAGS,"$(SWUPDATE_LDFLAGS)", \

package/swupdate/swupdate.mk new file +2 -0
+           $(SWUPDATE_BUILD_CONFIG))
+   $(call 

KCONFIG_SET_OPT,CONFIG_EXTRA_LDLIBS,"$(SWUPDATE_LDLIBS)", \

package/swupdate/swupdate.mk new file +4 -0
+           $(SWUPDATE_BUILD_CONFIG))
+endef
+
+define SWUPDATE_KCONFIG_FIXUP_CMDS
Quoted 8 lines

package/swupdate/swupdate.mk line 52

Quoted 6 lines
package/swupdate/swupdate.mk new file +6 -0
+   $(SWUPDATE_PREFER_STATIC)
+   $(SWUPDATE_BUILD_OPTIONS)
+endef
+
+define SWUPDATE_BUILD_CMDS
+   $(MAKE) -C $(@D)

You should at least pass $(TARGET_MAKE_ENV) as well.

Ok

Many thanks for reviewing!

#6 lore raw

PATCH v3 1/1 package/swupdate: new package

Quoted 2 lines · J?rg Krause
Quoted 1 line · Arnout Vandecappelle

On 21/04/15 02:30, J?rg Krause wrote:

[snip]

Quoted 17 lines
Quoted 11 lines

package/swupdate/Config.in line 4

Quoted 7 lines
package/swupdate/Config.in new file +4 -0
@@ -0,0 +1,42 @@
+config BR2_PACKAGE_SWUPDATE
+   bool "swupdate"
+   depends on BR2_TOOLCHAIN_HAS_THREADS # OpenSSL
+   depends on BR2_PACKAGE_LUA_5_2

Yikes, now I see this dependency so explicitly, it does look kind
of scary...

Quoted 3 lines

Maybe it's a better idea to not support lua at all instead.

How big a difference does it make in rootfs size?

Enabling lua adds 30KB for Lua 5.2 and 20KB for swupdate to rootfs.tar.

Quoted 8 lines
Quoted 1 line

What do you think, Joerg? Romain? Others?

The additional 50KB are neglectable for me. What I don't like is that I I have to select Lua 5.2 first to be able to select swupdate.

How about removing lua support from the default config and adding a check "ifeq($(BR2_PACKAGE_LUA_5_2),y)" which enables all lua features in swupdate.

OK.

I think you don't even need to add KCONFIG_ENABLE_OPT calls for lua. If the
user enables lua with swupdate-menuconfig, they'll notice at build time that lua is missing and they should be smart enough to enable it in buildroot afterwards.

Regards,
Arnout

[snip]

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#7 lore raw

PATCH v3 1/1 package/swupdate: new package

In reply to Jörg Krause

Hi J?rg, Arnout, all

Le 22/04/2015 09:56, J?rg Krause a ?crit :

Quoted 30 lines · Arnout Vandecappelle
Quoted 29 lines · J?rg Krause
Quoted 28 lines

This patch is based on an WIP version submitted by Romain Naour, commented by
Arnout Vandecappelle:
https://patchwork.ozlabs.org/patch/401270/

This package provides a default configuration with all external dependencies
enabled. This is necessary because upstream does not detect which dependencies
are available. Furthermore, upstream does not implement a savedefconfig target.

Note that swupdate provides its own customized version of mongoose and
lsqlite3.

swupdate provides a default website which can be installed to the target to
enable firmware update with a browser. This patch adds the user option to
install this website.

Cc Romain Naour <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Arnout Vandecappelle <[email protected]>

---

[snip]

Quoted 20 lines
Quoted 11 lines
Quoted 11 lines
(quoted diff) +0 -2
-off_t.patch b/package/swupdate/swupdate-0001-Add-missing-header
-for-off_t.patch

new file mode 100644
index 0000000..4be0f7b

package/swupdate/swupdate-0001-Add-missing-header-for new file +1 -1
-off_t.patch
@@ -0,0 +1,25 @@
+From 4e382373cad64ca7e183336e33b72c53cfeed340 Mon Sep 17 00:00:00 

2001

Quoted 8 lines

package/swupdate/swupdate-0001-Add-missing-header-for

Quoted 5 lines
package/swupdate/swupdate-0001-Add-missing-header-for new file +5 -0
+From: Romain Naour <[email protected]>
+Date: Sun, 7 Sep 2014 17:31:09 +0200
+Subject: [PATCH 1/1] Add missing header for off_t
+
+Signed-off-by: Romain Naour <[email protected]>

What's the upstream status of this? Stefan is normally pretty
reactive...

Quoted 1 line

It's not upstream yet. I will send the patch to Stefano.

Sorry, I haven't reworked on swupdate since October :-/
My tests on swupdate with my x86 target are on standby since then. Also I need to spend some time to add the support for other bootloader than u-boot (not easy).

I'll try to look at your v4 this week end.

Best regards,
Romain