From patchwork Tue Dec 3 07:44:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Vickberg X-Patchwork-Id: 1203548 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2607:f8b0:4864:20::b39; helo=mail-yb1-xb39.google.com; envelope-from=swupdate+bncbd32bl7xsegrbq5etdxqkgqeeswtw2y@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="KfvMzPFW"; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="aPqiBzUQ"; dkim-atps=neutral Received: from mail-yb1-xb39.google.com (mail-yb1-xb39.google.com [IPv6:2607:f8b0:4864:20::b39]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47RvBK2bP3z9sNx for ; Tue, 3 Dec 2019 18:44:07 +1100 (AEDT) Received: by mail-yb1-xb39.google.com with SMTP id p1sf1454585ybg.13 for ; Mon, 02 Dec 2019 23:44:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:message-id:subject:mime-version :x-original-sender:precedence:mailing-list:list-id:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=B+cX44wats7+OFSoJHWu34zNQeBlopQHVBU2WjBHbXQ=; b=KfvMzPFWn279Zn5OkuW4dzq/WlO0ffj0sg9Ll7QWexMg6kGDaQHNIyd6Ytl4Hasejd jbkErNfM3st6ObnNek4y9qbpWoR+FXnRSJ5uVU8h2B/oY17lruVQvtK+YJU8vP9ZO6BY 7WzyzJeKhJnOftQremwo/MNlCIs6KPH+oIvmjBwdC8rNImhl+tRICpCpYPM06gfpe3Y6 bL4mc06IcjL63EpHHP2orwwd2eboGsg6Ne6lsZpJM6oNEEw9nfEVrkBt9kjtNWcQl7VO iWDwX/VOq/RSEandak1w3cxMfUmSyGjS1IMjNTRCGW1h/iw3tdEO6LwN4ysfwxbgXJ3t cFpg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:message-id:subject:mime-version:x-original-sender :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=B+cX44wats7+OFSoJHWu34zNQeBlopQHVBU2WjBHbXQ=; b=aPqiBzUQjDBBPyi23R0Zs7uRFKYFdBxXHSyg2lAcrOUshVZzGX4Q+GDLy6x8d9Tpo+ n47Sh4t5Uo833NMJYY/4mGzRkLeV584Q8i0/dnXk0Teir+u0tpo0flN97gwQ0hUCB36x ZUrMxfaBCqTwpPimzvy7EtB9Nx921798MHvn31bPmWxYkgw2GUFUHYlJgg5wIflBAnLy j9icm6k18zsDBtRhxGXr4S1enx4GOLnJC/zHAq/9xkZnGFL+tXsnLRtVqQSeBCoYr6T0 t96YC9qiqZ7iferVHdpIg/Y5uG1t9T8UYQv/AmgAIXciUe+7ga+xLfM5kI7O4c1jhkxM KENg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:date:from:to:message-id:subject :mime-version:x-original-sender:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=B+cX44wats7+OFSoJHWu34zNQeBlopQHVBU2WjBHbXQ=; b=dI8Ls+vJI4CK8hgWdRfm6jMkvv8xQGbIatIy+uDj2Gv2V2YaL3TpdZARPskriU+Buo o98BPW3IBZNvBimxiqOFJNlj6H4SSPQGbUjdtpaOgnSnNw/W1HsjpbhSu17LnsExaP7n bjF3N+Bcxc4KKQzRFpKc5mKkQIdu4Q22Oe4SHM8baCmDMyStDPQ7pHdT2G4ybgdFwIgL EJueTTn6HkLqvPpnq8qO9Lzi52dtM5g/QQiOPkrCl2NjNSSxCoFmR404d1+t7fCoVM8i +rkAgwFEiJmf8w+qwumP6QFlY0tJVgDUH4IqV8BcrV83lknCe2BzqTZWv862ng8LWtt7 YIsw== Sender: swupdate@googlegroups.com X-Gm-Message-State: APjAAAW8+WRSspfoFH9mrk3uJzJtVmgxKgvSh4+dYocGs9rpWq/W4cZ6 yUxY+cA+yDSlJBi/91vEHGc= X-Google-Smtp-Source: APXvYqzOaLAXhUBKHYIAH91Hbhl9vDtBEmGkkQuVRcj/n+CJi7hIubMyaHt655BrirX2yUNrHsuAGg== X-Received: by 2002:a25:9c06:: with SMTP id c6mr3421655ybo.438.1575359043830; Mon, 02 Dec 2019 23:44:03 -0800 (PST) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a25:8406:: with SMTP id u6ls400100ybk.8.gmail; Mon, 02 Dec 2019 23:44:03 -0800 (PST) X-Received: by 2002:a25:361d:: with SMTP id d29mr3353836yba.276.1575359042866; Mon, 02 Dec 2019 23:44:02 -0800 (PST) Date: Mon, 2 Dec 2019 23:44:02 -0800 (PST) From: Alexander Vickberg To: swupdate Message-Id: <0683a7bf-1142-456d-b47d-ce6c259b41ca@googlegroups.com> Subject: [swupdate] [meta-swupdate][PATCH] Fix DEPENDS in swupdate recipe for building against mbedTLS MIME-Version: 1.0 X-Original-Sender: wickbergster@gmail.com Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Signed-off-by: Alexander Vickberg --- recipes-support/swupdate/swupdate.inc | 4 ---- recipes-support/swupdate/swupdate_2019.04.bb | 21 +++++++++++++++++ recipes-support/swupdate/swupdate_2019.11.bb | 24 ++++++++++++++++++++ recipes-support/swupdate/swupdate_git.bb | 24 ++++++++++++++++++++ 4 files changed, 69 insertions(+), 4 deletions(-) diff --git a/recipes-support/swupdate/swupdate.inc b/recipes-support/swupdate/swupdate.inc index 700d5a1..bc0980c 100644 --- a/recipes-support/swupdate/swupdate.inc +++ b/recipes-support/swupdate/swupdate.inc @@ -96,10 +96,6 @@ python () { depends = d.getVar('DEPENDS', False) d.setVar('DEPENDS', depends + ' zeromq') - if 'CONFIG_ENCRYPTED_IMAGES=y\n' in features or 'CONFIG_MONGOOSESSL=y\n' in features or 'CONFIG_HASH_VERIFY=y\n' in features or 'CONFIG_SURICATTA_SSL=y\n' in features: - depends = d.getVar('DEPENDS', False) - d.setVar('DEPENDS', depends + ' openssl') - if 'CONFIG_JSON=y\n' in features: depends = d.getVar('DEPENDS', False) d.setVar('DEPENDS', depends + ' json-c') diff --git a/recipes-support/swupdate/swupdate_2019.04.bb b/recipes-support/swupdate/swupdate_2019.04.bb index 9d1528e..cda11a1 100644 --- a/recipes-support/swupdate/swupdate_2019.04.bb +++ b/recipes-support/swupdate/swupdate_2019.04.bb @@ -9,3 +9,24 @@ do_install_append () { test -f ${D}${bindir}/hawkbitcfg && mv ${D}${bindir}/hawkbitcfg ${D}${bindir}/swupdate-hawkbitcfg test -f ${D}${bindir}/sendtohawkbit && mv ${D}${bindir}/sendtohawkbit ${D}${bindir}/swupdate-sendtohawkbit } + +python () { + try: + defconfig = bb.fetch2.localpath('file://defconfig', d) + except bb.fetch2.FetchError: + return + + try: + configfile = open(defconfig) + except IOError: + return + + features = configfile.readlines() + configfile.close() + + depends = d.getVar('DEPENDS', False) + if 'CONFIG_ENCRYPTED_IMAGES=y\n' in features or 'CONFIG_MONGOOSESSL=y\n' in features or 'CONFIG_HASH_VERIFY=y\n' in features or 'CONFIG_SURICATTA_SSL=y\n' in features: + depends += ' openssl' + + d.setVar('DEPENDS', depends) +} diff --git a/recipes-support/swupdate/swupdate_2019.11.bb b/recipes-support/swupdate/swupdate_2019.11.bb index 1cce343..f9372c1 100644 --- a/recipes-support/swupdate/swupdate_2019.11.bb +++ b/recipes-support/swupdate/swupdate_2019.11.bb @@ -1,3 +1,27 @@ require swupdate.inc SRCREV = "5de3bc30a203ee218f9ebbe256b42e26cf06c74f" + +python () { + try: + defconfig = bb.fetch2.localpath('file://defconfig', d) + except bb.fetch2.FetchError: + return + + try: + configfile = open(defconfig) + except IOError: + return + + features = configfile.readlines() + configfile.close() + + depends = d.getVar('DEPENDS', False) + if 'CONFIG_SSL_IMPL_OPENSSL=y\n' in features: + depends += ' openssl' + + if 'CONFIG_SSL_IMPL_MBEDTLS=y\n' in features: + depends += ' mbedtls' + + d.setVar('DEPENDS', depends) +} diff --git a/recipes-support/swupdate/swupdate_git.bb b/recipes-support/swupdate/swupdate_git.bb index 50d47cd..e73b394 100644 --- a/recipes-support/swupdate/swupdate_git.bb +++ b/recipes-support/swupdate/swupdate_git.bb @@ -4,3 +4,27 @@ DEFAULT_PREFERENCE = "-1" SRCREV ?= "e9df70498e604febf6ff9d56ce742522094cebd5" PV = "2019.04+git${SRCPV}" + +python () { + try: + defconfig = bb.fetch2.localpath('file://defconfig', d) + except bb.fetch2.FetchError: + return + + try: + configfile = open(defconfig) + except IOError: + return + + features = configfile.readlines() + configfile.close() + + depends = d.getVar('DEPENDS', False) + if 'CONFIG_SSL_IMPL_OPENSSL=y\n' in features: + depends += ' openssl' + + if 'CONFIG_SSL_IMPL_MBEDTLS=y\n' in features: + depends += ' mbedtls' + + d.setVar('DEPENDS', depends) +}