X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=classes%2Fsrec.bbclass;h=a869a4f1f37306ec97d45b6eed23b1615d5a8eea;hb=61a4d2af2319ea876bc35ce0bca63eb2e0252431;hp=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391;hpb=da6d0da8a56c1fbe57110abc8368252fd6fbe0fd;p=openembedded.git diff --git a/classes/srec.bbclass b/classes/srec.bbclass index e69de29bb2..a869a4f1f3 100644 --- a/classes/srec.bbclass +++ b/classes/srec.bbclass @@ -0,0 +1,28 @@ +# +# Creates .srec files from images. +# +# Useful for loading with Yamon. + +# Define SREC_VMAADDR in your machine.conf. + +SREC_CMD = "${TARGET_PREFIX}objcopy -O srec -I binary --adjust-vma ${SREC_VMAADDR} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.${type} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.${type}.srec" + +# Do not build srec files for these types of images: +SREC_SKIP = "tar" + +do_srec[nostamp] = "1" + +do_srec () { + if [ ${SREC_VMAADDR} = "" ] ; then + oefatal Cannot do_srec without SREC_VMAADDR defined. + fi + for type in ${IMAGE_FSTYPES}; do + for skiptype in ${SREC_SKIP}; do + if [ $type = $skiptype ] ; then continue 2 ; fi + done + ${SREC_CMD} + done + return 0 +} + +addtask srec after do_rootfs before do_build