Skip to contentSkip to conversation

package/swupdate: new package

PATCH Superseded Jörg Krause 4 participants 5 messages Apr 24, 2015 – Apr 27, 2015

v4 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 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/

We use the latest commit of swupdate instead of the last release 2014.07 to obtain several bug fixes and get support for the image downloading feature.

The package build file does not detect which dependencies are available. So we provide a default configuration which selects the external dependencies by default except for lua. Lua support can be added by the user by customizing the configuration file (swupdate.config) add select the Lua 5.2 interpreter manually.

Furthermore the U-Boot handler is not enabled by default, as it may cause runtime issues if the U-Boot environment configuration file (fw_env.config) is not present on the target system.

The package provides a default website which can be installed to the target to enable firmware update with a browser.

Note, swupdate does not implement a savedefconfig and nconfig target. Note, swupdate provides its own customized versions of mongoose and lsqlite3.

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

---
Changes v3 -> v4:
- bump to latest commit c68f02320858f89f2d441ff2057d49489fb6f586
- remove lua dependency (Mike, Arnout)
- remove U-Boot handler in swupdate.config (Arnout)
- fix CONFIG_SYSROOT (Arnout)
- pass $(TARGET_MAKE_ENV) to make (Arnout)
- align help text
- sent patch upstream

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 +
 .../0001-Add-missing-header-for-off_t.patch        | 31 ++++++++
 package/swupdate/Config.in                         | 40 +++++++++++
 package/swupdate/swupdate.config                   | 82 ++++++++++++++++++++++
 package/swupdate/swupdate.mk                       | 53 ++++++++++++++
 5 files changed, 207 insertions(+)
 create mode 100644 package/swupdate/0001-Add-missing-header-for-off_t.patch
 create mode 100644 package/swupdate/Config.in
 create mode 100644 package/swupdate/swupdate.config
 create mode 100644 package/swupdate/swupdate.mk
package/Config.in +1 -0
index afa145e..dd6d44b 100644
@@ -1404,6 +1404,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/0001-Add-missing-header-for-off_t.patch new file +31 -0
new file mode 100644
index 0000000..5c17cf3
@@ -0,0 +1,31 @@
+From c200a9f1dff41fc476c314674ba92c7869b93e3e 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
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Sent patch upstream:
+https://groups.google.com/d/msg/swupdate/xAZU9fk3qwM/zppNv8Xs-F0J
+
+Signed-off-by: Romain Naour <[email protected]>
+Signed-off-by: J?rg Krause <[email protected]>
+---
+ include/swupdate.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/include/swupdate.h b/include/swupdate.h
+index dc03a50..5adf36c 100644
+--- a/include/swupdate.h
++++ b/include/swupdate.h
+@@ -20,6 +20,7 @@
+ #ifndef _SWUPDATE_H
+ #define _SWUPDATE_H
+
++#include <sys/types.h>
+ #include <sys/queue.h>
+ #include "flash.h"
+ #include "globals.h"
+--
+2.3.6
package/swupdate/Config.in new file +40 -0
new file mode 100644
index 0000000..a174866
@@ -0,0 +1,40 @@
+config BR2_PACKAGE_SWUPDATE
+	bool "swupdate"
+	depends on BR2_TOOLCHAIN_HAS_THREADS # OpenSSL
+	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 and a webserver, as well as handlers for UBI
+	  volumes, raw NAND or NOR flash, SD cards and shell scripts.
+
+	  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.
+
+	  Note that if you add lua support in the configuration file you need
+	  the Lua 5.2 interpreter (BR_PACKAGE_LUA_5_2) manually.
+
+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
package/swupdate/swupdate.config new file +82 -0

82 lines not on this page · raw message

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

53 lines not on this page · raw message

Signature · 1 line
2.3.6
#1 lore raw

PATCH v4 1/1 package/swupdate: new package

J?rg, All,

On 2015-04-25 01:02 +0200, J?rg Krause spake thusly:

Quoted 23 lines

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

We use the latest commit of swupdate instead of the last release 2014.07 to obtain several bug fixes and get support for the image downloading feature.

