All of lore.kernel.org
 help / color / mirror / Atom feed
* [OE-core][PATCH] linux-dummy: add empty dependent packages
@ 2021-03-12  9:52 Li Wang
  2021-03-12 12:44 ` Richard Purdie
  0 siblings, 1 reply; 4+ messages in thread
From: Li Wang @ 2021-03-12  9:52 UTC (permalink / raw)
  To: openembedded-core; +Cc: li.wang

some kernel includes kernel-image-image and kernel-devicetree packages.
these patckages are defined in kernel.bbclass
but, when use linux-dummy, these packages are not defined.
so, define them as empty packages for avoiding compile error:

ERROR: Nothing RPROVIDES 'kernel-devicetree'

Signed-off-by: Li Wang <li.wang@windriver.com>
---
 meta/classes/linux-dummy.bbclass         | 26 ++++++++++++++++++++++++++
 meta/recipes-kernel/linux/linux-dummy.bb |  2 +-
 2 files changed, 27 insertions(+), 1 deletion(-)
 create mode 100644 meta/classes/linux-dummy.bbclass

diff --git a/meta/classes/linux-dummy.bbclass b/meta/classes/linux-dummy.bbclass
new file mode 100644
index 0000000..cd87915
--- /dev/null
+++ b/meta/classes/linux-dummy.bbclass
@@ -0,0 +1,26 @@
+
+python __anonymous () {
+    if d.getVar('PREFERRED_PROVIDER_virtual/kernel') == 'linux-dummy':
+        # copy part codes from kernel.bbclass
+        kname = d.getVar('KERNEL_PACKAGE_NAME') or "kernel"
+
+        # set an empty package of kernel-devicetree
+        d.appendVar('PACKAGES', ' %s-devicetree' % kname)
+        d.setVar('ALLOW_EMPTY_%s-devicetree' % kname, '1')
+
+        # Merge KERNEL_IMAGETYPE and KERNEL_ALT_IMAGETYPE into KERNEL_IMAGETYPES
+        type = d.getVar('KERNEL_IMAGETYPE') or ""
+        alttype = d.getVar('KERNEL_ALT_IMAGETYPE') or ""
+        types = d.getVar('KERNEL_IMAGETYPES') or ""
+        if type not in types.split():
+            types = (type + ' ' + types).strip()
+        if alttype not in types.split():
+            types = (alttype + ' ' + types).strip()
+
+        # set empty packages of kernel-image-*
+        for type in types.split():
+            typelower = type.lower()
+            d.appendVar('PACKAGES', ' %s-image-%s' % (kname, typelower))
+            d.setVar('ALLOW_EMPTY_%s-image-%s' % (kname, typelower), '1')
+}
+
diff --git a/meta/recipes-kernel/linux/linux-dummy.bb b/meta/recipes-kernel/linux/linux-dummy.bb
index 95dc85f..c56f899 100644
--- a/meta/recipes-kernel/linux/linux-dummy.bb
+++ b/meta/recipes-kernel/linux/linux-dummy.bb
@@ -9,7 +9,7 @@ LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=751419260aa954499f7abaabaa882bbe"
 
 PROVIDES += "virtual/kernel"
 
-inherit deploy
+inherit deploy linux-dummy
 
 PACKAGES_DYNAMIC += "^kernel-module-.*"
 PACKAGES_DYNAMIC += "^kernel-image-.*"
-- 
2.7.4


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

* Re: [OE-core][PATCH] linux-dummy: add empty dependent packages
  2021-03-12  9:52 [OE-core][PATCH] linux-dummy: add empty dependent packages Li Wang
@ 2021-03-12 12:44 ` Richard Purdie
  2021-03-12 21:48   ` Li Wang
       [not found]   ` <166BB6ABA401E063.22828@lists.openembedded.org>
  0 siblings, 2 replies; 4+ messages in thread
