diff options
author | Paul Sokolovsky <pmiscml@gmail.com> | 2008-02-15 15:38:05 +0000 |
---|---|---|
committer | Paul Sokolovsky <pmiscml@gmail.com> | 2008-02-15 15:38:05 +0000 |
commit | 72761e468bb3e905459f2b81ce1bc4d80419481f (patch) | |
tree | 4b47011dbf7fc9bda32bbe256e1e165527a8c36b /classes/kernel.bbclass | |
parent | 0ba2ec0095f0febdfb8d8639353d3e6644977758 (diff) |
kernel.bbclass: Add satndalone task "builtin_initramfs".
* Builds a zImage with linked in initramfs specified by INITRAMFS_LOC param.
Diffstat (limited to 'classes/kernel.bbclass')
-rw-r--r-- | classes/kernel.bbclass | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/classes/kernel.bbclass b/classes/kernel.bbclass index 047a3ec047..28e04ea204 100644 --- a/classes/kernel.bbclass +++ b/classes/kernel.bbclass @@ -11,6 +11,10 @@ PACKAGES_DYNAMIC += "kernel-image-*" export OS = "${TARGET_OS}" export CROSS_COMPILE = "${TARGET_PREFIX}" KERNEL_IMAGETYPE ?= "zImage" +# Base filename under which users see built kernel (i.e. deploy name) +KERNEL_IMAGE_BASE_NAME = "${KERNEL_IMAGETYPE}-${PV}-${PR}-${MACHINE}" +# Symlink basename pointing to the most recently built kernel for a machine +KERNEL_IMAGE_SYMLINK_NAME = "${KERNEL_IMAGETYPE}-${MACHINE}" KERNEL_PRIORITY = "${@bb.data.getVar('PV',d,1).split('-')[0].split('.')[-1]}" @@ -30,6 +34,7 @@ HOST_LD_KERNEL_ARCH ?= "${TARGET_LD_KERNEL_ARCH}" KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc${KERNEL_CCSUFFIX} ${HOST_CC_KERNEL_ARCH}" KERNEL_LD = "${LD}${KERNEL_LDSUFFIX} ${HOST_LD_KERNEL_ARCH}" +# Where built kernel lies in the kernel tree KERNEL_OUTPUT = "arch/${ARCH}/boot/${KERNEL_IMAGETYPE}" KERNEL_IMAGEDEST = "boot" @@ -60,6 +65,22 @@ kernel_do_compile() { fi } +do_builtin_initramfs() { + unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE + cp "${INITRAMFS_LOC}" usr/initramfs_data.cpio.gz + oe_runmake ${KERNEL_IMAGETYPE} CC="${KERNEL_CC}" LD="${KERNEL_LD}" + install -d ${DEPLOY_DIR_IMAGE} + mv ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_BASE_NAME}.bin ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_BASE_NAME}.no-initramfs.bin + install -m 0644 ${KERNEL_OUTPUT} ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_BASE_NAME}.bin + # Make sure to kill injected initramfs, in case someone will do "-c compile -f" + rm usr/initramfs_data.cpio.gz + + [ -n "${DEPLOY_TO}" ] && install -m 0644 ${KERNEL_OUTPUT} ${DEPLOY_TO} +} +addtask builtin_initramfs after do_compile +# As it accepts external parameter(s), better make it unstamped +do_builtin_initramfs[nostamp] = "1" + kernel_do_stage() { ASMDIR=`readlink include/asm` |