[meta-arm,1/2] arm-autonomy/wic: Introduce empty plugin to create unformatted empty partitions

Submitted by Diego Sueiro on Sept. 25, 2020, 11:15 a.m. | Patch ID: 176794

Details

Message ID 70f746be8740db141d3125e57b78805ebf35789e.1601032480.git.diego.sueiro@arm.com
State New
Headers show

Commit Message

Diego Sueiro Sept. 25, 2020, 11:15 a.m.
The empty wic plugin is used to create unformatted empty partitions for wic
images.

To use it you must pass "empty" as argument for the "--source" parameter in the
wks file. For example:
part foo --source empty --ondisk sda --size="1024" --align 1024

Change-Id: I0155561e9cc2ac11159e181eec9e4d9ae11555c3
Issue-Id: SCM-889
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
---
 .../scripts/lib/wic/plugins/source/empty.py        | 32 ++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 meta-arm-autonomy/scripts/lib/wic/plugins/source/empty.py

Patch hide | download patch | download mbox

diff --git a/meta-arm-autonomy/scripts/lib/wic/plugins/source/empty.py b/meta-arm-autonomy/scripts/lib/wic/plugins/source/empty.py
new file mode 100644
index 0000000..041617d
--- /dev/null
+++ b/meta-arm-autonomy/scripts/lib/wic/plugins/source/empty.py
@@ -0,0 +1,32 @@ 
+#
+# SPDX-License-Identifier: MIT
+#
+
+# The empty wic plugin is used to create unformatted empty partitions for wic
+# images.
+# To use it you must pass "empty" as argument for the "--source" parameter in
+# the wks file. For example:
+# part foo --source empty --ondisk sda --size="1024" --align 1024
+
+import logging
+
+from wic.pluginbase import SourcePlugin
+
+logger = logging.getLogger('wic')
+
+class EmptyPartitionPlugin(SourcePlugin):
+    """
+    Populate unformatted empty partition.
+    """
+
+    name = 'empty'
+
+    @classmethod
+    def do_prepare_partition(cls, part, source_params, cr, cr_workdir,
+                             oe_builddir, bootimg_dir, kernel_dir,
+                             rootfs_dir, native_sysroot):
+        """
+        Called to do the actual content population for a partition i.e. it
+        'prepares' the partition to be incorporated into the image.
+        """
+        return

Comments

Denys Dmytriyenko Sept. 28, 2020, 12:48 a.m.
Seems generic - should this be submitted to oe-core?
Diego Sueiro Sept. 28, 2020, 2:27 p.m.
On Mon, Sep 28, 2020 at 01:48 AM, Denys Dmytriyenko wrote:

>
> Seems generic - should this be submitted to oe-core?

Hello Denys.

Yes, I'll be pushing this to oe-core (with the appropriated documentation) after the Gatesgarth release.

Cheers,

--
Diego Sueiro

> 
> -- 
> Denys
> 
> 
> On Fri, Sep 25, 2020 at 12:15:46PM +0100, Diego Sueiro wrote:
> > The empty wic plugin is used to create unformatted empty partitions for wic
> > images.
> > 
> > To use it you must pass "empty" as argument for the "--source" parameter in
> the
> > wks file. For example:
> > part foo --source empty --ondisk sda --size="1024" --align 1024
> > 
> > Change-Id: I0155561e9cc2ac11159e181eec9e4d9ae11555c3
> > Issue-Id: SCM-889
> > Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
> > ---
> >  .../scripts/lib/wic/plugins/source/empty.py        | 32
> ++++++++++++++++++++++
> >  1 file changed, 32 insertions(+)
> >  create mode 100644
> meta-arm-autonomy/scripts/lib/wic/plugins/source/empty.py
> > 
> > diff --git a/meta-arm-autonomy/scripts/lib/wic/plugins/source/empty.py
> b/meta-arm-autonomy/scripts/lib/wic/plugins/source/empty.py
> > new file mode 100644
> > index 0000000..041617d
> > --- /dev/null
> > +++ b/meta-arm-autonomy/scripts/lib/wic/plugins/source/empty.py
> > @@ -0,0 +1,32 @@
> > +#
> > +# SPDX-License-Identifier: MIT
> > +#
> > +
> > +# The empty wic plugin is used to create unformatted empty partitions for
> wic
> > +# images.
> > +# To use it you must pass "empty" as argument for the "--source" parameter
> in
> > +# the wks file. For example:
> > +# part foo --source empty --ondisk sda --size="1024" --align 1024
> > +
> > +import logging
> > +
> > +from wic.pluginbase import SourcePlugin
> > +
> > +logger = logging.getLogger('wic')
> > +
> > +class EmptyPartitionPlugin(SourcePlugin):
> > +    """
> > +    Populate unformatted empty partition.
> > +    """
> > +
> > +    name = 'empty'
> > +
> > +    @classmethod
> > +    def do_prepare_partition(cls, part, source_params, cr, cr_workdir,
> > +                             oe_builddir, bootimg_dir, kernel_dir,
> > +                             rootfs_dir, native_sysroot):
> > +        """
> > +        Called to do the actual content population for a partition i.e. it
> > +        'prepares' the partition to be incorporated into the image.
> > +        """
> > +        return
> > -- 
> > 2.7.4
> > 
> 
> > 
> > 
> > 
> 
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#1159): https://lists.yoctoproject.org/g/meta-arm/message/1159
Mute This Topic: https://lists.yoctoproject.org/mt/77077211/3617530
Group Owner: meta-arm+owner@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/meta-arm/unsub [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-