linux-dummy.bbclass 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. #
  2. # Copyright OpenEmbedded Contributors
  3. #
  4. # SPDX-License-Identifier: MIT
  5. #
  6. python __anonymous () {
  7. if d.getVar('PREFERRED_PROVIDER_virtual/kernel') == 'linux-dummy':
  8. # copy part codes from kernel.bbclass
  9. kname = d.getVar('KERNEL_PACKAGE_NAME') or "kernel"
  10. # set an empty package of kernel-devicetree
  11. d.appendVar('PACKAGES', ' %s-devicetree' % kname)
  12. d.setVar('ALLOW_EMPTY:%s-devicetree' % kname, '1')
  13. # Merge KERNEL_IMAGETYPE and KERNEL_ALT_IMAGETYPE into KERNEL_IMAGETYPES
  14. type = d.getVar('KERNEL_IMAGETYPE') or ""
  15. alttype = d.getVar('KERNEL_ALT_IMAGETYPE') or ""
  16. types = d.getVar('KERNEL_IMAGETYPES') or ""
  17. if type not in types.split():
  18. types = (type + ' ' + types).strip()
  19. if alttype not in types.split():
  20. types = (alttype + ' ' + types).strip()
  21. # set empty packages of kernel-image-*
  22. for type in types.split():
  23. typelower = type.lower()
  24. d.appendVar('PACKAGES', ' %s-image-%s' % (kname, typelower))
  25. d.setVar('ALLOW_EMPTY:%s-image-%s' % (kname, typelower), '1')
  26. }