All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] wic: Introduce empty plugin to create unformatted empty partitions
@ 2020-12-03 15:35 Diego Sueiro
  2020-12-03 22:58 ` [OE-core] " Richard Purdie
  0 siblings, 1 reply; 3+ messages in thread
From: Diego Sueiro @ 2020-12-03 15:35 UTC (permalink / raw)
  To: openembedded-core; +Cc: nd, Diego Sueiro

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

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 scripts/lib/wic/plugins/source/empty.py

diff --git a/scripts/lib/wic/plugins/source/empty.py b/scripts/lib/wic/plugins/source/empty.py
new file mode 100644
index 0000000000..041617d648
--- /dev/null
+++ b/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.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [OE-core] [PATCH] wic: Introduce empty plugin to create unformatted empty partitions
  2020-12-03 15:35 [PATCH] wic: Introduce empty plugin to create unformatted empty partitions Diego Sueiro
@ 2020-12-03 22:58 ` Richard Purdie
  2020-12-08 11:40   ` Diego Sueiro
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Purdie @ 2020-12-03 22:58 UTC (permalink / raw)
  To: Diego Sueiro, openembedded-core; +Cc: nd

On Thu, 2020-12-03 at 15:35 +0000, 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
> 
> 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 scripts/lib/wic/plugins/source/empty.py
> 
> diff --git a/scripts/lib/wic/plugins/source/empty.py b/scripts/lib/wic/plugins/source/empty.py
> new file mode 100644
> index 0000000000..041617d648
> --- /dev/null
> +++ b/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


Thanks, the wic test coverage is pretty comprehensive, could you add a
test for this please ("oe-selftest -r wic" is the test command).

Cheers,

Richard



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [OE-core] [PATCH] wic: Introduce empty plugin to create unformatted empty partitions
  2020-12-03 22:58 ` [OE-core] " Richard Purdie
@ 2020-12-08 11:40   ` Diego Sueiro
  0 siblings, 0 replies; 3+ messages in thread
From: Diego Sueiro @ 2020-12-08 11:40 UTC (permalink / raw)
  To: Richard Purdie, openembedded-core; +Cc: nd

>-----Original Message-----
>From: Richard Purdie <richard.purdie@linuxfoundation.org>
>Sent: 03 December 2020 22:58
>To: Diego Sueiro <Diego.Sueiro@arm.com>; openembedded-
>core@lists.openembedded.org
>Cc: nd <nd@arm.com>
>Subject: Re: [OE-core] [PATCH] wic: Introduce empty plugin to create
>unformatted empty partitions
>
>On Thu, 2020-12-03 at 15:35 +0000, 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
>>
>> 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 scripts/lib/wic/plugins/source/empty.py
>>
>> diff --git a/scripts/lib/wic/plugins/source/empty.py
>> b/scripts/lib/wic/plugins/source/empty.py
>> new file mode 100644
>> index 0000000000..041617d648
>> --- /dev/null
>> +++ b/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
>
>
>Thanks, the wic test coverage is pretty comprehensive, could you add a test
>for this please ("oe-selftest -r wic" is the test command).

Sure. I'm sending a V2 shortly.

>
>Cheers,
>
>Richard
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-12-08 11:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-03 15:35 [PATCH] wic: Introduce empty plugin to create unformatted empty partitions Diego Sueiro
2020-12-03 22:58 ` [OE-core] " Richard Purdie
2020-12-08 11:40   ` Diego Sueiro

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.