Build kernel with inline initramfs

Patch the kernel

Apply OK6410 specific patch:

Kernel configuration

In case you need to do some kernel config, login to the X Windows desktop and open a terminal. Run:

cd /oe/build
bitbake -c menuconfig virtual/kernel

Create a custom initramfs image receipe

A custom initramfs image which includes the mtd-utils is needed to boot the system and install ubi based filesystems.

  • Create the receipe based on initramfs-image and add mtd-utils.
  • Inline initramfs must be in cpio format.
  • Name the image as initramfs-mtdutils-image.
initramfs-mtdutils-image.bb.txt
require initramfs-image.bb

IMAGE_INSTALL += "mtd-utils"

IMAGE_FSTYPES = "cpio"

export IMAGE_BASENAME = "initramfs-mtdutils-image"

Save file as /oe/openembedded/recipes/images/initramfs-mtdutils-image.bb

Build the initramfs cpio image

Build the initramfs image together with kernel:

cd /oe/build
bitbake initramfs-mtdutils-image

After done, make a copy of the cpio image to a convenient place, like /tmp

cd /oe/build/ok6410-tmp/deploy/eglibc/images/mini6410/
cp initramfs-mtdutils-image-mini6410.cpio /tmp/initramfs.cpio

At this stage, the kernel is built. Copy it to a convenient place for transfer to OK6410, like /srv/tftp:

cd /oe/build/ok6410-tmp/deploy/eglibc/images/mini6410
cp uImage-2.6.28-r15-mini6410.bin /srv/tftp/uImage.bin

Configure kernel to embed the initramfs

Now the fresh built kernel does not have the initramfs image bundled inline yet.

To config kernel to embed the initramfs, run menuconfig as above, and type in the initramfs file path into the initramfs option:

General setup  --->
    [*] Initial RAM filesystem and RAM disk (initramfs/initrd) support
    (/tmp/initramfs.cpio) Initramfs source file(s)

Rebuild the kernel by

cd /oe/build
bitbake -f -c compile virtual/kernel

After done, the resulting uImage will be bigger as the initramfs is embedded.

Copy the uImage to a convenient place for transfer to the OK6410, like /srv/tftp:

cd /oe/build/ok6410-tmp/work/mini6410-angstrom-linux-gnueabi/linux-2.6.28-r15/linux-2.6.28/
cp arch/arm/boot/uImage /srv/tftp/uImage-initramfs.bin
oe/build_kernel_with_inline_initramfs.txt · Last modified: 2010-10-20 16:10 by admin
Back to top
GNU Free Documentation License 1.3
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0