From: Richard Purdie @ 2021-03-12 12:44 UTC (permalink / raw)
  To: Li Wang, openembedded-core

On Fri, 2021-03-12 at 17:52 +0800, Li Wang wrote:
> some kernel includes kernel-image-image and kernel-devicetree packages.
> these patckages are defined in kernel.bbclass
> but, when use linux-dummy, these packages are not defined.
> so, define them as empty packages for avoiding compile error:
> 
> ERROR: Nothing RPROVIDES 'kernel-devicetree'
> 
> Signed-off-by: Li Wang <li.wang@windriver.com>
> ---
>  meta/classes/linux-dummy.bbclass         | 26 ++++++++++++++++++++++++++
>  meta/recipes-kernel/linux/linux-dummy.bb |  2 +-
>  2 files changed, 27 insertions(+), 1 deletion(-)
>  create mode 100644 meta/classes/linux-dummy.bbclass
> 
> diff --git a/meta/classes/linux-dummy.bbclass b/meta/classes/linux-dummy.bbclass
> new file mode 100644
> index 0000000..cd87915
> --- /dev/null
> +++ b/meta/classes/linux-dummy.bbclass
> @@ -0,0 +1,26 @@
> +
> +python __anonymous () {
> +    if d.getVar('PREFERRED_PROVIDER_virtual/kernel') == 'linux-dummy':
> +        # copy part codes from kernel.bbclass
> +        kname = d.getVar('KERNEL_PACKAGE_NAME') or "kernel"
> +
> +        # set an empty package of kernel-devicetree
> +        d.appendVar('PACKAGES', ' %s-devicetree' % kname)
> +        d.setVar('ALLOW_EMPTY_%s-devicetree' % kname, '1')
> +
> +        # Merge KERNEL_IMAGETYPE and KERNEL_ALT_IMAGETYPE into KERNEL_IMAGETYPES
> +        type = d.getVar('KERNEL_IMAGETYPE') or ""
> +        alttype = d.getVar('KERNEL_ALT_IMAGETYPE') or ""
> +        types = d.getVar('KERNEL_IMAGETYPES') or ""
> +        if type not in types.split():
> +            types = (type + ' ' + types).strip()
> +        if alttype not in types.split():
> +            types = (alttype + ' ' + types).strip()
> +
> +        # set empty packages of kernel-image-*
> +        for type in types.split():
> +            typelower = type.lower()
> +            d.appendVar('PACKAGES', ' %s-image-%s' % (kname, typelower))
> +            d.setVar('ALLOW_EMPTY_%s-image-%s' % (kname, typelower), '1')
> +}
> +

Rather than generating broken empty packages, why not just set RPROVIDES_${PN} 
with the appropriate things?

Cheers,

Richard


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

