diff --git a/meta-digi-dey/recipes-support/swupdate/swupdate/0001-Makefile-change-Makefile-to-build-swupdate-library-s.patch b/meta-digi-dey/recipes-support/swupdate/swupdate/0001-Makefile-change-Makefile-to-build-swupdate-library-s.patch new file mode 100644 index 000000000..4348db473 --- /dev/null +++ b/meta-digi-dey/recipes-support/swupdate/swupdate/0001-Makefile-change-Makefile-to-build-swupdate-library-s.patch @@ -0,0 +1,86 @@ +From: Mike Engel +Date: Mon, 28 Jun 2021 18:45:20 +0200 +Subject: [PATCH 1/2] Makefile: change Makefile to build swupdate library + statically + +Signed-off-by: Mike Engel +--- + Makefile | 5 +++-- + ipc-static/Makefile | 6 ++++++ + ipc-static/network_ipc-if.c | 1 + + ipc-static/network_ipc.c | 1 + + ipc-static/progress_ipc.c | 1 + + 5 files changed, 12 insertions(+), 2 deletions(-) + create mode 100644 ipc-static/Makefile + create mode 120000 ipc-static/network_ipc-if.c + create mode 120000 ipc-static/network_ipc.c + create mode 120000 ipc-static/progress_ipc.c + +diff --git a/Makefile b/Makefile +index aa7d556..f905efa 100644 +--- a/Makefile ++++ b/Makefile +@@ -363,7 +363,7 @@ include $(srctree)/Makefile.flags + # Defaults to vmlinux, but the arch makefile usually adds further targets + + objs-y := core handlers +-libs-y := corelib mongoose parser suricatta bootloader fs ++libs-y := corelib ipc-static mongoose parser suricatta bootloader fs + bindings-y := bindings + tools-y := tools + +@@ -437,7 +437,7 @@ quiet_cmd_shared = LD $@ + "-shared -Wl,-soname,$@" \ + "$(KBUILD_CFLAGS) $(CFLAGS_swupdate)" \ + "$(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_swupdate) -L$(objtree)" \ +- "$(2)" \ ++ "$(2) ipc-static/lib.a" \ + "" \ + "$(LDLIBS)" + +@@ -481,6 +481,7 @@ install: all + install -m 0644 $(srctree)/include/progress_ipc.h ${DESTDIR}/${INCLUDEDIR} + install -m 0755 $(objtree)/${swupdate-ipc-lib} ${DESTDIR}/${LIBDIR} + ln -sfr ${DESTDIR}/${LIBDIR}/${swupdate-ipc-lib} ${DESTDIR}/${LIBDIR}/libswupdate.so ++ install -m 0755 ipc-static/lib.a ${DESTDIR}/${LIBDIR}/libswupdate.a + if [ $(HAVE_LUA) = y ]; then \ + install -d ${DESTDIR}/${LIBDIR}/lua/$(LUAVER); \ + install -m 0755 ${lua_swupdate} $(DESTDIR)/${LIBDIR}/lua/$(LUAVER); \ +diff --git a/ipc-static/Makefile b/ipc-static/Makefile +new file mode 100644 +index 0000000..99cce6c +--- /dev/null ++++ b/ipc-static/Makefile +@@ -0,0 +1,6 @@ ++# Copyright (C) 2021 Digi International Inc. ++# ++# SPDX-License-Identifier: GPL-2.0-only ++lib-y += network_ipc.o network_ipc-if.o progress_ipc.o ++ ++EXTRA_CFLAGS += -fPIC +diff --git a/ipc-static/network_ipc-if.c b/ipc-static/network_ipc-if.c +new file mode 120000 +index 0000000..37894e2 +--- /dev/null ++++ b/ipc-static/network_ipc-if.c +@@ -0,0 +1 @@ ++../ipc/network_ipc-if.c +\ No newline at end of file +diff --git a/ipc-static/network_ipc.c b/ipc-static/network_ipc.c +new file mode 120000 +index 0000000..0640077 +--- /dev/null ++++ b/ipc-static/network_ipc.c +@@ -0,0 +1 @@ ++../ipc/network_ipc.c +\ No newline at end of file +diff --git a/ipc-static/progress_ipc.c b/ipc-static/progress_ipc.c +new file mode 120000 +index 0000000..7c6622c +--- /dev/null ++++ b/ipc-static/progress_ipc.c +@@ -0,0 +1 @@ ++../ipc/progress_ipc.c +\ No newline at end of file +-- + diff --git a/meta-digi-dey/recipes-support/swupdate/swupdate/0002-config-add-on-the-fly-build-configuration-variable.patch b/meta-digi-dey/recipes-support/swupdate/swupdate/0002-config-add-on-the-fly-build-configuration-variable.patch new file mode 100644 index 000000000..085d127c9 --- /dev/null +++ b/meta-digi-dey/recipes-support/swupdate/swupdate/0002-config-add-on-the-fly-build-configuration-variable.patch @@ -0,0 +1,48 @@ +From: Mike Engel +Date: Wed, 23 Jun 2021 15:11:12 +0200 +Subject: [PATCH 2/2] config: add on the fly build configuration variable + +This commit adds on the fly configuration to the swupdate +build system to correct an issue when using sw-description +files that support different images and installation locations. + +Signed-off-by: Mike Engel +--- + Kconfig | 7 +++++++ + core/network_thread.c | 4 +++- + 2 files changed, 10 insertions(+), 1 deletion(-) + +diff --git a/Kconfig b/Kconfig +index 3862285..525c157 100644 +--- a/Kconfig ++++ b/Kconfig +@@ -241,6 +241,13 @@ config FEATURE_SYSLOG + # This option is auto-selected when you select any applet which may + # send its output to syslog. You do not need to select it manually. + ++config DIGI_ON_THE_FLY ++ string "Add Digi on the fly support" ++ default n ++ #help ++ # This option is used in on the fly support to skip selection ++ # verification. ++ + endmenu + + menu 'Build Options' +diff --git a/core/network_thread.c b/core/network_thread.c +index b21d983..3edda1e 100644 +--- a/core/network_thread.c ++++ b/core/network_thread.c +@@ -97,7 +97,9 @@ static bool is_selection_allowed(const char *software_set, char *running_mode, + } + free(swset); + } +- ++#ifdef CONFIG_DIGI_ON_THE_FLY ++ allowed = true; ++#endif + if (allowed) { + INFO("Accepted selection %s,%s", software_set, running_mode); + }else +-- diff --git a/meta-digi-dey/recipes-support/swupdate/swupdate_2021.11.bbappend b/meta-digi-dey/recipes-support/swupdate/swupdate_2021.11.bbappend index e4a87a9b1..4008e2d04 100644 --- a/meta-digi-dey/recipes-support/swupdate/swupdate_2021.11.bbappend +++ b/meta-digi-dey/recipes-support/swupdate/swupdate_2021.11.bbappend @@ -5,6 +5,11 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" # Without libgcc, swupdate generates an error signal when terminating RDEPENDS_${PN} += "libgcc" +SRC_URI += " \ + file://0001-Makefile-change-Makefile-to-build-swupdate-library-s.patch \ + file://0002-config-add-on-the-fly-build-configuration-variable.patch \ +" + do_configure_append() { # If Trustfence is enabled, enable the signing support in the # '.config' file.