From patchwork Wed Apr 3 00:27:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: 'Darko Komljenovic' via swupdate X-Patchwork-Id: 1075150 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=googlegroups.com (client-ip=2607:f8b0:4864:20::83f; helo=mail-qt1-x83f.google.com; envelope-from=swupdate+bncbcg4lpfp6aorbcx4r7sqkgqeroxr5oy@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=googlegroups.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="TAKqgacj"; dkim-atps=neutral Received: from mail-qt1-x83f.google.com (mail-qt1-x83f.google.com [IPv6:2607:f8b0:4864:20::83f]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44Yn3h6w4gz9sSP for ; Wed, 3 Apr 2019 11:27:59 +1100 (AEDT) Received: by mail-qt1-x83f.google.com with SMTP id v18sf15276742qtk.5 for ; Tue, 02 Apr 2019 17:27:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1554251274; cv=pass; d=google.com; s=arc-20160816; b=0H4qLEdiMcfK78xRslBI+kO7fE1Vw/DQoeOwrVlN7mMzNIQmTQqAXswOrdb1sbuKmE ScAmSNnwvfNb41YqcecgPWerdvQbJqGLZCxAfyxm8ZZieOM9wtCuM4jvatW6hM9PsQlm sEII996KZp774eKC70EZvrMaMpJwhdKcyMAjYoZ2s1E7AbJUQYy9voJBiUfnc+XMtIVE Yyn7XdvbX9CHIm2mCvZBqP4q3G06iV/y27lN8pl+J7q7FeJZTL574HO0aUdshNQeBilO pwfKsuOKOcvlbOh5so58P8EnpbooUtsNHJ1OI4pe/RmlBa/Kxc9J6opbRznjlb0A8VKG Xg7A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:message-id:date:subject:cc :to:from:mime-version:dkim-signature; bh=2ePYVrX3rMLcRVhR+rKxkY6qFdVSMj+K1oCpejhO3Bo=; b=UpNVvXdzH/Rs4BGBFxiHek3cpsp6vPL1KSLPnfVxxDDwNNViq4RZb8acudsT+GQDqG ocbphE0TzSOLIQ7qxsYpJbRpEp6ol6zOq0Qp2ccfrLqAxW2NQMHL6caOuXFmHlU7dGkI 8sf30Aqyk4BG1ZaKnDzRVvDNxPWMifxpu3/U/4fN5pIWoTKq6brADytVzwK/gfuGnZRb 7DZ6mMM5LC3Ss38PFCZfB8BdIz+ceT+D5DuOYhrByCiAtwXvVTDx1aMC1lfvaUyWiQKc 1jRXaeeZGnIilpFTbNi/RF4LU2Cw291Z5azYR9wFR3yDNofMU+fe+XFZ2yOD2Yvx7FrN NX7A== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@planetinnovation.com.au header.s=google header.b=jjLBrrtq; spf=pass (google.com: domain of austin.phillips@planetinnovation.com.au designates 2607:f8b0:4864:20::534 as permitted sender) smtp.mailfrom=austin.phillips@planetinnovation.com.au; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=planetinnovation.com.au DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=mime-version:from:to:cc:subject:date:message-id:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=2ePYVrX3rMLcRVhR+rKxkY6qFdVSMj+K1oCpejhO3Bo=; b=TAKqgacj5cuL2Ke72JpeITeH/1HqmkBTvxoD4LIeeZDi/YirmapZT40sQE04xK0g0H va7BosaXHDZywY3z9KmuUycwigPrrcsVM/9nYUS8u1vEHgFabu2RW5CMjyB2jTbwkht/ k2JVHLcdIgTGnTsYiZw9cLr4wYJcIw4KZlzW8tjYUFqr1gqJYvCRS8UqenwWP1jkMduU 0KwnFXi8farSg9phoTaQULowNkYCbn/EuF1vDWoi/qn0Qa+rYUwJ2yGkfi6uCG09D+Q9 ZHcdOs9CUwOKamDi9I4+ZohyDyLItLShNA3GwJhFRtuzqK6bG1Hjjzhs3xU8cJl5kD43 2RYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:to:cc:subject:date:message-id :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=2ePYVrX3rMLcRVhR+rKxkY6qFdVSMj+K1oCpejhO3Bo=; b=DsSKfffgm+r5JJ628Y65H7JWfmeR/Oj9Otji/IS+5lT/DGCU0OJAD13z8R/4qsDBkI UAXYslhLbRgXAHd7irQ37Pg58caeWUMz5M2w8S6issgxSXAkFXsQuZ5Okm3Ot172C6JG DQ7O6yhUOrprTb7MZ9TVJUh+azhLnawu0enjlRoYl3DXz7K0x6qH+4KS5nqeDftta/b1 IEM/FY0gs6Kt5YWAXhDy0UffnZU5UV9HCxSqJAeHTKh7U16ghO7vvmu9yewTCwzLedJF uvNlWAV4t4Ch88Nu52mVU+0wU5kuj8/ovwe+Q4YbZ+SaSONTc3cGJOTrM1VTvFjPTjVi VFCg== X-Gm-Message-State: APjAAAWFPvyq9oTsyttUWfYCBP3zc759daN4NfxCa+jm1xsENbEfgeyp QFhgo6L5WYggDMWBmXA5lkc= X-Google-Smtp-Source: APXvYqzKwm1QFomdg8CWscGRb5LiqRq89nxi2TzB0IXcXNJB8ZA36yHxWHJ5aVOeI9cnjuXGq1rb6A== X-Received: by 2002:a05:620a:1398:: with SMTP id k24mr55168392qki.307.1554251274730; Tue, 02 Apr 2019 17:27:54 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a37:4c4c:: with SMTP id z73ls92048qka.8.gmail; Tue, 02 Apr 2019 17:27:54 -0700 (PDT) X-Received: by 2002:a37:ef1a:: with SMTP id j26mr8153927qkk.32.1554251274370; Tue, 02 Apr 2019 17:27:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554251274; cv=none; d=google.com; s=arc-20160816; b=hS3agD5ZJguiZUpNMJMaH1B0NCOqGMlNzB3XidJe/i68wXQ25n/MYdvyz2Q/K0Vg7q LW8/JwaaJhkwz2fLynDBdS0vFkVQBiQmc48lOEHu2Wtj1OyEnAJF7xZlsEvA0SWggZkV 4jG1EACZt//HcUXVJ/D77x0/g2eexslWMJ9oxhhJ6N+JUhfC7SN6LwZWuIa/HogiXZCu S5W2TnTEi04S0z6yOFI1OoeYnoIbgFwMSyMtIb3ymBVWruAghmUoJbY4nApShacvmEET Oe8qFdHrjs+199l5LGWLhP8s8kDI4Io6K1hUAXBuua78xEJX6pRGqmNJ74HHZYIFQfwy OqEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:mime-version:dkim-signature; bh=JrIx5J6uUa1MZnZF/vtAK5RUnuslMjMfqaajafZmtrI=; b=0Wh+ue5qPjt/9NyjS/e1LOhItlg6jgfts5clxJvnu4DerTdGt6lQ3BRFrBfbD4cEae uhSnwpg/Loq+cbq4Xe902w4aUEGi5DXW84KAFsJW5UW4BZS/IOkjWkSt0Til4ll1cRgv /Mg3b/xgVx1tvet8ulzGSHRn4KeAG0IU3sqKL6WAJntKQiyBo6CtkQB0BBoCFSuWYf1P KMKzixvaXnEaUldubPD7TitPaoSvpah9trpUEUA8jNutaVJjZfNiU63aB/w7B5G26b4Z lJQVO3iKas/TMxwg4OoSrhtxF773X1HRfOUNRpcOJ89rUtyeWMZIvhhEc05hARYHd0D2 8E4A== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@planetinnovation.com.au header.s=google header.b=jjLBrrtq; spf=pass (google.com: domain of austin.phillips@planetinnovation.com.au designates 2607:f8b0:4864:20::534 as permitted sender) smtp.mailfrom=austin.phillips@planetinnovation.com.au; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=planetinnovation.com.au Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com. [2607:f8b0:4864:20::534]) by gmr-mx.google.com with ESMTPS id h57si302092qtk.3.2019.04.02.17.27.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Apr 2019 17:27:54 -0700 (PDT) Received-SPF: pass (google.com: domain of austin.phillips@planetinnovation.com.au designates 2607:f8b0:4864:20::534 as permitted sender) client-ip=2607:f8b0:4864:20::534; Received: by mail-pg1-x534.google.com with SMTP id y3so7355946pgk.12 for ; Tue, 02 Apr 2019 17:27:54 -0700 (PDT) MIME-Version: 1.0 X-Received: by 2002:a63:7153:: with SMTP id b19mr63325616pgn.289.1554251273614; Tue, 02 Apr 2019 17:27:53 -0700 (PDT) Received: from localhost.localdomain (gen-180-189-155-42.ptr4.otw.net.au. [180.189.155.42]) by smtp.googlemail.com with ESMTPSA id a8sm24053568pfo.144.2019.04.02.17.27.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 02 Apr 2019 17:27:52 -0700 (PDT) X-Patchwork-Original-From: "'Austin Phillips' via swupdate" From: 'Darko Komljenovic' via swupdate To: swupdate@googlegroups.com Cc: Austin Phillips Subject: [swupdate] [meta-swupdate][PATCH V2] Add SWUPDATE_LIST_FOR_CPIO to allow explicit SWU file inclusion Date: Wed, 3 Apr 2019 11:27:21 +1100 Message-Id: <1554251241-86395-1-git-send-email-austin.phillips@planetinnovation.com.au> X-Mailer: git-send-email 2.7.4 X-Original-Sender: austin.phillips@planetinnovation.com.au X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@planetinnovation.com.au header.s=google header.b=jjLBrrtq; spf=pass (google.com: domain of austin.phillips@planetinnovation.com.au designates 2607:f8b0:4864:20::534 as permitted sender) smtp.mailfrom=austin.phillips@planetinnovation.com.au; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=planetinnovation.com.au X-Original-From: Austin Phillips Reply-To: Austin Phillips 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: , By default, swupdate.bbclass includes all files fetched by the Yocto recipe in the SWU cpio archive. This change adds a new variable SWUPDATE_LIST_FOR_CPIO which, when specified, allows for explicit control of which additional files are added to the SWU image This is useful when the default fetch file list isn't suitable for inclusion in the SWU image. Fix inheritance of swupdate-common bbclass by removing unwanted .bbclass suffix. Signed-off-by: Austin Phillips --- README | 42 ++++++++++++++++++++++++++++++++++++++++++ classes/swupdate.bbclass | 14 +++++++++++--- 2 files changed, 53 insertions(+), 3 deletions(-) diff --git a/README b/README index ffc8f33..31baa11 100644 --- a/README +++ b/README @@ -57,6 +57,48 @@ which is included in the SWU file. Encrypted private keys are not currently supported since a secure mechanism must exist to provide the passphrase. +SWU image contents +---------- +By default the SWU image will include all files fetched by the Yocto +fetcher as specified in recipe SRC_URI variable. If this behaviour is not +suitable, an explicit list of file inclusions can be specified by +setting `SWUPDATE_LIST_FOR_CPIO` to a list of source file paths to be +included in the SWU image. + +This may be useful in cases where additional build steps are +introduced prior to the swuimage task to pre-process fetched source files +or files are generated as part of the recipe for inclusion in the SWU +image. + +e.g. + +Let's assume an additional pre-processing step is required to +inject some content to sw-description before its inclusion in the SWU. + +A Yocto recipe may include a configuration like the following: + +... + +SRC_URI := "\ + file://sw-description.conf" \ + file://my-version-file \ +" + +inherit swupdate + +python do_swuimage_prepend () { + # Preprocess sw-description.conf, injecting version information + # from my-version-file to produce sw-description. + # Generate another file 'foo' for inclusion in SWU. +} + +# Explicit list of additional files to include in SWU archive. +# Prevent sw-description.conf and my-version-file from being included +# in the archive by using an explicit list of file inclusions. +# sw-description is included by default. +SWUPDATE_LIST_FOR_CPIO = "${WORKDIR}/foo" + + Maintainer ---------- diff --git a/classes/swupdate.bbclass b/classes/swupdate.bbclass index 1d74eef..8167479 100644 --- a/classes/swupdate.bbclass +++ b/classes/swupdate.bbclass @@ -11,7 +11,7 @@ # To use, add swupdate to the inherit clause and set # set the images (all of them must be found in deploy directory) # that are part of the compound image. -inherit swupdate-common.bbclass +inherit swupdate-common S = "${WORKDIR}/${PN}" @@ -74,8 +74,16 @@ python do_swuimage () { if d.getVar('SWUPDATE_SIGNING', True): list_for_cpio.append('sw-description.sig') - for url in fetch.urls: - local = fetch.localpath(url) + # Default to obtaining list of additional cpio members from fetch sources. + # The SWUPDATE_LIST_FOR_CPIO can be used to override the default list + # to specify a custom set of cpio members. + swupdate_list_for_cpio = d.getVar('SWUPDATE_LIST_FOR_CPIO', True) + if swupdate_list_for_cpio is None: + swupdate_list_for_cpio = [fetch.localpath(url) for url in fetch.urls] + else: + swupdate_list_for_cpio = swupdate_list_for_cpio.split() + + for local in swupdate_list_for_cpio: filename = os.path.basename(local) if (filename != 'sw-description'): shutil.copyfile(local, os.path.join(s, "%s" % filename ))