* Re: [OE-core][PATCH] linux-dummy: add empty dependent packages
  2021-03-12 12:44 ` Richard Purdie
@ 2021-03-12 21:48   ` Li Wang
       [not found]   ` <166BB6ABA401E063.22828@lists.openembedded.org>
  1 sibling, 0 replies; 4+ messages in thread
From: Li Wang @ 2021-03-12 21:48 UTC (permalink / raw)
  To: Richard Purdie, openembedded-core


On 3/12/2021 20:44, Richard Purdie wrote:
> On Fri, 2021-03-12 at 17:52 +0800, Li Wang wrote:
>> some kernel includes kernel-image-image and kernel-devicetree packages.
>> these patckages are defined in kernel.bbclass
>> but, when use linux-dummy, these packages are not defined.
>> so, define them as empty packages for avoiding compile error:
>>
>> ERROR: Nothing RPROVIDES 'kernel-devicetree'
>>
>> Signed-off-by: Li Wang <li.wang@windriver.com>
>> ---
>>   meta/classes/linux-dummy.bbclass         | 26 ++++++++++++++++++++++++++
>>   meta/recipes-kernel/linux/linux-dummy.bb |  2 +-
>>   2 files changed, 27 insertions(+), 1 deletion(-)
>>   create mode 100644 meta/classes/linux-dummy.bbclass
>>
>> diff --git a/meta/classes/linux-dummy.bbclass b/meta/classes/linux-dummy.bbclass
>> new file mode 100644
>> index 0000000..cd87915
>> --- /dev/null
>> +++ b/meta/classes/linux-dummy.bbclass
>> @@ -0,0 +1,26 @@
>> +
>> +python __anonymous () {
>> +    if d.getVar('PREFERRED_PROVIDER_virtual/kernel') == 'linux-dummy':
>> +        # copy part codes from kernel.bbclass
>> +        kname = d.getVar('KERNEL_PACKAGE_NAME') or "kernel"
>> +
>> +        # set an empty package of kernel-devicetree
>> +        d.appendVar('PACKAGES', ' %s-devicetree' % kname)
>> +        d.setVar('ALLOW_EMPTY_%s-devicetree' % kname, '1')
>> +
>> +        # Merge KERNEL_IMAGETYPE and KERNEL_ALT_IMAGETYPE into KERNEL_IMAGETYPES
>> +        type = d.getVar('KERNEL_IMAGETYPE') or ""
>> +        alttype = d.getVar('KERNEL_ALT_IMAGETYPE') or ""
>> +        types = d.getVar('KERNEL_IMAGETYPES') or ""
>> +        if type not in types.split():
>> +            types = (type + ' ' + types).strip()
>> +        if alttype not in types.split():
>> +            types = (alttype + ' ' + types).strip()
>> +
>> +        # set empty packages of kernel-image-*
>> +        for type in types.split():
>> +            typelower = type.lower()
>> +            d.appendVar('PACKAGES', ' %s-image-%s' % (kname, typelower))
>> +            d.setVar('ALLOW_EMPTY_%s-image-%s' % (kname, typelower), '1')
>> +}
>> +
> Rather than generating broken empty packages, why not just set RPROVIDES_${PN}
> with the appropriate things?

linux-dummy is just an empty package, what does it PROVIDE the 
appropriate things?

linux-dummy has the similar codes:

=====

oe-core/meta/recipes-kernel/linux/linux-dummy.bb

PACKAGES += "kernel-modules kernel-vmlinux"
FILES_kernel-modules = ""
ALLOW_EMPTY_kernel-modules = "1"
DESCRIPTION_kernel-modules = "Kernel modules meta package"
FILES_kernel-vmlinux = ""
ALLOW_EMPTY_kernel-vmlinux = "1"
DESCRIPTION_kernel-vmlinux = "Kernel vmlinux meta package"

=====

I can offer a more complete empty package as above sample.(FILES_* 
DESCRIPTION_*)

please give me some suggest about it.

Thanks,
LiWang.

>
> Cheers,
>
> Richard
>

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

* Re: [OE-core][PATCH] linux-dummy: add empty dependent packages
       [not found]   ` <166BB6ABA401E063.22828@lists.openembedded.org>