The package build file does not detect which dependencies are available. So we provide a default configuration which selects the external dependencies by default except for lua. Lua support can be added by the user by customizing the configuration file (swupdate.config) add select the Lua 5.2 interpreter manually.

Furthermore the U-Boot handler is not enabled by default, as it may cause runtime issues if the U-Boot environment configuration file (fw_env.config) is not present on the target system.

The package provides a default website which can be installed to the target to enable firmware update with a browser.

Note, swupdate does not implement a savedefconfig and nconfig target. Note, swupdate provides its own customized versions of mongoose and lsqlite3.

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

---

[--SNIP--]

Quoted 9 lines
package/swupdate/Config.in new file +3 -0
new file mode 100644
index 0000000..a174866
@@ -0,0 +1,40 @@
+config BR2_PACKAGE_SWUPDATE
+	bool "swupdate"
+	depends on BR2_TOOLCHAIN_HAS_THREADS # OpenSSL

package/swupdate/Config.in line 13

Quoted 10 lines
package/swupdate/Config.in new file +10 -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

We prefer to point to the homepage when it exists, rather than to the git tree:
https://sbabic.github.io/swupdate/

Quoted 7 lines
package/swupdate/Config.in new file +7 -0
+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

package/swupdate/Config.in line 31

Quoted 10 lines
package/swupdate/Config.in new file +10 -0
+	  an image downloader and a webserver, as well as handlers for UBI
+	  volumes, raw NAND or NOR flash, SD cards and shell scripts.
+
+	  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.
+
+	  Note that if you add lua support in the configuration file you need
+	  the Lua 5.2 interpreter (BR_PACKAGE_LUA_5_2) manually.

Something's weird in this sentence. What about:

Note that if you add lua support in the configuration file, you will have to enable the Lua 5.2 interpreter (BR_PACKAGE_LUA_5_2).

[--SNIP--]

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

package/swupdate/swupdate.mk line 9

Quoted 9 lines
package/swupdate/swupdate.mk new file +9 -0
@@ -0,0 +1,53 @@
+################################################################################
+#
+# swupdate
+#
+################################################################################
+
+SWUPDATE_VERSION = c68f02320858f89f2d441ff2057d49489fb6f586
+SWUPDATE_SITE = $(call github,sbabic,swupdate,$(SWUPDATE_VERSION))
+SWUPDATE_LICENSE = GPLv2+

In fact, there are a few other licenses. For example, the copies of Mongoose and lsqlite3 they bundle are MIT; the sqlite3 aggregated source file is public domain ("The author disclaims copyright to this source code.").

package/swupdate/swupdate.mk line 12

Quoted 3 lines
package/swupdate/swupdate.mk new file +3 -0
+SWUPDATE_LICENSE_FILES = COPYING
+
+# swupdate bundles its own mongoose and lsqlite3 versions

Is it possible to make it use external versions, or does it only support using its bundled ones?

If that's possible, we prefer that.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH v4 1/1 package/swupdate: new package

Dear Yann E. MORIN,

Quoted 8 lines · Yann E. MORIN

package/swupdate/swupdate.mk line 9

Quoted 3 lines
package/swupdate/swupdate.mk new file +3 -0
+SWUPDATE_VERSION = c68f02320858f89f2d441ff2057d49489fb6f586
+SWUPDATE_SITE = $(call github,sbabic,swupdate,$(SWUPDATE_VERSION))
+SWUPDATE_LICENSE = GPLv2+

In fact, there are a few other licenses. For example, the copies of Mongoose and lsqlite3 they bundle are MIT; the sqlite3 aggregated source file is public domain ("The author disclaims copyright to this source code.").

Do we care about this? If the all thing is then linked with GPLv2 code, then the result is GPLv2 license, no?

Indeed, the authors of the MIT licensed code should get credited (by means of a file in <pkg>_LICENSE_FILES), but I'm not sure we need to mention MIT and public domain in <pkg>_LICENSE.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH v4 1/1 package/swupdate: new package

In reply to Yann E. MORIN

Hi J?rg, Yann, all

Le 25/04/2015 12:22, Yann E. MORIN a ?crit :

Quoted 32 lines

J?rg, All,

