From patchwork Fri Jan 16 09:32:10 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 78924 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 054E0D4A61D for ; Fri, 16 Jan 2026 09:32:25 +0000 (UTC) Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.2464.1768555940215647709 for ; Fri, 16 Jan 2026 01:32:20 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ZTN5sP8b; spf=pass (domain: amarulasolutions.com, ip: 209.85.218.45, mailfrom: adam.duskett@amarulasolutions.com) Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-b8719f5a2b5so33329766b.3 for ; Fri, 16 Jan 2026 01:32:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1768555938; x=1769160738; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=QzRIDMqUJl+hD74DDhM01pKGrpdlHt8Cj43+PhA6ebE=; b=ZTN5sP8b0zpj/e5lgHnsPrHt1cGBVpKj52t8PI6EQeG3PY/1zbDwsqcBrqsr5irtYz Cs6syWaFAbo4rut2/fvFzH1Jweg6acpt9p9I8RBuTjZOtU7mbq2o9Tb81lUhwMvMirVM bosnla6fXXZbt7qf5KvWdCy5Of4EYu8H3Y5o8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768555938; x=1769160738; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=QzRIDMqUJl+hD74DDhM01pKGrpdlHt8Cj43+PhA6ebE=; b=b855WQnVLAIUW/brJnQxT01zDbZPd0xjVcWNoT3Wt4pUySLMulbNaT6US4GMrAx1nb 1+pD1hpPxjzNBA8zV4B8r8RdNJvD1fQGQPcCGe/HbzH63v3UHjxz1HPaMnq521Xoh+Kg CyV4OqrB0WybO+SiEjj/oFt07hKzTrtSOMIf2kJhXPKLJwMzSE1kEO5rg8yjXJsF1VG5 RU6Fd1OWRMSBWsypxYWfRocxBCVTJo6Yx2GX15ysTTczyifPFXCDN5R5Psx35/OU6I/S YUUA14FVbSlwnOuzcYw81jxpvaX5z5TQwSEGJNU9en8vZHHDHTOTKMbR9SKqLsoQfHeR 14MA== X-Gm-Message-State: AOJu0YwXS00gq+sBcLrSe1PNjtUHI8IGYL4xOvt+TyuybUB9zlnZMErP uKRrBiHuh/ks4QZklHKCc6Y/bRu1Ub8yCS7le81L5t9RYlqHtumX75aaRkaNMfxSS8X33QgSF6H J7RBb X-Gm-Gg: AY/fxX7Jj5/Mw2YtlHsolAhuv4o+4ShB7B++02B4VkNGMhjFQUK4JopRIZwVbCDJgSX ZhlEytk7AZ/5EO/SV+5cSpN1zKfbtZk75VXFn/qCgMxrDitlZf1YU4EbHrVCzezexCZrbzFYCaR b+evexlTQbJgGkBreMa2w5irJGAu433w9no2A07hPc/FDd+lhcpWPKFXfCSmVqYBq6fIfBaY3Y3 QFolzPuliO+3o6QSc9mPvhzQFYiO6BrBqOeq0PXxZ3JGXmi9TPp0t/o707G011WA5upl3yS5euT bab2s7qf6Wu9ZkSTo0wKvKVBZnAED/USSnE3pjObLYJNFgKKI2K3lkOd8F9tcsbGayoSUu63XBE ZA7DVURSi1kTBZsL27+cceojptCFjsyvEY7ER+y/PHnkAYbeas9qxFk6tTiUpojLPnH7QXwN00X mEY1YHrwFK0gyV3ZrejIFRq8TG2ZdjOD+k3H5qIE2TWBXtFTLrugsBUrpMoHaydWrDYJ15HJwZP /4tjJS0mPRIIMXjON9BHXBOp73XEZgKJK9Rnx8veJV40/VdIWfI X-Received: by 2002:a17:907:96ac:b0:b86:feb2:543 with SMTP id a640c23a62f3a-b87932f09c8mr105264166b.8.1768555938297; Fri, 16 Jan 2026 01:32:18 -0800 (PST) Received: from adam.arnhem.chello.nl (2001-1c00-8101-1200-3ddc-5bb8-0efa-16f1.cable.dynamic.v6.ziggo.nl. [2001:1c00:8101:1200:3ddc:5bb8:efa:16f1]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b879513e6d3sm187982366b.4.2026.01.16.01.32.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jan 2026 01:32:17 -0800 (PST) From: Adam Duskett To: openembedded-core@lists.openembedded.org Cc: Adam Duskett Subject: [PATCH v5 1/6] wic: extra-partition: Small code cleanup Date: Fri, 16 Jan 2026 10:32:10 +0100 Message-ID: <20260116093215.26108-1-adam.duskett@amarulasolutions.com> X-Mailer: git-send-email 2.52.0 MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 16 Jan 2026 09:32:25 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/229531 - Remove redundant charachter escaped in the src_entry regex call. - Remove an uneeded semicolon for cls.install_task. - we copies -> we copy Signed-off-by: Adam Duskett --- scripts/lib/wic/plugins/source/extra_partition.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/lib/wic/plugins/source/extra_partition.py b/scripts/lib/wic/plugins/source/extra_partition.py index d370b0107e..a1d9aa9a7b 100644 --- a/scripts/lib/wic/plugins/source/extra_partition.py +++ b/scripts/lib/wic/plugins/source/extra_partition.py @@ -69,7 +69,7 @@ class ExtraPartitionPlugin(SourcePlugin): # list of tuples (src_name, dst_name) deploy_files = [] - for src_entry in re.findall(r'[\w;\-\./\*]+', extra_files): + for src_entry in re.findall(r'[\w;\-./*]+', extra_files): if ';' in src_entry: dst_entry = tuple(src_entry.split(';')) if not dst_entry[0] or not dst_entry[1]: @@ -80,7 +80,7 @@ class ExtraPartitionPlugin(SourcePlugin): logger.debug('Destination entry: %r', dst_entry) deploy_files.append(dst_entry) - cls.install_task = []; + cls.install_task = [] for deploy_entry in deploy_files: src, dst = deploy_entry if '*' in src: @@ -111,7 +111,7 @@ class ExtraPartitionPlugin(SourcePlugin): """ Called to do the actual content population for a partition i.e. it 'prepares' the partition to be incorporated into the image. - In this case, we copies all files listed in IMAGE_EXTRA_PARTITION_FILES variable. + In this case, we copy all files listed in IMAGE_EXTRA_PARTITION_FILES variable. """ extradir = "%s/extra.%d" % (cr_workdir, part.lineno) From patchwork Fri Jan 16 09:32:11 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 78929 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26478D46603 for ; Fri, 16 Jan 2026 09:32:25 +0000 (UTC) Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.2428.1768555940993560258 for ; Fri, 16 Jan 2026 01:32:21 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=BJpWbVjj; spf=pass (domain: amarulasolutions.com, ip: 209.85.218.53, mailfrom: adam.duskett@amarulasolutions.com) Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-b8719f5a2b5so33331566b.3 for ; Fri, 16 Jan 2026 01:32:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1768555939; x=1769160739; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=s/+AV/zXln/QnECKSwHy4iuUjEmpKREEs/qjLDqP/T0=; b=BJpWbVjjIDHF+Znn15Yxr+JQTZB9gOxDZpiPo74tYFbRfE4gxAJ8uTRD/Owgz6fXOx erIIjY27oOYs5TmHuG5QUU8jGxFsw85EheKS4I+lGxIHliNStvjLpXcG55Os4m97czi6 5Kw4pNXZfByYKMZsbm0YUX6/OKde38EQtXX1k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768555939; x=1769160739; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=s/+AV/zXln/QnECKSwHy4iuUjEmpKREEs/qjLDqP/T0=; b=EDwOh7J77iZFypDc1/wwPZfb91tp5AdbmDINOHJ0gqQnQMN4LoQgH3l2f/T4PdDce3 S1ePV0FQHhEvO+cH4/VOt1mryEMgh3avgNyQ3dSVAvPHuo6qDq1sN/46HeWy2R+j4kzW 1n6oMLIMuk2gTSdnQTJLgSU0v0wHGfG7UbNkeBXutLnCk0PlILhhSOR1ywAZcgPbsq78 gxTE3Pv/mLcdsP+zlgjZ8ZP2oaV+lZoCz+EvZvPWz1cnqMqszViXrOCHWwkMFeuD09qA ZASQlyb2djeFQsvjYyLJOuGnBpIC8J3/JfZDfa71ndNR0yAp9tu46iCLZcZZMQVDQQLV w5vg== X-Gm-Message-State: AOJu0YyKs19axfWs+GOSTDoRLDWW1BUE3D8aiOYrU+3ZqyXzqKRoRJkm wcJcMBSdjGsdwwlOB/42JZVYkJ/4NMC+HG9I2+aY6iTXpxgPuKN6q7/Uw+8GV1XqfNa05pWsUpf m49gG X-Gm-Gg: AY/fxX78xiWAlpGwiq689vuBY2mh7r+9oVaYAg2qJHXAQwWiMdmx0i1BG8n+/QcZCJb ggc3DlfTnBoPgmEkjC5Kh0HHfDnH9fZiSpGara82UUdYyxV5dVH7ivB9MLJCYV+gnIXBNQvvEaQ nAfsBrwe37SLjHPAurjF1cH/wQKPCvuUrRL5xNDcK70o1JUubmibEbyCqU4enp/2HLRztl8sD73 aZomSAar872RuC8GAIQcmv9rokOMubgYTnELmUOB0YtU3vEzCPZmCkbkEuHSLOAcZQ61HmP+7KO xmXD5x+K09hFawWn1SWzR+QdBEiEZtK2DpGC2PH5J4uJv/pr7u/m+hJPs1vhB7wwDOCnxX/9hbg 3VyHw0xZeKS+nzoipx7of2UtnPR+at7Y07wRDc8hD2k/jPEX8A0Vz7jLGFdcd24cM2RmYVsOajQ bEbgdpIOMR8L8+iq+pbxXCvr77NLFGR2xlMmY26Cqc9WajU2jkt7fgoSccZmwYRko0wDow89Zm7 H8UowXYS180pVLwo7Breiaq4CCxHLOuGPYF4MX/t30br19diUuc X-Received: by 2002:a17:907:9307:b0:b76:2667:7736 with SMTP id a640c23a62f3a-b8793044c34mr124218266b.4.1768555939124; Fri, 16 Jan 2026 01:32:19 -0800 (PST) Received: from adam.arnhem.chello.nl (2001-1c00-8101-1200-3ddc-5bb8-0efa-16f1.cable.dynamic.v6.ziggo.nl. [2001:1c00:8101:1200:3ddc:5bb8:efa:16f1]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b879513e6d3sm187982366b.4.2026.01.16.01.32.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jan 2026 01:32:18 -0800 (PST) From: Adam Duskett To: openembedded-core@lists.openembedded.org Cc: Adam Duskett Subject: [PATCH v5 2/6] wic: extra-partition: Move extra file parsing to a dedicated method Date: Fri, 16 Jan 2026 10:32:11 +0100 Message-ID: <20260116093215.26108-2-adam.duskett@amarulasolutions.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260116093215.26108-1-adam.duskett@amarulasolutions.com> References: <20260116093215.26108-1-adam.duskett@amarulasolutions.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 16 Jan 2026 09:32:25 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/229532 For organizational purposes, and to make the following patches easier to follow, move the extra file parsing to a dedicated method. Signed-off-by: Adam Duskett --- .../lib/wic/plugins/source/extra_partition.py | 35 +++++++++++-------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/scripts/lib/wic/plugins/source/extra_partition.py b/scripts/lib/wic/plugins/source/extra_partition.py index a1d9aa9a7b..aa4fb931c2 100644 --- a/scripts/lib/wic/plugins/source/extra_partition.py +++ b/scripts/lib/wic/plugins/source/extra_partition.py @@ -37,20 +37,11 @@ class ExtraPartitionPlugin(SourcePlugin): image_extra_partition_files_var_name = 'IMAGE_EXTRA_PARTITION_FILES' @classmethod - def do_configure_partition(cls, part, source_params, cr, cr_workdir, - oe_builddir, bootimg_dir, kernel_dir, - native_sysroot): + def _parse_extra_files(cls, part, kernel_dir): """ - Called before do_prepare_partition(), list the files to copy + Parse the files of which to copy. """ - extradir = "%s/extra.%d" % (cr_workdir, part.lineno) - install_cmd = "install -d %s" % extradir - exec_cmd(install_cmd) - - if not kernel_dir: - kernel_dir = get_bitbake_var("DEPLOY_DIR_IMAGE") - if not kernel_dir: - raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting") + deploy_files = [] extra_files = None for (fmt, id) in (("_uuid-%s", part.uuid), ("_label-%s", part.label), ("_part-name-%s", part.part_name), (None, None)): @@ -66,9 +57,6 @@ class ExtraPartitionPlugin(SourcePlugin): raise WicError('No extra files defined, %s unset for entry #%d' % (cls.image_extra_partition_files_var_name, part.lineno)) logger.info('Extra files: %s', extra_files) - - # list of tuples (src_name, dst_name) - deploy_files = [] for src_entry in re.findall(r'[\w;\-./*]+', extra_files): if ';' in src_entry: dst_entry = tuple(src_entry.split(';')) @@ -103,6 +91,23 @@ class ExtraPartitionPlugin(SourcePlugin): else: cls.install_task.append((src, dst)) + @classmethod + def do_configure_partition(cls, part, source_params, cr, cr_workdir, + oe_builddir, bootimg_dir, kernel_dir, + native_sysroot): + """ + Called before do_prepare_partition(), list the files to copy + """ + extradir = "%s/extra.%d" % (cr_workdir, part.lineno) + install_cmd = "install -d %s" % extradir + exec_cmd(install_cmd) + + if not kernel_dir: + kernel_dir = get_bitbake_var("DEPLOY_DIR_IMAGE") + if not kernel_dir: + raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting") + + cls._parse_extra_files(part, kernel_dir) @classmethod def do_prepare_partition(cls, part, source_params, cr, cr_workdir, From patchwork Fri Jan 16 09:32:12 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 78926 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22514D44C4E for ; Fri, 16 Jan 2026 09:32:25 +0000 (UTC) Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.2429.1768555942141668046 for ; Fri, 16 Jan 2026 01:32:22 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=f/UGK1KL; spf=pass (domain: amarulasolutions.com, ip: 209.85.218.52, mailfrom: adam.duskett@amarulasolutions.com) Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-b872cfd35cfso32964666b.1 for ; Fri, 16 Jan 2026 01:32:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1768555940; x=1769160740; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XS839wYQCt34M6w0vqSouQF8mgM5YG3VWs2swfA2GQA=; b=f/UGK1KLkzA1BU2D0d1dWxtMMAtpVv2506j+6+IizwSPdH5GQ6y87U8tDQMWCEJhvM fhv4W+L98KuiJnbt9eJHs/9ar5+1eBlI3LPip2IIQihHfz+nVNXTFDYxfeY0vNEcIRQ4 VlFdvQDSlaEYW05t5rFlQ/Twai/ecBi7EmZ6M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768555940; x=1769160740; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=XS839wYQCt34M6w0vqSouQF8mgM5YG3VWs2swfA2GQA=; b=NUVhcPtzQmC7E/8wyJcmTA+gIz2sNxh3ZU46RD+9EiE9jyiPPePK1NIC8ALBDfvWS/ qkgbgZ3WUICTqgQCTabAUv0aJFhv7P0m96gyZWq3FC1Iq3aD/6sD9y3QQaMkrmpcrqql x3XnXIiOKES+rPC8eO6jcVWLpoRruVqBcFIggG4yiDRmS4aNoTocEbkJ0qUEADdpi+Qu FgY+j13IvIjR48R97KHQLyuMgIOCptkA/BQLA5TN3o8qLb6VEqW+L1SXno/DQIwjTtFH znaXEvfcQaIq6hQ66GVVsHFBUG1XxVRPocgD6muK//MM0lSPM1WUrtjscXdpRzyWO7VU 5QRg== X-Gm-Message-State: AOJu0Yyl6DCZ3gUmPX+JBcX7UmkcGeqqjOTvb1b89d/0XhPpsXEr8FhB IKX9DkEOtZ3VAvuSj5BK7BurIoW3LN6Qo4e6qcjWStigrSnPQfByFvWT4lTEtvrIt837Wk6Sqjf YN6Yu X-Gm-Gg: AY/fxX4DsnCdz7p3eizbXU8brOIbpg9ZJV+8nrL+8Slq+0UGpStxqQ3QcL3NMYpeIMb mgflmbAL10FoWWkGR6UPGozJtDLsr+YiA+AWf6VyGeNaJ43J7Lf9rKL1R9T6NSBH5juOrqyoMfu oWdF7qGWHEGrULfUfX0PFYAM8DTXpr+UzQXX6U4tXX0U5ctd6mvmJFiTexXasSbPeruAL8Fg6nF vtYCheIJChicIpwckSqxShCmSejYNajCrirjXUxEWfx7PELHMR6+lJPZoY3FlSicTzPaun3pTS2 B3B60v05oKI2Xsp9OywlWewhKcK16j0fdb/oV7gnwHswSNPsT/nxGy32AnMUxzk46PE5hHMiTUt mUSqCNcwPrOc3zcKH7GqvDjaviFP1ik9aJATTlRN4odOGgBvOKmdEvCtASJQacf+G7+s2XUK/Lp O9kUsBsYhuOFUJsOf3FOSbWv1/ekDWP7NJkNRUoSkcX3wUzFobmMqeZKlP1rfYYlE1Q8Sez9urX oRTX0CWHeapBPfB7LoT45SgrVWOA1w6AAoakowVNUfmOoT++P2K X-Received: by 2002:a17:907:7201:b0:b86:f194:9ed5 with SMTP id a640c23a62f3a-b8792dff55emr141564966b.1.1768555940015; Fri, 16 Jan 2026 01:32:20 -0800 (PST) Received: from adam.arnhem.chello.nl (2001-1c00-8101-1200-3ddc-5bb8-0efa-16f1.cable.dynamic.v6.ziggo.nl. [2001:1c00:8101:1200:3ddc:5bb8:efa:16f1]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b879513e6d3sm187982366b.4.2026.01.16.01.32.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jan 2026 01:32:19 -0800 (PST) From: Adam Duskett To: openembedded-core@lists.openembedded.org Cc: Adam Duskett Subject: [PATCH v5 3/6] wic: extra-partition: Move extra var handling to a dedicated method Date: Fri, 16 Jan 2026 10:32:12 +0100 Message-ID: <20260116093215.26108-3-adam.duskett@amarulasolutions.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260116093215.26108-1-adam.duskett@amarulasolutions.com> References: <20260116093215.26108-1-adam.duskett@amarulasolutions.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 16 Jan 2026 09:32:25 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/229533 For organizational purposes, and to make the following patches easier to follow, move the extra file parsing to a dedicated method. Signed-off-by: Adam Duskett --- .../lib/wic/plugins/source/extra_partition.py | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/scripts/lib/wic/plugins/source/extra_partition.py b/scripts/lib/wic/plugins/source/extra_partition.py index aa4fb931c2..05b0ace361 100644 --- a/scripts/lib/wic/plugins/source/extra_partition.py +++ b/scripts/lib/wic/plugins/source/extra_partition.py @@ -36,6 +36,20 @@ class ExtraPartitionPlugin(SourcePlugin): name = 'extra_partition' image_extra_partition_files_var_name = 'IMAGE_EXTRA_PARTITION_FILES' + @classmethod + def _get_extra_vars(cls, part, var_name): + """Get extra partition directory or file variables""" + extra_vars = None + for (fmt, id) in (("_uuid-%s", part.uuid), ("_label-%s", part.label), ("_part-name-%s", part.part_name), (None, None)): + var = "" + if fmt: + var = fmt % id + thing = var_name + var + extra_vars = get_bitbake_var(thing) + if extra_vars is not None: + break + return extra_vars + @classmethod def _parse_extra_files(cls, part, kernel_dir): """ @@ -43,16 +57,7 @@ class ExtraPartitionPlugin(SourcePlugin): """ deploy_files = [] - extra_files = None - for (fmt, id) in (("_uuid-%s", part.uuid), ("_label-%s", part.label), ("_part-name-%s", part.part_name), (None, None)): - if fmt: - var = fmt % id - else: - var = "" - extra_files = get_bitbake_var(cls.image_extra_partition_files_var_name + var) - if extra_files is not None: - break - + extra_files = cls._get_extra_vars(part, cls.image_extra_partition_files_var_name) if extra_files is None: raise WicError('No extra files defined, %s unset for entry #%d' % (cls.image_extra_partition_files_var_name, part.lineno)) From patchwork Fri Jan 16 09:32:13 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 78925 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0549ED4A61C for ; Fri, 16 Jan 2026 09:32:25 +0000 (UTC) Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.2465.1768555942395956953 for ; Fri, 16 Jan 2026 01:32:22 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=omleZTjD; spf=pass (domain: amarulasolutions.com, ip: 209.85.218.48, mailfrom: adam.duskett@amarulasolutions.com) Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-b873a14bb99so31381466b.1 for ; Fri, 16 Jan 2026 01:32:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1768555941; x=1769160741; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/8y/CmP55xsrs5A90HHpW0hBBV/60nVQ8jDDmIqJBeQ=; b=omleZTjDIM1jWuH0IZML/ve2TGUnfkpLgkjcg6oomxSC/PibeAioTYSLu43etdxz8Z 5D/1EszgmQAXR3ZL0XU+RxMjwjv6LCfmFJLLOPlRUqTs3Ua1SHXPV3JSnBHzP6Tz8223 6ShE+JpyA8ACIfyDohRhlvkiB/DZnnmt37C2w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768555941; x=1769160741; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=/8y/CmP55xsrs5A90HHpW0hBBV/60nVQ8jDDmIqJBeQ=; b=n/r1Wwjv4xApnguOc/IQ7GTyC7veeg9sgakqB2xfWx9yhDFAKgW3hvap4TV5dAGV2W 6dgeIK0Z6+xy3dFI+fUDYBdkcb2X1tvTNfdHb68sulQ87oOjhrec1BcUtvAGV/M82Yte rcJnKH0ZtMlODyEnMVPs5SPqRNN/8LP86ovljNRzx/yFjGOSDFt085aNBEtbf2eCg0rZ l49WuL6buh1aVFcq762NIqJ1YiIiDBHFtwHMOjGQgmro40WweUcEVJEwJHP6i5K/fGF6 fcFXU51GU5TwrVmnTwtdDi4bPPfIqZ+eq5dUtORbRB/h8zh9G8tu3e0/N7Kxg6yTBAhs 20ag== X-Gm-Message-State: AOJu0YxMLmiy/iv9+BIuyUgCXosjGt8f8EW9HjJl0nPkL+Hs93L4vOuw flz+CXIvK1Jwij4nd10tJHFUszrkF6wqXrkFkCSpYBSa+JPN+YQiJfMHXn06yvf2B5a61oNR21p XdORz X-Gm-Gg: AY/fxX5HGP2iViraG+9OgNRZN+cy2f1AId74xouG2Edba5AhxZ2Corp76tRsxc+VZtz aIWZuTc4w1AZY4Jl+dfs0dh5rAyZDLRj4pGNoQ3jXavYlxAawJt2ilVYYaOL+kP+95BvxLTG/jv w5OuWeStqfCWI6YEG+RSb8AzLQlcEFByVkVRVsMaCha3Meky02S3J7W1FnUuwN7Nr1zsFZsEOeh GGX8wKfDZZeUm4ARFzVoEm58OgJxE7CF9YgemboHIV/HmfoSWdx+njoOyVm/8wyBw4kDDsKtBJS fPjS4/AbC7DEJbw7mcWM1yibV9O4I3UVmWW+tFb+kTD9+4E7ZeRJLvifzPTQlK6z1tVQbhJawKc 9uVWIZ7Vz2LZGsFJtvLBqA9m4Vu22MdYq1sj3jqb58IrDh9CGnUfC+hEsF9s34rjvOZErz8du4k YExzXrgVZlW8rHz/sFyXICN3qWKukXHVLyAHJciPt9uCoVJ2iu9u6Pl25vEup8FocjE7xkwwpp5 eD68ykoHrMTsDNU3YAFZCxdOc6B/aoUXN4T0+JWdaMWJ9lWdkvq X-Received: by 2002:a17:907:928b:b0:b87:1e1:e562 with SMTP id a640c23a62f3a-b879330b4e2mr92197566b.8.1768555940754; Fri, 16 Jan 2026 01:32:20 -0800 (PST) Received: from adam.arnhem.chello.nl (2001-1c00-8101-1200-3ddc-5bb8-0efa-16f1.cable.dynamic.v6.ziggo.nl. [2001:1c00:8101:1200:3ddc:5bb8:efa:16f1]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b879513e6d3sm187982366b.4.2026.01.16.01.32.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jan 2026 01:32:20 -0800 (PST) From: Adam Duskett To: openembedded-core@lists.openembedded.org Cc: Adam Duskett Subject: [PATCH v5 4/6] wic: extra-partition: Rename install_task to extra_files_task Date: Fri, 16 Jan 2026 10:32:13 +0100 Message-ID: <20260116093215.26108-4-adam.duskett@amarulasolutions.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260116093215.26108-1-adam.duskett@amarulasolutions.com> References: <20260116093215.26108-1-adam.duskett@amarulasolutions.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 16 Jan 2026 09:32:25 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/229534 Rename install_task to extra_files_task for clarity Signed-off-by: Adam Duskett --- v1 -> v2: If the list is blank, print a warning instead of an info. v2 -> v4: Raise an error in do_prepare_partition instead of making extra files optional. Extend error message. scripts/lib/wic/plugins/source/extra_partition.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/lib/wic/plugins/source/extra_partition.py b/scripts/lib/wic/plugins/source/extra_partition.py index 05b0ace361..25aab06c52 100644 --- a/scripts/lib/wic/plugins/source/extra_partition.py +++ b/scripts/lib/wic/plugins/source/extra_partition.py @@ -73,7 +73,7 @@ class ExtraPartitionPlugin(SourcePlugin): logger.debug('Destination entry: %r', dst_entry) deploy_files.append(dst_entry) - cls.install_task = [] + cls.extra_files_task = [] for deploy_entry in deploy_files: src, dst = deploy_entry if '*' in src: @@ -92,9 +92,9 @@ class ExtraPartitionPlugin(SourcePlugin): for entry in srcs: src = os.path.relpath(entry, kernel_dir) entry_dst_name = entry_name_fn(entry) - cls.install_task.append((src, entry_dst_name)) + cls.extra_files_task.append((src, entry_dst_name)) else: - cls.install_task.append((src, dst)) + cls.extra_files_task.append((src, dst)) @classmethod def do_configure_partition(cls, part, source_params, cr, cr_workdir, @@ -130,7 +130,7 @@ class ExtraPartitionPlugin(SourcePlugin): if not kernel_dir: raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting") - for task in cls.install_task: + for task in cls.extra_files_task: src_path, dst_path = task logger.debug('Install %s as %s', src_path, dst_path) install_cmd = "install -m 0644 -D %s %s" \ From patchwork Fri Jan 16 09:32:14 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 78927 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11B86D4A61E for ; Fri, 16 Jan 2026 09:32:25 +0000 (UTC) Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.2430.1768555943344694611 for ; Fri, 16 Jan 2026 01:32:23 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=bc5ZC8bG; spf=pass (domain: amarulasolutions.com, ip: 209.85.218.41, mailfrom: adam.duskett@amarulasolutions.com) Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-b873a14bb99so31382266b.1 for ; Fri, 16 Jan 2026 01:32:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1768555942; x=1769160742; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=S99T4vgAePKPALbCfmoILnJKJ1GE7hrHgy0gSJZsklg=; b=bc5ZC8bGIo9MsYE2A1CD734eRU8GKk/HQrGVmdsycNoyso3jjozD5AJI/m7rVAXCjn mmPOPyg8BsupbqhBnmhU4/VYSLVb9LUQENMtBr/Px5Rl7u5x1HTCTtyVaMF6uh7gaNbr JYg0jtm87bhzTIR0iwPf79zIhrKo6XA6rQIeo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768555942; x=1769160742; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=S99T4vgAePKPALbCfmoILnJKJ1GE7hrHgy0gSJZsklg=; b=tOr/1CzxJwER+2dLHmu1/WgbIUF6GCLMCrl2yC0RAs34DLusdrdCrx8IGGG4HUnAZA 9qXEFn+e6VG+dtDvypMbUFBZ6YNJ/MWs+QYnWGrXEoBzjJZfnwEfpEGIEr6vaLioKXrT wY+fPMLiQDNsMFF7P+Z0zC5WNXU3W4pFRsR/VjxJ2UKU36NPK3jEhjEYyR7rgWRZA5y+ Zv2OP0MeBuHiC9iPb1MYfDK14VMc7PbUIPV0ZSOsdmKxMBWcth9fAvz2S/trXW5Pp2wB k9F9uXa8ifn/135XmMwVOdp4T0MtUTnSQZ1mIjNWxKc4Ub4EvKPVBB9laybX65GSpql0 5+uA== X-Gm-Message-State: AOJu0YzvmxTZKGHp00cgRWwHlGpFVy3TuK5TT8hnZiPM6uuCKF6T6O+h hQtaf4ddP0abvb/hJ9dqUdXYiSXs7sXA00wiMJTNpj+LedjuLzbDBAc4ChKLUYrPcUh7R0aGh+e qz6Bh X-Gm-Gg: AY/fxX5mvPxQ8ycSunQtsLe1gZmkE8aT3aRPp7GJXQlKrl8O9OeVmNUb8H70IE2dxCg OKxZvP/4A1NCiYTW3rO9OoSFa963b1OlTiSzamooEly/Olrm2Z5UNjaBH9BRbOIj2kYgOWgQPb0 IBdyZuMYdLTYeKY8IzcRAswXJZq6XvuRejtMDovsWNK+3vkRKEHe4xS1/HVvEQE6k+tTHSCe9/k FMwVmlMc+ogPg6sud8m6tjOylDLvIonvWLW7fFm6puuVKJqmvN2j7kpWG5aqGuROOXnEsJzrH4X CjfWi6lsW1b3Gj30UAWHBZO/K9ngSWbBaap7obbCGdeV/hPGcFYIbYwuKdiXD3hOKkZE+KtPx+J +fVvlYkVjbkiMm988ISaw6D0qZCb1XMRYJ4JzWQFsCp7M0FsGYogDLfGrxpE6EUT2m52QjykvW3 U2dZRnzyxMhWet9kDOC2T6tyefqqdCWGoG5632SWINUL+CR/jo51Ji1yoK9AA3+/VPau31Yow9a 7m62AyVQNriszVLsj2brr87fEKWnVrJXK0QQVCwr0knSwXDE+3r X-Received: by 2002:a17:906:ef03:b0:b87:6a6:5fc2 with SMTP id a640c23a62f3a-b879324832fmr118528266b.5.1768555941600; Fri, 16 Jan 2026 01:32:21 -0800 (PST) Received: from adam.arnhem.chello.nl (2001-1c00-8101-1200-3ddc-5bb8-0efa-16f1.cable.dynamic.v6.ziggo.nl. [2001:1c00:8101:1200:3ddc:5bb8:efa:16f1]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b879513e6d3sm187982366b.4.2026.01.16.01.32.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jan 2026 01:32:20 -0800 (PST) From: Adam Duskett To: openembedded-core@lists.openembedded.org Cc: Adam Duskett Subject: [PATCH v5 5/6] wic: extra-partitions: move extra-files WicError to do_prepare_partition Date: Fri, 16 Jan 2026 10:32:14 +0100 Message-ID: <20260116093215.26108-5-adam.duskett@amarulasolutions.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260116093215.26108-1-adam.duskett@amarulasolutions.com> References: <20260116093215.26108-1-adam.duskett@amarulasolutions.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 16 Jan 2026 09:32:25 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/229535 For organizational purposes, move the raised WicError if extra files isn't provided by a user to the do_prepare_partition method and rewrite the message to be more clear if a user wishes to create an empty partition. The original error is changed to a warning in the event a user has a typo in the variable. For example: IMAGE_EXTRA_PARTITION_FILES_label-fooo = "bar.conf" part --source extra-partition --fstype=ext4 --label foo Signed-off-by: Adam Duskett --- v1 -> v2: If the list is blank, print a warning instead of an info. v2 -> v4: Raise an error in do_prepare_partition instead of making extra files optional. Extend error message. v4 -> v5: Chagne logger.warning to logger.info scripts/lib/wic/plugins/source/extra_partition.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/lib/wic/plugins/source/extra_partition.py b/scripts/lib/wic/plugins/source/extra_partition.py index 25aab06c52..327bc2b8c3 100644 --- a/scripts/lib/wic/plugins/source/extra_partition.py +++ b/scripts/lib/wic/plugins/source/extra_partition.py @@ -55,11 +55,13 @@ class ExtraPartitionPlugin(SourcePlugin): """ Parse the files of which to copy. """ + cls.extra_files_task = [] deploy_files = [] extra_files = cls._get_extra_vars(part, cls.image_extra_partition_files_var_name) if extra_files is None: - raise WicError('No extra files defined, %s unset for entry #%d' % (cls.image_extra_partition_files_var_name, part.lineno)) + logger.info('No extra files defined, %s unset for entry #%d' % (cls.image_extra_partition_files_var_name, part.lineno)) + return logger.info('Extra files: %s', extra_files) for src_entry in re.findall(r'[\w;\-./*]+', extra_files): @@ -73,7 +75,6 @@ class ExtraPartitionPlugin(SourcePlugin): logger.debug('Destination entry: %r', dst_entry) deploy_files.append(dst_entry) - cls.extra_files_task = [] for deploy_entry in deploy_files: src, dst = deploy_entry if '*' in src: @@ -125,6 +126,12 @@ class ExtraPartitionPlugin(SourcePlugin): """ extradir = "%s/extra.%d" % (cr_workdir, part.lineno) + if not cls.extra_files_task: + raise WicError("Entry #%d does not have a corresponding %s variable set!" + "If you wish to create an empty partition, remove " + "--source extra-partition from the wks file" + % (part.lineno, cls.image_extra_partition_files_var_name)) + if not kernel_dir: kernel_dir = get_bitbake_var("DEPLOY_DIR_IMAGE") if not kernel_dir: From patchwork Fri Jan 16 09:32:15 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 78928 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 109ECD3CCAB for ; Fri, 16 Jan 2026 09:32:25 +0000 (UTC) Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.2431.1768555944238553856 for ; Fri, 16 Jan 2026 01:32:24 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=AHRqZB4Q; spf=pass (domain: amarulasolutions.com, ip: 209.85.218.68, mailfrom: adam.duskett@amarulasolutions.com) Received: by mail-ej1-f68.google.com with SMTP id a640c23a62f3a-b87677a8a96so30814366b.2 for ; Fri, 16 Jan 2026 01:32:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1768555942; x=1769160742; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+92Z9aqK/kUEq6LNps1BVB2MaJkDBOyOuE52/clwQ98=; b=AHRqZB4Q7Mb4/NiqPMleIuIjkUMu5Wgm66skfuIRMjl4F7o+ElDKw4VPqogF0dWHnL HAGAbjYNpc3N/POj0dcdoycQMkfLKDohjEDDxPjbpjcdz+71MtsW2uyrYXb3wM2a+p97 nLl+Hq9FJu0/ys5rOke0Ltk6VhZv/VdmbuCRI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768555942; x=1769160742; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=+92Z9aqK/kUEq6LNps1BVB2MaJkDBOyOuE52/clwQ98=; b=flLEUWVKvCqfpl2/TFBldPAxLNmFoAgiy84QZ+13Q3OhAiUpkJX7ZbC5NzYJTB3jQw LZjC5pH6a0oWiANj7wjoSh2FRtifxSiBb8eVNKQcbk8ZofxzvX9XJHqvimGWlylhoOVy D3yaLynoQsxX7ZpAwMhfPXLvrhtB4aibvmp/p1dF3ENmgPcd5QiPlo03iQHgtuShG/nK LTP/AU3pRk/7OPXiQNoDi7TQXzM/7KqwrsdZZsFidNOBMECpZ7q4aAffOUgKywj0Qo2p 4MTQ+U88LDpsNRk1wWfm4D5em+4iOvMU2vrrtSSHVZYu+4SyDcBeDa8ZgfxeesSccFCT cADA== X-Gm-Message-State: AOJu0Yzzj0pmqo1mwk2WyItRxifdfnHm0QQnbJbsDMizcbzra3DmBegN sRFvZvo2AP3PBgDJXtVg2aV7WGHF0nQ1Kw7R8l763bgRMrTmkC1DFXTxaIzhGPy2CRjOt4O+Qtk Qq8uxwOY= X-Gm-Gg: AY/fxX7J1nSqM/GfjMQML14D4eT7B6yYbXP1H0Y+1Pv2AI6RN2k+9hpR/83nRsqowLQ DRW/drTjQzrHepVM24Afq9hnbIuXuX5rx1BYfHvulKJxqTSN+nCec4bjpSG+bUSztYt7nDKlxjQ y3sjKfXuEZkfYK+FnLI0orttf0s54O21feOLFMdcpo8PvB5Ql8C2weNvbsEIJb4UNsNy0hFthFY h9U6Aj9eLe2ezg2uqAJowypffVRVCKjUqvEhK97tnMpCI46qMvxrENIa9IBVy+YkJ4WeAAR/kLD 2h6YZbK37uJ8yRyG5mwwFYHBE9kZMLR/9NdRBEke3uePvf5qgoGFe7Wz1b0wGLu1Sz96IOXjFid vazYH1SuePWg1vPLp7YfDKCGSIQcyaJ8LCtylkrzXmXgmL0S3a1fTnQg+mZipuKvHHkelQwRSFa FWWNNpKtdoFiITyRw861HYB4myKc8Rzyj7R9YhTJ/2UAb6v+4ll+uiT3kmr/EzQvPPwC0VC5GyJ L53wpGJA/2a4oZb9DByKgdBmPJSQejfLi46E8R9HzYIgdeIo/sk X-Received: by 2002:a17:907:3cc9:b0:b87:2780:1b2b with SMTP id a640c23a62f3a-b8793023afdmr107997966b.4.1768555942443; Fri, 16 Jan 2026 01:32:22 -0800 (PST) Received: from adam.arnhem.chello.nl (2001-1c00-8101-1200-3ddc-5bb8-0efa-16f1.cable.dynamic.v6.ziggo.nl. [2001:1c00:8101:1200:3ddc:5bb8:efa:16f1]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b879513e6d3sm187982366b.4.2026.01.16.01.32.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jan 2026 01:32:21 -0800 (PST) From: Adam Duskett To: openembedded-core@lists.openembedded.org Cc: Adam Duskett Subject: [PATCH v5 6/6] wic: extra-partitions: extend to support extra directories Date: Fri, 16 Jan 2026 10:32:15 +0100 Message-ID: <20260116093215.26108-6-adam.duskett@amarulasolutions.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260116093215.26108-1-adam.duskett@amarulasolutions.com> References: <20260116093215.26108-1-adam.duskett@amarulasolutions.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 16 Jan 2026 09:32:25 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/229536 - Add the ability to define a space-delminated list of directories to create on the extra partition. - Extend the fail condition to fail if both extra directories and extra files is not defined. Signed-off-by: Adam Duskett Reviewed-by: Pierre-Loup GOSSE --- v1 -> v2: Make the list space deliminated instead of semicolon deliminated. If the list is blank, print a warning instead of an info. v2 -> v3: Remove uneeded logic in _parse_extra_directories v3 -> v4: Rework to error if extra directories and files are not set. v4 -> v5: Fix double image_extra_partition_dirs_var_name typo Change logger.debug print for consistency Reword plugin description for clarity Add an extra line in the plugin description before the WICVARS Remove extra space between _get_extra_vars and _parse_extra_directories meta/lib/oeqa/selftest/cases/wic.py | 11 ++++ .../lib/wic/plugins/source/extra_partition.py | 60 +++++++++++++++---- 2 files changed, 59 insertions(+), 12 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index d7a9b14658..83072deaae 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py @@ -1657,10 +1657,14 @@ INITRAMFS_IMAGE = "core-image-initramfs-boot" def test_extra_partition_plugin(self): """Test extra partition plugin""" config = dedent("""\ + IMAGE_EXTRA_PARTITION_DIRECTORIES_label-foo = "/test1 /test2/test3" + IMAGE_EXTRA_PARTITION_DIRECTORIES_uuid-e7d0824e-cda3-4bed-9f54-9ef5312d105d = "/test1 /test2/test3" IMAGE_EXTRA_PARTITION_FILES_label-foo = "bar.conf;foo.conf" IMAGE_EXTRA_PARTITION_FILES_uuid-e7d0824e-cda3-4bed-9f54-9ef5312d105d = "bar.conf;foobar.conf" IMAGE_EXTRA_PARTITION_FILES = "foo/*" WICVARS:append = "\ + IMAGE_EXTRA_PARTITION_DIRECTORIES_label-foo \ + IMAGE_EXTRA_PARTITION_DIRECTORIES_uuid-e7d0824e-cda3-4bed-9f54-9ef5312d105d \ IMAGE_EXTRA_PARTITION_FILES_label-foo \ IMAGE_EXTRA_PARTITION_FILES_uuid-e7d0824e-cda3-4bed-9f54-9ef5312d105d \ " @@ -1692,6 +1696,13 @@ INITRAMFS_IMAGE = "core-image-initramfs-boot" result = runCmd("wic ls %s | wc -l" % wicimg) self.assertEqual('4', result.output, msg="Expect 3 partitions, not %s" % result.output) + for part, extra_dir in enumerate(["test1", "test2"]): + result = runCmd("wic ls %s:%d | grep -q \"%s\"" % (wicimg, part + 1, extra_dir)) + self.assertEqual(0, result.status, msg="Directory '%s' not found in the partition #%d" % (extra_dir, part)) + + result = runCmd("wic ls %s:%d/test2 | grep -q \"test3\"" % (wicimg, part + 1)) + self.assertEqual(0, result.status, msg="Directory test2/test3 not found in the partition #%d" % part) + for part, file in enumerate(["foo.conf", "foobar.conf", "bar.conf"]): result = runCmd("wic ls %s:%d | grep -q \"%s\"" % (wicimg, part + 1, file)) self.assertEqual(0, result.status, msg="File '%s' not found in the partition #%d" % (file, part)) diff --git a/scripts/lib/wic/plugins/source/extra_partition.py b/scripts/lib/wic/plugins/source/extra_partition.py index 327bc2b8c3..3be7aed374 100644 --- a/scripts/lib/wic/plugins/source/extra_partition.py +++ b/scripts/lib/wic/plugins/source/extra_partition.py @@ -12,21 +12,31 @@ logger = logging.getLogger('wic') class ExtraPartitionPlugin(SourcePlugin): """ - Populates an extra partition with files listed in the IMAGE_EXTRA_PARTITION_FILES - BitBake variable. Files should be deployed to the DEPLOY_DIR_IMAGE directory. + Populates an extra partition with: + - Files listed in the IMAGE_EXTRA_PARTITION_FILES BitBake variable. Files should be deployed to + the DEPLOY_DIR_IMAGE directory. + - Empty directories listed in the IMAGE_EXTRA_PARTITION_DIRECTORIES Bitbake variable. + Directories are created automatically. The plugin supports: - Glob pattern matching for file selection. - File renaming. - Suffixes to specify the target partition (by label, UUID, or partname), enabling multiple extra partitions to coexist. + - Extra directories. For example: + IMAGE_EXTRA_PARTITION_DIRECTORIES_label-foo = "/foo /bar/baz" + IMAGE_EXTRA_PARTITION_DIRECTORIES_uuid-e7d0824e-cda3-4bed-9f54-9ef5312d105d = "/foo /bar/baz" + IMAGE_EXTRA_PARTITION_FILES_label-foo = "bar.conf;foo.conf" IMAGE_EXTRA_PARTITION_FILES_uuid-e7d0824e-cda3-4bed-9f54-9ef5312d105d = "bar.conf;foobar.conf" IMAGE_EXTRA_PARTITION_FILES = "foo/*" + WICVARS:append = "\ + IMAGE_EXTRA_PARTITION_DIRECTORIES_label-foo \ + IMAGE_EXTRA_PARTITION_DIRECTORIES_uuid-e7d0824e-cda3-4bed-9f54-9ef5312d105d \ IMAGE_EXTRA_PARTITION_FILES_label-foo \ IMAGE_EXTRA_PARTITION_FILES_uuid-e7d0824e-cda3-4bed-9f54-9ef5312d105d \ " @@ -34,6 +44,7 @@ class ExtraPartitionPlugin(SourcePlugin): """ name = 'extra_partition' + image_extra_partition_dirs_var_name = 'IMAGE_EXTRA_PARTITION_DIRECTORIES' image_extra_partition_files_var_name = 'IMAGE_EXTRA_PARTITION_FILES' @classmethod @@ -50,6 +61,22 @@ class ExtraPartitionPlugin(SourcePlugin): break return extra_vars + @classmethod + def _parse_extra_directories(cls, part): + """ + Parse the directories of which to copy. + """ + cls.extra_dirs_task = [] + + extra_dirs = cls._get_extra_vars(part, cls.image_extra_partition_dirs_var_name) + if extra_dirs is None: + logger.info('No extra directories defined, %s unset for entry #%d' % (cls.image_extra_partition_dirs_var_name, part.lineno)) + return + + logger.info('Extra dirs: %s', extra_dirs) + for src_entry in extra_dirs.strip().split(' '): + cls.extra_dirs_task.append(src_entry) + @classmethod def _parse_extra_files(cls, part, kernel_dir): """ @@ -113,6 +140,7 @@ class ExtraPartitionPlugin(SourcePlugin): if not kernel_dir: raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting") + cls._parse_extra_directories(part) cls._parse_extra_files(part, kernel_dir) @classmethod @@ -126,24 +154,32 @@ class ExtraPartitionPlugin(SourcePlugin): """ extradir = "%s/extra.%d" % (cr_workdir, part.lineno) - if not cls.extra_files_task: - raise WicError("Entry #%d does not have a corresponding %s variable set!" + if not cls.extra_dirs_task and not cls.extra_files_task: + raise WicError("Entry #%d does not have a corresponding %s or %s variable set!" "If you wish to create an empty partition, remove " "--source extra-partition from the wks file" - % (part.lineno, cls.image_extra_partition_files_var_name)) + % (part.lineno, cls.image_extra_partition_dirs_var_name, + cls.image_extra_partition_files_var_name)) if not kernel_dir: kernel_dir = get_bitbake_var("DEPLOY_DIR_IMAGE") if not kernel_dir: raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting") - for task in cls.extra_files_task: - src_path, dst_path = task - logger.debug('Install %s as %s', src_path, dst_path) - install_cmd = "install -m 0644 -D %s %s" \ - % (os.path.join(kernel_dir, src_path), - os.path.join(extradir, dst_path)) - exec_cmd(install_cmd) + if cls.extra_dirs_task: + for task in cls.extra_dirs_task: + logger.debug("Create directory %s" % task) + mkdir_cmd = "mkdir -p %s/%s" % (extradir, task) + exec_cmd(mkdir_cmd) + + if cls.extra_files_task: + for task in cls.extra_files_task: + src_path, dst_path = task + logger.debug('Install %s as %s', src_path, dst_path) + install_cmd = "install -m 0644 -D %s %s" \ + % (os.path.join(kernel_dir, src_path), + os.path.join(extradir, dst_path)) + exec_cmd(install_cmd) logger.debug('Prepare extra partition using rootfs in %s', extradir) part.prepare_rootfs(cr_workdir, oe_builddir, extradir,