All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vivien Didelot <vivien.didelot@gmail.com>
To: Openembedded-core@lists.openembedded.org
Cc: Vivien Didelot <vdidelot@pbsc.com>
Subject: [OE-Core][PATCH 2/2] wic: bootimg-partition: allow empty partition
Date: Sun, 30 Jan 2022 09:25:27 -0500	[thread overview]
Message-ID: <20220130142527.2960188-2-vdidelot@pbsc.com> (raw)
In-Reply-To: <20220130142527.2960188-1-vdidelot@pbsc.com>

It is possible to use the bootimg-partition source plugin to fill an
optional boot partition, e.g. for data files or for kernel artifacts,
in case they aren't embedded in the root filesystem. In these scenarios
such partition may be empty, which is correct.

Instead of erroring out, just warn the user. While at it, make
it clearer how to populate such partition, by mentioning the
IMAGE_BOOT_FILES{,_uuid-<uuid>,_label-<label>} variables, as well as
their presence in WICVARS, which isn't obvious for a new user.

Signed-off-by: Vivien Didelot <vdidelot@pbsc.com>
---
 scripts/lib/wic/plugins/source/bootimg-partition.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/lib/wic/plugins/source/bootimg-partition.py b/scripts/lib/wic/plugins/source/bootimg-partition.py
index f22364766a..d7d9842b8c 100644
--- a/scripts/lib/wic/plugins/source/bootimg-partition.py
+++ b/scripts/lib/wic/plugins/source/bootimg-partition.py
@@ -55,7 +55,8 @@ class BootimgPartitionPlugin(SourcePlugin):
                 break
 
         if boot_files is None:
-            raise WicError('No boot files defined, IMAGE_BOOT_FILES unset for entry #%d' % part.lineno)
+            logger.warn('No boot files defined for entry #%d, %s unset or not in WICVARS.' % (part.lineno, ', '.join(vars)))
+            return
 
         logger.debug('Boot files: %s', boot_files)
 
-- 
2.35.0



      reply	other threads:[~2022-01-30 19:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-30 14:25 [OE-Core][PATCH 1/2] wic: bootimg-partition: simplify BOOT_IMAGE_FILES logic Vivien Didelot
2022-01-30 14:25 ` Vivien Didelot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220130142527.2960188-2-vdidelot@pbsc.com \
    --to=vivien.didelot@gmail.com \
    --cc=Openembedded-core@lists.openembedded.org \
    --cc=vdidelot@pbsc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.