On 2015-04-25 01:02 +0200, J?rg Krause spake thusly:

Quoted 29 lines

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

We use the latest commit of swupdate instead of the last release 2014.07 to obtain several bug fixes and get support for the image downloading feature.

The package build file does not detect which dependencies are available. So we provide a default configuration which selects the external dependencies by default except for lua. Lua support can be added by the user by customizing the configuration file (swupdate.config) add select the Lua 5.2 interpreter manually.

Furthermore the U-Boot handler is not enabled by default, as it may cause runtime issues if the U-Boot environment configuration file (fw_env.config) is not present on the target system.

The package provides a default website which can be installed to the target to enable firmware update with a browser.

Note, swupdate does not implement a savedefconfig and nconfig target. Note, swupdate provides its own customized versions of mongoose and lsqlite3.

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

---

[snip]

Quoted 7 lines

package/swupdate/swupdate.mk line 12

Quoted 4 lines
package/swupdate/swupdate.mk new file +3 -0
+SWUPDATE_LICENSE_FILES = COPYING
+
+# swupdate bundles its own mongoose and lsqlite3 versions

Is it possible to make it use external versions, or does it only support using its bundled ones?

I tried to add mongoose dependency at first but it seems it use an embedded copy of mongoose and lsqlite3 when CONFIG_MONGOOSE and CONFIG_MONGOOSESQL are set in the config file.

See the last Arnout's comment (https://patchwork.ozlabs.org/patch/401270):
"Doesn't swupdate use an embedded mongoose? I.e., doesn't it link with it?"

Best regards,
Romain

Quoted 6 lines

If that's possible, we prefer that.

Regards,
Yann E. MORIN.

#4 lore raw

PATCH v4 1/1 package/swupdate: new package

In reply to Yann E. MORIN

Hi Yann,

Quoted 2 lines · Yann E. MORIN

J?rg, All,

[snip]

Quoted 4 lines

We prefer to point to the homepage when it exists, rather than to the git tree:
https://sbabic.github.io/swupdate/

Ok.

Quoted 28 lines
Quoted 23 lines
package/swupdate/Config.in new file +7 -0
+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 and a webserver, as well as
handlers for UBI
+ volumes, raw NAND or NOR flash, SD cards and shell
scripts.

(quoted diff) +2 -0
+
+     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 +3 -0
+     with this option.
+
+     Note that if you add lua support in the configuration 
Quoted 2 lines

file you need
+ the Lua 5.2 interpreter (BR_PACKAGE_LUA_5_2) manually.

Something's weird in this sentence. What about:

Quoted 3 lines

Note that if you add lua support in the configuration file, you
will
have to enable the Lua 5.2 interpreter (BR_PACKAGE_LUA_5_2).

Ok.

Quoted 18 lines

[--SNIP--]

Quoted 16 lines
package/swupdate/swupdate.mk new file +1 -0
new file mode 100644
index 0000000..71ae888
@@ -0,0 +1,53 @@
+##################################################################

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

package/swupdate/swupdate.mk new file +4 -0
+#
+# swupdate
+#
+##################################################################

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

package/swupdate/swupdate.mk new file +2 -0
+
+SWUPDATE_VERSION = c68f02320858f89f2d441ff2057d49489fb6f586
Quoted 8 lines

package/swupdate/swupdate.mk line 9

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

In fact, there are a few other licenses. For example, the copies of Mongoose and lsqlite3 they bundle are MIT; the sqlite3 aggregated source
file is public domain ("The author disclaims copyright to this source code.").

I see. So I'll add MIT and Public Domain, right?

Quoted 9 lines

package/swupdate/swupdate.mk line 12

Quoted 3 lines
package/swupdate/swupdate.mk new file +3 -0
+SWUPDATE_LICENSE_FILES = COPYING
+
+# swupdate bundles its own mongoose and lsqlite3 versions

Is it possible to make it use external versions, or does it only support
using its bundled ones?

If that's possible, we prefer that.

swupdate bundles with mongoose 3.8 (2013) and lsqlite3 0.8 (2011) versions. I'm not sure it will work with recent versions.

Best regards
J?rg Krause