[OE-core] [PATCH 0/3] kernel-multi: stage and package multiple kernels

Andreas Fenkart andreas.fenkart at dev.digitalstrom.org
Tue May 17 09:16:17 UTC 2016


These patches add support to stage and package multiple kernels
in addition to the prioritized virtual/kernel provider

The intended use case are kernel upgrades, where you want to
install the new kernel before removing the old kernel.

Usage:
  LINUX_VERSION = "4.1.19"
  KERNEL_CLASS = "kernel-multi"
  require linux-yocto.inc

This will produce these packages:
  kernel-4.1.19
  kernel-4.1.19-image
  kernel-4.1.19-modules
  kernel-4.1.19-module-<pattern>
  kernel-4.1.19-firmware-<pattern>

There are known limitations:

Recipes based on this class can be selected as virtual/kernel.
The limitation is that external modules or tools such as perf
will break, since they expect the kernel-source to be located in
the default STAGING_KERNEL_DIR. We can not use the same folder
when building multiple kernels since that produces conflicts

Also running depmod on the built rootfs fails for the same
reason. The meta data are not placed in their default location,
since that would conflict too.  The default path is hardcoded in
kernel-depmod script. The workaround is to USE_DEPMOD = "0", and
delay depmod calculation upon first boot of the rootfs on the
target. Workaround will fail on read-only filesystems.


I believe the class is already useful in this state. I'm also
interested to learn if there is common interest in supporting
multi-kernel builds. I will implement suggestions. 



Andreas Fenkart (3):
  kernel.bbclass: allow to override KERNEL_FIRMWARE_PATTERN
  kernel-module-split: allow to override KERNEL_MODULE_PATTERN
  kernel-multi: class to stage and package multiple kernels

 meta/classes/kernel-module-split.bbclass  |   3 +-
 meta/classes/kernel-multi.bbclass         | 165 ++++++++++++++++++++++++++++++
 meta/classes/kernel.bbclass               |   4 +-
 meta/recipes-kernel/linux/linux-yocto.inc |   3 +-
 4 files changed, 172 insertions(+), 3 deletions(-)
 create mode 100644 meta/classes/kernel-multi.bbclass

-- 
2.8.1




More information about the Openembedded-core mailing list