All of lore.kernel.org
 help / color / mirror / Atom feed
From: Raymond Danks <ray.danks@se-eng.com>
To: openembedded-devel@lists.openembedded.org
Cc: coreboot@coreboot.org
Subject: [PATCH 2/2] Add mkelfimage and support for generating kernel+initrd ELF payloads to OpenEmbedded
Date: Fri, 15 Jul 2011 10:55:48 -0600	[thread overview]
Message-ID: <4E207114.2000602@se-eng.com> (raw)

On x86, and ELF image file may be stored as a coreboot payload.  This 
image file may be a kernel or a kernel+initrd.

Documentation on this has been started on the coreboot wiki:
http://www.coreboot.org/Mkelfimage

We have seen success using the mkelfimage utility to construct a 
kernel+initrd image using the micro-image OpenEmbedded image as an initrd.
http://www.se-eng.com/wiki/index.php/Open_Embedded_Setup

The second patch contains the necessary commands for adding the image 
type to bitbake.
---
  conf/bitbake.conf |    3 +++
  1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/conf/bitbake.conf b/conf/bitbake.conf
index 66dfaba..1ab72e1 100644
--- a/conf/bitbake.conf
+++ b/conf/bitbake.conf
@@ -375,6 +375,7 @@ IMAGE_BASENAME = "${PN}"
  IMAGE_NAME = "${IMAGE_BASENAME}-${MACHINE}-${DATETIME}"
  IMAGE_LINK_NAME = "${IMAGE_BASENAME}-${MACHINE}"
  IMAGE_EXTRA_SPACE = 10240
+IMAGE_KERNELPARAMS = "ramdisk_size=32768 root=/dev/ram0 rw console="

  UBI_VOLNAME ?= "${MACHINE}-rootfs"

@@ -406,6 +407,7 @@ IMAGE_CMD_cpio.gz.u-boot = "type cpio >/dev/null; cd 
${IMAGE_ROOTFS} && (find .
  IMAGE_CMD_cpio.lzma = "type cpio >/dev/null; cd ${IMAGE_ROOTFS} && 
(find . | cpio -o -H newc | xz --format=lzma -c ${XZ_COMPRESSION_LEVEL} 
--check=${XZ_INTEGRITY_CHECK} 
 >${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio.lzma) ${EXTRA_IMAGECMD}"
  IMAGE_CMD_ubi = "echo \[ubifs\] > ubinize.cfg ; echo mode=ubi >> 
ubinize.cfg ; echo image=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.ubifs.img >> 
ubinize.cfg ; echo vol_id=0 >> ubinize.cfg ; echo vol_type=dynamic >> 
ubinize.cfg ; echo vol_name=${UBI_VOLNAME} >> ubinize.cfg ; echo 
vol_flags=autoresize >> ubinize.cfg;mkfs.ubifs -r ${IMAGE_ROOTFS} -o 
${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.ubifs.img ${MKUBIFS_ARGS} && ubinize 
-o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubi ${UBINIZE_ARGS} ubinize.cfg"
  IMAGE_CMD_ubifs = "mkfs.ubifs -r ${IMAGE_ROOTFS} -o 
${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.ubifs.img ${MKUBIFS_ARGS}"
+IMAGE_CMD_elf = "type cpio >/dev/null; cd ${IMAGE_ROOTFS} && (find . | 
cpio -o -H newc | gzip -c -9 
 >${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio.gz) ; rm -f 
${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.elf ;  mkelfImage 
--append='${IMAGE_KERNELPARAMS}' 
--kernel=${STAGING_DIR}/${MACHINE}${HOST_VENDOR}-${HOST_OS}/kernel/bzImage 
--initrd=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio.gz 
--output=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.elf ${EXTRA_IMAGECMD}"

  EXTRA_IMAGECMD = ""
  EXTRA_IMAGECMD_jffs2 = ""
@@ -440,6 +442,7 @@ IMAGE_DEPENDS_squashfs = "squashfs-tools-native"
  IMAGE_DEPENDS_squashfs-lzma = "squashfs-tools-native"
  IMAGE_DEPENDS_ubi = "mtd-utils-native"
  IMAGE_DEPENDS_ubifs = "mtd-utils-native"
+IMAGE_DEPENDS_elf = "virtual/kernel mkelfimage-native"

  EXTRA_IMAGEDEPENDS = ""

-- 
1.7.0.4




             reply	other threads:[~2011-07-15 17:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-15 16:55 Raymond Danks [this message]
2011-07-15 18:54 ` [PATCH 2/2] Add mkelfimage and support for generating kernel+initrd ELF payloads to OpenEmbedded Paul Menzel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E207114.2000602@se-eng.com \
    --to=ray.danks@se-eng.com \
    --cc=coreboot@coreboot.org \
    --cc=openembedded-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.