Openembedded Devel Discussions
 help / color / mirror / Atom feed
From: Ulf Samuelsson <openembedded@emagii.com>
To: Paul Eggleton <paul.eggleton@linux.intel.com>
Cc: openembedded-devel@lists.openembedded.org
Subject: Re: Finding out the IMAGE_BASENAME of the image beeing built
Date: Sat, 30 Mar 2013 22:01:24 +0100	[thread overview]
Message-ID: <515752A4.3040107@emagii.com> (raw)
In-Reply-To: <7185981.fYmuEdii30@helios>

On 2013-03-30 15:13, Paul Eggleton wrote:
> On Saturday 30 March 2013 13:32:51 Ulf Samuelsson wrote:
>> Trying create a programming script recipe and need to find out the
>> IMAGE_BASENAME of the bitbake target
>> so I can get the filename of the image
>>
>> ${MACHINE}-${IMAGE_BASENAME}.ubi
>>
>> I.E: if I do
>>
>> $ MACHINE=beagleboard  bitbake some-image
>>
>> and "some-image_1.0.bb" contains
>>
>> IMAGE_BASENAME = "renamed-image"
>>
>> Then the resulting image will be
>>
>>       "beagleboard-renamed-image.ubi"
>>
>> How get this info from another recipe?
> You can't. The way to handle this is as part of do_rootfs itself (e.g. from a
> script called from ROOTFS_POSTPROCESS_COMMAND or IMAGE_POSTPROCESS_COMMAND).
>
> Cheers,
> Paul
>
OK, thanks

I tried to define  "configure-sam-ba.bbclass" which is inherited by my 
image.

configure-sam-ba.bbclass:
----------------------------------------------------------------------------------------------------------

SCRIPTFILE_TEMPLATE    = "${DEPLOY_DIR_IMAGE}/scripts/${MACHINE}.tcl"
SCRIPTFILE                      = 
"${DEPLOY_DIR_IMAGE}/scripts/${IMAGE_LINK_NAME}-${MACHINE}.tcl"
PROGFILE_TEMPLATE      = "${DEPLOY_DIR_IMAGE}/scripts/prog.sh"
PROGFILE                        = 
"${DEPLOY_DIR_IMAGE}/scripts/prog-${IMAGE_LINK_NAME}-${MACHINE}.sh"

sam-ba_setup () {

     if [ -e  ${PROGFILE_TEMPLATE} ] ; then
         sed    -i    s/#MACHINE#/${MACHINE}/ ${PROGFILE_TEMPLATE}
         sed    -i    s/#IMAGE#/${IMAGE_LINK_NAME}/ ${PROGFILE_TEMPLATE}
     fi
     cp    ${PROGFILE_TEMPLATE}    ${PROGFILE}

     if [ -e  ${SCRIPTFILE_TEMPLATE} ] ; then
         sed    -i    s/rootfs.ubi/${IMAGE_LINK_NAME}-${MACHINE}/ 
${SCRIPTFILE_TEMPLATE}
     fi
     cp    ${SCRIPTFILE_TEMPLATE}    ${SCRIPTFILE}
}

EXPORT_FUNCTIONS sam-ba_setup

EXTRA_IMAGEDEPENDS_append_mymachine = ' sam-ba'
IMAGE_POSTPROCESS_COMMAND_append_mymachine = " sam-ba_setup; "
----------------------------------------------------------------------------------------------------------
myimage.bb: contains.

inherit configure-sam-ba
----------------------------
It appears that the "configure-sam-ba.bbclass" file is found.
If I change the filename in the inherit statement I get an error message.

inherit configure-sam-ba-x
I get an error message.

Another indication is that the call to "sam-ba_setup;"  is inserted in 
the "run.do_rootfs.*" script,
but the script does not contain the "sam-ba_setup" subroutine.

In some places IMAGE_POSTPROCESS_COMMAND contains " 
rootfs_update_timestamp ",
from image.bbclass which *is* included in the "run.do_rootfs.*" script.

Should you not be able to use commands from a bbclass as 
PRE/POSTPROCESS_COMMAND?

A standard shell command will work, but since I need a number of 
commands, it seems
cleaner to implement it in a bbclass file.
This is my first bbclass file, so there may be things, I don't understand...


BR
Ulf Samuelsson






  reply	other threads:[~2013-03-30 21:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-30 12:32 Finding out the IMAGE_BASENAME of the image beeing built Ulf Samuelsson
2013-03-30 13:04 ` Takeshi Hamasaki
2013-03-30 14:36   ` Ulf Samuelsson
2013-03-30 14:13 ` Paul Eggleton
2013-03-30 21:01   ` Ulf Samuelsson [this message]
2013-04-01 13:09 ` Takeshi Hamasaki

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=515752A4.3040107@emagii.com \
    --to=openembedded@emagii.com \
    --cc=openembedded-devel@lists.openembedded.org \
    --cc=paul.eggleton@linux.intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox