oe yocto

andrea-adami edited this page Dec 6, 2016 · 8 revisions

linux-yocto-tiny as base for the creation of a kernel with embedded initramfs-kexecboot

Submitted by ant on Mon, 09/17/2012 - 21:52

In OpenEmbedded we used linux-yocto-tiny from the oe-core layer as base for the creation of a kernel with embedded initramfs in the meta-initramfs layer. The recipes hosted there are paired by the .bbappends in the meta-handheld BSP layer (see kexecboot-klibc_git.bb and kexecboot-klibc_git.bbappend).

PREMISES
In kernel.bbclass there is logic allowing to embed an image as initramfs during the build of a kernel.

CASE OF STUDY
We want to deploy an upgrade kit composed by a binary installer/flasher and a zImage kernel+initramfs for .

NEEDED FILES
In the minimalistic case we need just to add our BSP layer providing the configuration files for .

  1. conf/.conf - the machine-specific configuration, setting:
    INITRAMFS_FSTYPES ?= "cpio.gz"
    KERNEL_IMAGETYPE ?= "zImage"

  2. my-initramfs-image.bb - the recipe for the image which will be the cpio containing:
    IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
    IMAGE_INSTALL = "my-list-of-packages"

  3. linux-my-initramfs.bb - the recipe for the kernel will contain the line:
    INITRAMFS_IMAGE = "my-initramfs-image"
    INITRAMFS_TASK = "${INITRAMFS_IMAGE}:do_image_complete"

We just want to deploy the kernel and don't need a package, so we set:
PACKAGES = ""

Being based on a linux-yocto recipe this one would be provider of virtual/kernel as well.
Thus to avoid "ERROR: Multiple .bb files are due to be built which each provide virtual/kernel" we set:
PROVIDES = ""

Finally we rename our kernel:
KERNEL_IMAGE_BASE_NAME = "${KERNEL_IMAGETYPE}-my-initramfs-${PV}-${PR}-${MACHINE}"
KERNEL_IMAGE_SYMLINK_NAME = "${KERNEL_IMAGETYPE}-my-initramfs-${MACHINE}"

  1. my-flasher.bb - the recipe providing the binary flasher

  2. my-installer.bb - the recipe combining all parts of the puzzle, setting:
    DEPENDS = "my-flasher linux-my-initramfs"

SEE FOR EXAMPLE THE CORRESPONDING FILES:

  1. zaurus.inc as included by all Zaurus machine configuration files
  2. initramfs-kexecboot-klibc-image.bb
  3. linux-yocto-tiny-kexecboot_3.8.bb and linux-yocto-tiny-kexecboot_3.8.bbappend
    4) zaurus-updater
  4. zaurus-installer
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.