swupdate: bump to version 2017.11
PATCH 1/1 swupdate: bump to version 2017.11
Remove upstream patch 0001-Fix-SHA256-hash-verification.patch.
Re-enable support for Lua 5.1 and LuaJIT, which was removed in version 2017.09 because of compatibility issues [1]. Meanwhile, the issues have been resolved upstream [2].
Note, that CONFIG_HANDLER_IN_LUA is now supported by Lua 5.1/LuaJIT, too.
Add a fixup command SWUPDATE_SET_LUA_VERSION to set the correct base name for the Lua/LuaJIT pkg-config file used by the swupdates config option LUAPKG.
Fix a small type in the help text:
'in my mind' -> 'in mind'.
Regenerated the .config script by doing:
``` make swupdate-menuconfig make swupdate-update-config ```
.. and removing the paths for the build options manually.
[1] http://patchwork.ozlabs.org/patch/795958/
[2] https://github.com/sbabic/swupdate/commit/7b49b8dc59acc0591fe9823f1739ba7422eb30c7
--- .../0001-Fix-SHA256-hash-verification.patch | 119 --------------------- package/swupdate/Config.in | 8 +- package/swupdate/swupdate.config | 63 +++++++++-- package/swupdate/swupdate.hash | 2 +- package/swupdate/swupdate.mk | 12 ++- 5 files changed, 71 insertions(+), 133 deletions(-) delete mode 100644 package/swupdate/0001-Fix-SHA256-hash-verification.patch
package/swupdate/0001-Fix-SHA256-hash-verification.patch deleted +0 -119
@@ -1,119 +0,0 @@ -From dba95dcd3739c604a81ffa2df2545e7a4cd430cf Mon Sep 17 00:00:00 2001 -From: Maksim Salau <[email protected]> -Date: Wed, 25 Oct 2017 16:17:14 +0300 -Subject: [PATCH] Fix SHA256 hash verification - -If a CPIO archive is not valid or copying fails due to any reason, -an error message is printed, but update process continues. -The change makes the utility fail in case of read errors or -hash verification errors. - -Signed-off-by: Maksim Salau <[email protected]> -Acked-by: Stefano Babic <[email protected]> ---- - core/cpio_utils.c | 28 +++++++++++++++++++++------- - corelib/installer.c | 11 +++++++++-- - 2 files changed, 30 insertions(+), 9 deletions(-) - -diff --git a/core/cpio_utils.c b/core/cpio_utils.c -index e962fae..de674ec 100644 ---- a/core/cpio_utils.c -+++ b/core/cpio_utils.c -@@ -414,24 +414,34 @@ int extract_img_from_cpio(int fd, unsigned long offset, struct filehdr *fdh) - off_t extract_next_file(int fd, int fdout, off_t start, int compressed, - int encrypted, unsigned char *hash) - { -+ int ret; - struct filehdr fdh; - uint32_t checksum = 0; - unsigned long offset = start; - -- if (lseek(fd, offset, SEEK_SET) < 0) { -+ ret = lseek(fd, offset, SEEK_SET); -+ if (ret < 0) { - ERROR("CPIO file corrupted : %s\n", - strerror(errno)); -- return -1; -+ return ret; - } - -- if (extract_cpio_header(fd, &fdh, &offset)) { -+ ret = extract_cpio_header(fd, &fdh, &offset); -+ if (ret) { - ERROR("CPIO Header wrong\n"); -+ return ret; - } - -- if (lseek(fd, offset, SEEK_SET) < 0) -+ ret = lseek(fd, offset, SEEK_SET); -+ if (ret < 0) { - ERROR("CPIO file corrupted : %s\n", strerror(errno)); -- if (copyfile(fd, &fdout, fdh.size, &offset, 0, 0, compressed, &checksum, hash, encrypted, NULL) < 0) { -+ return ret; -+ } -+ -+ ret = copyfile(fd, &fdout, fdh.size, &offset, 0, 0, compressed, &checksum, hash, encrypted, NULL); -+ if (ret < 0) { - ERROR("Error copying extracted file\n"); -+ return ret; - } - - TRACE("Copied file:\n\tfilename %s\n\tsize %u\n\tchecksum 0x%lx %s\n", -@@ -440,9 +450,11 @@ off_t extract_next_file(int fd, int fdout, off_t start, int compressed, - (unsigned long)checksum, - (checksum == fdh.chksum) ? "VERIFIED" : "WRONG"); - -- if (checksum != fdh.chksum) -+ if (checksum != fdh.chksum) { - ERROR("Checksum WRONG ! Computed 0x%lx, it should be 0x%lx\n", - (unsigned long)checksum, fdh.chksum); -+ return -EINVAL; -+ } - - return offset; - } -@@ -492,8 +504,10 @@ int cpio_scan(int fd, struct swupdate_cfg *cfg, off_t start) - - /* Next header must be 4-bytes aligned */ - offset += NPAD_BYTES(offset); -- if (lseek(fd, offset, SEEK_SET) < 0) -+ if (lseek(fd, offset, SEEK_SET) < 0) { - ERROR("CPIO file corrupted : %s\n", strerror(errno)); -+ return -1; -+ } - } - - return 0; -diff --git a/corelib/installer.c b/corelib/installer.c -index 592ada8..d2dee28 100644 ---- a/corelib/installer.c -+++ b/corelib/installer.c -@@ -154,6 +154,7 @@ static int extract_script(int fd, struct imglist *head, const char *dest) - { - struct img_type *script; - int fdout; -+ int ret = 0; - - LIST_FOREACH(script, head, next) { - if (script->provided == 0) { -@@ -166,9 +167,15 @@ static int extract_script(int fd, struct imglist *head, const char *dest) - dest, script->fname); - - fdout = openfileoutput(script->extract_file); -- extract_next_file(fd, fdout, script->offset, 0, -- script->is_encrypted, script->sha256); -+ if (fdout < 0) -+ return fdout; -+ -+ ret = extract_next_file(fd, fdout, script->offset, 0, -+ script->is_encrypted, script->sha256); - close(fdout); -+ -+ if (ret < 0) -+ return ret; - } - return 0; - } --- -2.7.4 -
package/swupdate/Config.in +4 -4
@@ -4,7 +4,7 @@ config BR2_PACKAGE_SWUPDATE depends on BR2_USE_MMU # fork() # swupdate requires a parser and uses libconfig as default select BR2_PACKAGE_LIBCONFIG if !BR2_PACKAGE_JSON_C && \ - !BR2_PACKAGE_LUA_5_2 && !BR2_PACKAGE_LUA_5_3 + !BR2_PACKAGE_HAS_LUAINTERPRETER help swupdate provides a reliable way to update the software on an embedded system.
@@ -16,11 +16,11 @@ config BR2_PACKAGE_SWUPDATE handler for raw NAND or NOR flash. The default configuration file builds a reasonable firmware - update system with minimal external dependencies in my - mind. If you like to use your own modified configuration, + update system with minimal external dependencies in mind. + If you like to use your own modified configuration, you have to select the necessary packages manually: - * Select BR2_PACKAGE_LUA_5_2 or BR2_PACKAGE_LUA_5_3 if you + * Select BR2_PACKAGE_LUA or BR2_PACKAGE_LUAJIT if you want want to have Lua support. * Select BR2_LIBCURL if you want to use the download feature.
package/swupdate/swupdate.config +57 -6
107 lines not on this page · raw message
package/swupdate/swupdate.hash +1 -1
@@ -1,2 +1,2 @@ # Locally calculated -sha256 898a98b0c5a6bd09a4138fa98bb9883357db1ec6fe4dd5e8f4bcb11d092b9bf3 swupdate-2017.07.tar.gz +sha256 1e15d9675cf7e23886dca7ea058498282c35679a555845dbc85ffe688f2cc681 swupdate-2017.11.tar.gz
package/swupdate/swupdate.mk +9 -3
@@ -4,7 +4,7 @@ # ################################################################################ -SWUPDATE_VERSION = 2017.07 +SWUPDATE_VERSION = 2017.11 SWUPDATE_SITE = $(call github,sbabic,swupdate,$(SWUPDATE_VERSION)) SWUPDATE_LICENSE = GPL-2.0+, MIT, Public Domain SWUPDATE_LICENSE_FILES = COPYING
@@ -39,8 +39,13 @@ else SWUPDATE_MAKE_ENV += HAVE_LIBCURL=n endif -ifeq ($(BR2_PACKAGE_LUA_5_2)$(BR2_PACKAGE_LUA_5_3),y) -SWUPDATE_DEPENDENCIES += lua host-pkgconf + +ifeq ($(BR2_PACKAGE_HAS_LUAINTERPRETER),y) +SWUPDATE_DEPENDENCIES += luainterpreter host-pkgconf +# defines the base name for the pkg-config file ("lua" or "luajit") +define SWUPDATE_SET_LUA_VERSION + $(call KCONFIG_SET_OPT,CONFIG_LUAPKG,$(BR2_PACKAGE_PROVIDES_LUAINTERPRETER),$(SWUPDATE_BUILD_CONFIG)) +endef SWUPDATE_MAKE_ENV += HAVE_LUA=y else SWUPDATE_MAKE_ENV += HAVE_LUA=n
@@ -110,6 +115,7 @@ endef define SWUPDATE_KCONFIG_FIXUP_CMDS $(SWUPDATE_PREFER_STATIC) $(SWUPDATE_SET_BUILD_OPTIONS) + $(SWUPDATE_SET_LUA_VERSION) endef define SWUPDATE_BUILD_CMDS
Signature · 1 line
2.15.1
Thomas Petazzoni
AppliedPATCH 1/1 swupdate: bump to version 2017.11
Hello,
Quoted 26 lines · J?rg Krause
Remove upstream patch 0001-Fix-SHA256-hash-verification.patch.
Re-enable support for Lua 5.1 and LuaJIT, which was removed in version 2017.09 because of compatibility issues [1]. Meanwhile, the issues have been resolved upstream [2].
Note, that
CONFIG_HANDLER_IN_LUAis now supported by Lua 5.1/LuaJIT, too.Add a fixup command
SWUPDATE_SET_LUA_VERSIONto set the correct base name for the Lua/LuaJIT pkg-config file used by the swupdates config optionLUAPKG.Fix a small type in the help text:
'in my mind' -> 'in mind'.Regenerated the .config script by doing:
``` make swupdate-menuconfig make swupdate-update-config ```.. and removing the paths for the build options manually.
[1] http://patchwork.ozlabs.org/patch/795958/
[2] https://github.com/sbabic/swupdate/commit/7b49b8dc59acc0591fe9823f1739ba7422eb30c7Signed-off-by J?rg Krause <[email protected]>
Quoted 8 lines
--- .../0001-Fix-SHA256-hash-verification.patch | 119 --------------------- package/swupdate/Config.in | 8 +- package/swupdate/swupdate.config | 63 +++++++++-- package/swupdate/swupdate.hash | 2 +- package/swupdate/swupdate.mk | 12 ++- 5 files changed, 71 insertions(+), 133 deletions(-) delete mode 100644 package/swupdate/0001-Fix-SHA256-hash-verification.patch
Applied to master, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 1/1 swupdate: bump to version 2017.11
In reply to Jörg KrauseJ?rg, All,
On 2018-01-10 23:28 +0100, J?rg Krause spake thusly:
[--SNIP--]
Quoted 14 lines
package/swupdate/swupdate.mk +1
-1@@ -4,7 +4,7 @@ # ################################################################################ -SWUPDATE_VERSION = 2017.07 +SWUPDATE_VERSION = 2017.11 SWUPDATE_SITE = $(call github,sbabic,swupdate,$(SWUPDATE_VERSION)) SWUPDATE_LICENSE = GPL-2.0+, MIT, Public Domain SWUPDATE_LICENSE_FILES = COPYING
package/swupdate/swupdate.mk else · line 42
Quoted 6 lines
package/swupdate/swupdate.mk +1
-2@@ -39,8 +39,13 @@ else SWUPDATE_MAKE_ENV += HAVE_LIBCURL=n endif -ifeq ($(BR2_PACKAGE_LUA_5_2)$(BR2_PACKAGE_LUA_5_3),y) -SWUPDATE_DEPENDENCIES += lua host-pkgconf +
This is adding an extra empty line, which would have been caught by running:
$ ./utils/check-package package/swupdate/swupdate.mk
package/swupdate/swupdate.mk:42: consecutive empty lines
140 lines processed
1 warnings generatedCare to fix, please?
Regards,
Yann E. MORIN.
Quoted 24 lines
package/swupdate/swupdate.mk +7
-0+ifeq ($(BR2_PACKAGE_HAS_LUAINTERPRETER),y) +SWUPDATE_DEPENDENCIES += luainterpreter host-pkgconf +# defines the base name for the pkg-config file ("lua" or "luajit") +define SWUPDATE_SET_LUA_VERSION + $(call KCONFIG_SET_OPT,CONFIG_LUAPKG,$(BR2_PACKAGE_PROVIDES_LUAINTERPRETER),$(SWUPDATE_BUILD_CONFIG)) +endef SWUPDATE_MAKE_ENV += HAVE_LUA=y else SWUPDATE_MAKE_ENV += HAVE_LUA=n@@ -110,6 +115,7 @@ endef define SWUPDATE_KCONFIG_FIXUP_CMDS $(SWUPDATE_PREFER_STATIC) $(SWUPDATE_SET_BUILD_OPTIONS) + $(SWUPDATE_SET_LUA_VERSION) endef define SWUPDATE_BUILD_CMDSSignature · 6 lines
2.15.1 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
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. | '------------------------------^-------^------------------^--------------------'
PATCH 1/1 swupdate: bump to version 2017.11
Yann,
Quoted 28 lines · Yann E. MORIN
J?rg, All,
On 2018-01-10 23:28 +0100, J?rg Krause spake thusly:
[--SNIP--]Quoted 14 lines
package/swupdate/swupdate.mk +1
-1@@ -4,7 +4,7 @@ # ################################################################################ -SWUPDATE_VERSION = 2017.07 +SWUPDATE_VERSION = 2017.11 SWUPDATE_SITE = $(call github,sbabic,swupdate,$(SWUPDATE_VERSION)) SWUPDATE_LICENSE = GPL-2.0+, MIT, Public Domain SWUPDATE_LICENSE_FILES = COPYINGpackage/swupdate/swupdate.mk else · line 42
Quoted 6 lines
package/swupdate/swupdate.mk +1
-2@@ -39,8 +39,13 @@ else SWUPDATE_MAKE_ENV += HAVE_LIBCURL=n endif -ifeq ($(BR2_PACKAGE_LUA_5_2)$(BR2_PACKAGE_LUA_5_3),y) -SWUPDATE_DEPENDENCIES += lua host-pkgconf +This is adding an extra empty line, which would have been caught by running:
Quoted 6 lines
$ ./utils/check-package package/swupdate/swupdate.mk package/swupdate/swupdate.mk:42: consecutive empty lines 140 lines processed 1 warnings generatedCare to fix, please?
Thanks for reporting! Fix is on his way...
J?rg