From patchwork Wed Jan 24 22:00:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=C3=B6rg_Krause?= X-Patchwork-Id: 865494 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zRfHc4ZqXz9sNr for ; Thu, 25 Jan 2018 09:00:44 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 20D6688756; Wed, 24 Jan 2018 22:00:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id C-aqHkFj2nTb; Wed, 24 Jan 2018 22:00:40 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 92C3D88686; Wed, 24 Jan 2018 22:00:40 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id AE3141C1054 for ; Wed, 24 Jan 2018 22:00:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id AB6178938E for ; Wed, 24 Jan 2018 22:00:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aBCZ265vZ5Os for ; Wed, 24 Jan 2018 22:00:38 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.141]) by whitealder.osuosl.org (Postfix) with ESMTPS id 4EEFE890B3 for ; Wed, 24 Jan 2018 22:00:38 +0000 (UTC) Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id AFFBD20E2A for ; Wed, 24 Jan 2018 23:00:34 +0100 (CET) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 3zRfHP5QXpz9rxK for ; Wed, 24 Jan 2018 23:00:33 +0100 (CET) Received: from mail.embedded.rocks ([127.0.0.1]) by localhost (mail.embedded.rocks [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id DksfUmuwy9qb; Wed, 24 Jan 2018 23:00:32 +0100 (CET) Received: from nzxt.fritz.box (port-92-195-55-241.dynamic.qsc.de [92.195.55.241]) (Authenticated sender: joerg.krause@embedded.rocks) by mail.embedded.rocks (Postfix) with ESMTPSA; Wed, 24 Jan 2018 23:00:32 +0100 (CET) From: =?utf-8?q?J=C3=B6rg_Krause?= To: buildroot@buildroot.org Date: Wed, 24 Jan 2018 23:00:29 +0100 Message-Id: <20180124220029.30284-1-joerg.krause@embedded.rocks> X-Mailer: git-send-email 2.16.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH] swupdate: add upstream patch to fix build error X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" When building SWUpdate with the following defconfig: ``` CONFIG_DOWNLOAD=y ``` .. the build process breaks with: ``` corelib/channel_curl.c:27:10: fatal error: json-c/json.h: No such file or directory #include ``` Looking at the SWUpdate Kconfig based build system shows that `CONFIG_DOWNLOAD` depends on `HAVE_LIBCURL`, which selects CURL, which eventually enables the (unnecessary) build of channel_curl.o. The upstream fixes the condition for building channel_curl.o by adding a new hidden config option `CHANNEL_CURL`, which is only selected by the dependent options. Backported from: https://github.com/sbabic/swupdate/commit/37a6666a532e9cbc42b56301f27919ae7c00d2eb Signed-off-by: Jörg Krause --- ...-Fix-build-if-DOWNLOAD-is-set-but-no-JSON.patch | 107 +++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 package/swupdate/0002-Fix-build-if-DOWNLOAD-is-set-but-no-JSON.patch diff --git a/package/swupdate/0002-Fix-build-if-DOWNLOAD-is-set-but-no-JSON.patch b/package/swupdate/0002-Fix-build-if-DOWNLOAD-is-set-but-no-JSON.patch new file mode 100644 index 0000000000..5e07995582 --- /dev/null +++ b/package/swupdate/0002-Fix-build-if-DOWNLOAD-is-set-but-no-JSON.patch @@ -0,0 +1,107 @@ +From 37a6666a532e9cbc42b56301f27919ae7c00d2eb Mon Sep 17 00:00:00 2001 +From: Stefano Babic +Date: Tue, 23 Jan 2018 16:52:32 +0100 +Subject: [PATCH] Fix build if DOWNLOAD is set, but no JSON +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The downloader does not require JSON, but channel_curl is built +even if not called. Build fails with the error: + +corelib/channel_curl.c:27:10: fatal error: json-c/json.h: No such file or directory + +Add a CONFIG_CHANNEL_CURL that is automatically set by the modules +reuiring it (suricatta and swuforwarder). + +Backported from: 37a6666a532e9cbc42b56301f27919ae7c00d2eb + +Signed-off-by: Stefano Babic +Reported-by: Jörg Krause +Acked-by: Jörg Krause +Signed-off-by: Jörg Krause +--- + Kconfig | 7 +++++++ + corelib/Makefile | 2 +- + handlers/Config.in | 8 +++++--- + suricatta/Config.in | 3 +-- + 4 files changed, 14 insertions(+), 6 deletions(-) + +diff --git a/Kconfig b/Kconfig +index 4469096..e344572 100644 +--- a/Kconfig ++++ b/Kconfig +@@ -294,6 +294,13 @@ config DOWNLOAD + comment "Image downloading support needs libcurl" + depends on !HAVE_LIBCURL + ++config CHANNEL_CURL ++ bool ++ depends on HAVE_LIBCURL ++ depends on HAVE_JSON_C ++ select CURL ++ select JSON ++ + config HASH_VERIFY + bool "Allow to add sha256 hash to each image" + depends on HAVE_LIBSSL +diff --git a/corelib/Makefile b/corelib/Makefile +index 282bffd..4b30f9c 100644 +--- a/corelib/Makefile ++++ b/corelib/Makefile +@@ -17,4 +17,4 @@ lib-$(CONFIG_ENCRYPTED_IMAGES) += swupdate_decrypt.o + lib-$(CONFIG_LIBCONFIG) += swupdate_settings.o \ + parsing_library_libconfig.o + lib-$(CONFIG_JSON) += parsing_library_libjson.o +-lib-$(CONFIG_CURL) += channel_curl.o ++lib-$(CONFIG_CHANNEL_CURL) += channel_curl.o +diff --git a/handlers/Config.in b/handlers/Config.in +index 596f069..6226b59 100644 +--- a/handlers/Config.in ++++ b/handlers/Config.in +@@ -54,7 +54,6 @@ config UBIVIDOFFSET + if your NAND driver incorrectly reports that it can handle + sub-page accesses when it should not. + +- + config CFI + bool "cfi" + depends on MTD +@@ -164,8 +163,8 @@ comment "remote handler needs zeromq" + config SWUFORWARDER_HANDLER + bool "SWU forwarder" + depends on HAVE_LIBCURL +- select CURL +- select JSON ++ depends on HAVE_JSON_C ++ select CHANNEL_CURL + default n + help + This allows to build a chain of updater. A +@@ -174,6 +173,9 @@ config SWUFORWARDER_HANDLER + embedded SWU to the other devices using the + Webserver REST API. + ++comment "swuforward handler needs json-c and curl" ++ depends on !HAVE_JSON_C || !HAVE_LIBCURL ++ + comment "SWU forwarder requires libcurl" + depends on !HAVE_LIBCURL + +diff --git a/suricatta/Config.in b/suricatta/Config.in +index 62e448a..2586169 100644 +--- a/suricatta/Config.in ++++ b/suricatta/Config.in +@@ -71,8 +71,7 @@ config SURICATTA_HAWKBIT + bool "hawkBit support" + depends on HAVE_LIBCURL + depends on HAVE_JSON_C +- select JSON +- select CURL ++ select CHANNEL_CURL + help + Support for hawkBit server. + https://projects.eclipse.org/projects/iot.hawkbit +-- +2.16.1 +