diff options
author | Marcin Juszkiewicz <hrw@openembedded.org> | 2008-01-17 15:39:09 +0000 |
---|---|---|
committer | Marcin Juszkiewicz <hrw@openembedded.org> | 2008-01-17 15:39:09 +0000 |
commit | 9d1b8ff9cc28b6c4e0208b2cd0dc946b59b2b50f (patch) | |
tree | 92e90885c812dc5abcd04471f691db851f296047 /classes | |
parent | e07765d6ea242d863c3f4f81bdc6379ae61347c5 (diff) | |
parent | b7031362eafd33ad5c421b07f2bc4f37e4f8a829 (diff) |
merge of '964b970138436b573add519a1eae7ca7aec32517'
and 'b8eab3d0461de7af79a745d6b20c8e008acb7af4'
Diffstat (limited to 'classes')
-rw-r--r-- | classes/cmake.bbclass | 7 | ||||
-rw-r--r-- | classes/concatenated-image.bbclass | 38 | ||||
-rw-r--r-- | classes/module-base.bbclass | 4 | ||||
-rw-r--r-- | classes/module.bbclass | 3 |
4 files changed, 51 insertions, 1 deletions
diff --git a/classes/cmake.bbclass b/classes/cmake.bbclass new file mode 100644 index 0000000000..cec74349dc --- /dev/null +++ b/classes/cmake.bbclass @@ -0,0 +1,7 @@ +inherit autotools + +cmake_do_configure() { + cmake . -DCMAKE_INSTALL_PREFIX:PATH=${prefix} +} + +EXPORT_FUNCTIONS do_configure diff --git a/classes/concatenated-image.bbclass b/classes/concatenated-image.bbclass new file mode 100644 index 0000000000..5cf8d33c05 --- /dev/null +++ b/classes/concatenated-image.bbclass @@ -0,0 +1,38 @@ + +# +# define the FLASH_KERNEL_SIZE and FLASH_ROOT_SIZE in your machine.conf, +# and this class builds a simple, padded concatenated image of +# <kernel><padding><rootfs> and performs error checking that either +# kernel or rootfs isn't too large to fit. +# +concat_pack_image() { + # find latest kernel - is there a more general way to do this? + KERNEL=`ls -tr ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}* | tail -n 1` + if [ -z "$KERNEL" ]; then + oefatal "No kernel found in ${DEPLOY_DIR_IMAGE}. Was expecting a ${KERNEL_IMAGETYPE}\* file." + exit 1 + fi + ROOTFS=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 + OUTPUT=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.flash.img + PADFILE=${DEPLOY_DIR_IMAGE}/padfile.zzz + KERNEL_SIZE_MAX_DEC=`echo ${FLASH_KERNEL_SIZE} | awk --non-decimal-data '{printf "%d\n", $1}' ` + ROOT_SIZE_MAX_DEC=`echo ${FLASH_ROOT_SIZE} | awk --non-decimal-data '{printf "%d\n", $1}' ` + KERNEL_SIZE=`ls -l $KERNEL | awk '{print $5}'` + if [ $KERNEL_SIZE -gt $KERNEL_SIZE_MAX_DEC ]; then + oefatal "Kernel too large at $KERNEL_SIZE bytes. Max is $KERNEL_SIZE_MAX_DEC." + exit 1 + fi + ROOT_SIZE=`ls -l $ROOTFS | awk '{print $5}'` + if [ $ROOT_SIZE -gt $ROOT_SIZE_MAX_DEC ]; then + oefatal "Rootfs is too large at $ROOT_SIZE bytes. Max is $ROOT_SIZE_MAX_DEC." + exit 1 + fi + PAD_SIZE=`echo "$KERNEL_SIZE_MAX_DEC - $KERNEL_SIZE" | bc ` + dd if=/dev/zero of=$PADFILE bs=$PAD_SIZE count=1 2>>/dev/null + cat $KERNEL $PADFILE $ROOTFS > $OUTPUT + rm -f $PADFILE + ls -l $OUTPUT +} + +IMAGE_POSTPROCESS_COMMAND += "concat_pack_image; " + diff --git a/classes/module-base.bbclass b/classes/module-base.bbclass index da5bd01dae..c98baceeab 100644 --- a/classes/module-base.bbclass +++ b/classes/module-base.bbclass @@ -10,6 +10,7 @@ export KERNEL_SOURCE = "${@base_read_file('${STAGING_KERNEL_DIR}/kernel-source') KERNEL_OBJECT_SUFFIX = "${@[".o", ".ko"][base_read_file('${STAGING_KERNEL_DIR}/kernel-abiversion') > "2.6.0"]}" KERNEL_CCSUFFIX = "${@base_read_file('${STAGING_KERNEL_DIR}/kernel-ccsuffix')}" KERNEL_LDSUFFIX = "${@base_read_file('${STAGING_KERNEL_DIR}/kernel-ldsuffix')}" +KERNEL_ARSUFFIX = "${@base_read_file('${STAGING_KERNEL_DIR}/kernel-arsuffix')}" # Set TARGET_??_KERNEL_ARCH in the machine .conf to set architecture # specific options necessary for building the kernel and modules. @@ -17,9 +18,12 @@ TARGET_CC_KERNEL_ARCH ?= "" HOST_CC_KERNEL_ARCH ?= "${TARGET_CC_KERNEL_ARCH}" TARGET_LD_KERNEL_ARCH ?= "" HOST_LD_KERNEL_ARCH ?= "${TARGET_LD_KERNEL_ARCH}" +TARGET_AR_KERNEL_ARCH ?= "" +HOST_AR_KERNEL_ARCH ?= "${TARGET_AR_KERNEL_ARCH}" KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc${KERNEL_CCSUFFIX} ${HOST_CC_KERNEL_ARCH}" KERNEL_LD = "${LD}${KERNEL_LDSUFFIX} ${HOST_LD_KERNEL_ARCH}" +KERNEL_AR = "${AR}${KERNEL_ARSUFFIX} ${HOST_AR_KERNEL_ARCH}" # kernel modules are generally machine specific PACKAGE_ARCH = "${MACHINE_ARCH}" diff --git a/classes/module.bbclass b/classes/module.bbclass index 7083076b5f..1d0f1dd4f8 100644 --- a/classes/module.bbclass +++ b/classes/module.bbclass @@ -9,7 +9,8 @@ module_do_compile() { KERNEL_SRC=${STAGING_KERNEL_DIR} \ KERNEL_VERSION=${KERNEL_VERSION} \ CC="${KERNEL_CC}" LD="${KERNEL_LD}" \ - ${MAKE_TARGETS} + AR="${KERNEL_AR}" \ + ${MAKE_TARGETS} } module_do_install() { |