[oe] [RFC] initramfs support for linux-handhelds-2.6

Paul Sokolovsky pmiscml at gmail.com
Sun Feb 24 23:48:25 UTC 2008


Hello,

Failing to add generic and fully automated kernel-with-initramfs build,
I have patch to add external initramfs to kernel for linux-hh. I'd
still like to establish conventions for other kernel recipes to follow,
so here're the patch for suggestion. The idea is simple:

1. KERNEL_INITRAMFS_PATH is set to the full path of cpio.gz image to
use as initramfs. Empty value (default) means don't use initramfs. If
file doesn't exist, build fails with an error message (content is left
to specific recipe - there unfortunately doesn't seem to be a way to
sensibly provide detailed one in generic case).

2. KERNEL_INITRAMFS_PATH is considered a distro realm, like for example
kernel PREFERRED_VERSION. Below, angstrom distro config sets it.


--- conf/distro/angstrom-2007.1.conf	bb906c2c783007b1d23eedbf01ff13a271da4595
+++ conf/distro/angstrom-2007.1.conf	a8220fb1f7f5fa4674d43722b241d7aec2dd790a
@@ -60,6 +60,7 @@ PREFERRED_VERSION_linux-handhelds-2.6   
 
 #Preferred version for the kernel on various machines
 PREFERRED_VERSION_linux-handhelds-2.6               ?= "2.6.21-hh20"
+KERNEL_INITRAMFS_PATH = "${TMPDIR}/deploy/uclibc/images/${MACHINE}/initramfs-bootmenu-image-${MACHINE}.cpio.gz"
 PREFERRED_VERSION_linux-ixp4xx                      ?= "2.6.21.6+svnr${SRCREV}"
 RDEPENDS_kernel-base_hx4700 = ""
 RDEPENDS_kernel-base_htcuniversal = ""
============================================================
--- packages/linux/linux-handhelds-2.6.inc	a212a1e08710b140bd482d9538939be6fed39bab
+++ packages/linux/linux-handhelds-2.6.inc	b761bc283eb28d9f018764f3ca504f8e1ea6972d
@@ -54,6 +54,16 @@ do_configure() {
 
 }
 
+do_compile_prepend() {
+	if [ -n "${KERNEL_INITRAMFS_PATH}" -a "${ANGSTROM_MODE}" == "glibc" ]; then
+	    if [ ! -f ${KERNEL_INITRAMFS_PATH} ]; then
+		echo "${KERNEL_INITRAMFS_PATH} does not exist, you may need to bitbake it separately"
+		exit 1
+	    fi
+	    cp ${KERNEL_INITRAMFS_PATH} usr/initramfs_data.cpio.gz
+	fi
+}
+
 do_deploy() {
 	install -d ${DEPLOY_DIR_IMAGE}
 	install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR_IMAGE}/${KERNEL_FILENAME}



-- 
Best regards,
 Paul                          mailto:pmiscml at gmail.com




More information about the Openembedded-devel mailing list