@ 2021-03-17  2:08     ` Li Wang
  0 siblings, 0 replies; 4+ messages in thread
From: Li Wang @ 2021-03-17  2:08 UTC (permalink / raw)
  To: Richard Purdie, openembedded-core

[-- Attachment #1: Type: text/plain, Size: 3291 bytes --]

ping!

Thanks,
LiWang.

On 3/13/2021 05:48, Li Wang wrote:
>
> On 3/12/2021 20:44, Richard Purdie wrote:
>> On Fri, 2021-03-12 at 17:52 +0800, Li Wang wrote:
>>> some kernel includes kernel-image-image and kernel-devicetree packages.
>>> these patckages are defined in kernel.bbclass
>>> but, when use linux-dummy, these packages are not defined.
>>> so, define them as empty packages for avoiding compile error:
>>>
>>> ERROR: Nothing RPROVIDES 'kernel-devicetree'
>>>
>>> Signed-off-by: Li Wang <li.wang@windriver.com>
>>> ---
>>>   meta/classes/linux-dummy.bbclass         | 26 
>>> ++++++++++++++++++++++++++
>>>   meta/recipes-kernel/linux/linux-dummy.bb |  2 +-
>>>   2 files changed, 27 insertions(+), 1 deletion(-)
>>>   create mode 100644 meta/classes/linux-dummy.bbclass
>>>
>>> diff --git a/meta/classes/linux-dummy.bbclass 
>>> b/meta/classes/linux-dummy.bbclass
>>> new file mode 100644
>>> index 0000000..cd87915
>>> --- /dev/null
>>> +++ b/meta/classes/linux-dummy.bbclass
>>> @@ -0,0 +1,26 @@
>>> +
>>> +python __anonymous () {
>>> +    if d.getVar('PREFERRED_PROVIDER_virtual/kernel') == 'linux-dummy':
>>> +        # copy part codes from kernel.bbclass
>>> +        kname = d.getVar('KERNEL_PACKAGE_NAME') or "kernel"
>>> +
>>> +        # set an empty package of kernel-devicetree
>>> +        d.appendVar('PACKAGES', ' %s-devicetree' % kname)
>>> +        d.setVar('ALLOW_EMPTY_%s-devicetree' % kname, '1')
>>> +
>>> +        # Merge KERNEL_IMAGETYPE and KERNEL_ALT_IMAGETYPE into 
>>> KERNEL_IMAGETYPES
>>> +        type = d.getVar('KERNEL_IMAGETYPE') or ""
>>> +        alttype = d.getVar('KERNEL_ALT_IMAGETYPE') or ""
>>> +        types = d.getVar('KERNEL_IMAGETYPES') or ""
>>> +        if type not in types.split():
>>> +            types = (type + ' ' + types).strip()
>>> +        if alttype not in types.split():
>>> +            types = (alttype + ' ' + types).strip()
>>> +
>>> +        # set empty packages of kernel-image-*
>>> +        for type in types.split():
>>> +            typelower = type.lower()
>>> +            d.appendVar('PACKAGES', ' %s-image-%s' % (kname, 
>>> typelower))
>>> +            d.setVar('ALLOW_EMPTY_%s-image-%s' % (kname, 
>>> typelower), '1')
>>> +}
>>> +
>> Rather than generating broken empty packages, why not just set 
>> RPROVIDES_${PN}
>> with the appropriate things?
>
> linux-dummy is just an empty package, what does it PROVIDE the 
> appropriate things?
>
> linux-dummy has the similar codes:
>
> =====
>
> oe-core/meta/recipes-kernel/linux/linux-dummy.bb
>
> PACKAGES += "kernel-modules kernel-vmlinux"
> FILES_kernel-modules = ""
> ALLOW_EMPTY_kernel-modules = "1"
> DESCRIPTION_kernel-modules = "Kernel modules meta package"
> FILES_kernel-vmlinux = ""
> ALLOW_EMPTY_kernel-vmlinux = "1"
> DESCRIPTION_kernel-vmlinux = "Kernel vmlinux meta package"
>
> =====
>
> I can offer a more complete empty package as above sample.(FILES_* 
> DESCRIPTION_*)
>
> please give me some suggest about it.
>
> Thanks,
> LiWang.
>
>>
>> Cheers,
>>
>> Richard
>>
>
> 
>

[-- Attachment #2: Type: text/html, Size: 6258 bytes --]

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

end of thread, other threads:[~2021-03-17  2:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-12  9:52 [OE-core][PATCH] linux-dummy: add empty dependent packages Li Wang
2021-03-12 12:44 ` Richard Purdie
2021-03-12 21:48   ` Li Wang
     [not found]   ` <166BB6ABA401E063.22828@lists.openembedded.org>
2021-03-17  2:08     ` Li Wang

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.