From: Denys Dmytriyenko <denis@denix.org>
To: openembedded-devel@lists.openembedded.org
Subject: base.bbclass problem? Was: package-stagefile-shell() breaks if DEPLOY_DIR is outside of TMPDIR
Date: Fri, 26 Sep 2008 13:39:01 -0400 [thread overview]
Message-ID: <20080926173901.GA16384@denix.org> (raw)
In-Reply-To: <20080925042321.GC4510@denix.org>
Does anybody have any comments? Am I doing something totally wrong? Or is it
too low-level so nobody wants to touch it? Please let me know. Thanks.
On Thu, Sep 25, 2008 at 12:23:21AM -0400, Denys Dmytriyenko wrote:
> Hi,
>
> I just submitted a bug report #4580, but wanted to follow up here as my
> description/fix maybe controversial or at least touches the low-level stuff.
>
> Here is the description from the ticket:
>
> When DEPLOY_DIR is configured to be outside of TMPDIR, building a kernel
> breaks, as "cp" cannot copy a file into itself:
>
> cp: `/OE/deploy/glibc/images/omap3evm/uImage.bin' and `/OE/deploy/glibc/images/omap3evm/uImage.bin' are the same file
>
> What happens is inside the do_deploy() function of the kernel.bbclass it calls
> package-stagefile-shell() with the uImage binary in DEPLOY_DIR as a parameter:
>
> package_stagefile_shell ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_BASE_NAME}.bin
>
> That function is supposed to save a copy of the file in the staging directory
> (packaged-staging magic):
>
> package_stagefile_shell() {
> if [ "$PSTAGING_ACTIVE" = "1" ]; then
> srcfile=$1
> destfile=`echo $srcfile | sed s#${TMPDIR}#${PSTAGE_TMPDIR_STAGE}#`
> destdir=`dirname $destfile`
> mkdir -p $destdir
> cp -dp $srcfile $destfile
> fi
> }
>
> The problem there is it substitutes (sed) TMPDIR with PSTAGE_TMPDIR_STAGE in
> file's path. It works if DEPLOY_DIR is inside TMPDIR, but the path remains the
> same if otherwise, leading to the mentioned error.
>
> The function above is a shell counterpart of the python package_stagefile(). I
> grepped both of them and it appears the python function is used inside the
> package.bbclass to do some actual staging, while the shell function is only
> used in recipes for kernels and bootloaders (u-boot, x-load) and is always
> called with files in DEPLOY_DIR.
>
> So, changing above sed command to:
>
> sed s#${DEPLOY_DIR}#${PSTAGE_TMPDIR_STAGE}#`
>
> makes it work and doesn't seem to break anything else for me. I think the
> function maybe renamed to package_stagefile_deploy() to reflect its purpose,
> but that would require changes in several recipes.
>
> I'm attaching the actual patch for review. It works for me, but I'm not sure
> how correct it is, so I'm asking here. Thanks.
>
> --
> Denys
> diff --git a/classes/base.bbclass b/classes/base.bbclass
> index 540b891..1172b8f 100644
> --- a/classes/base.bbclass
> +++ b/classes/base.bbclass
> @@ -389,7 +389,7 @@ def package_stagefile(file, d):
> package_stagefile_shell() {
> if [ "$PSTAGING_ACTIVE" = "1" ]; then
> srcfile=$1
> - destfile=`echo $srcfile | sed s#${TMPDIR}#${PSTAGE_TMPDIR_STAGE}#`
> + destfile=`echo $srcfile | sed s#${DEPLOY_DIR}#${PSTAGE_TMPDIR_STAGE}#`
> destdir=`dirname $destfile`
> mkdir -p $destdir
> cp -dp $srcfile $destfile
next prev parent reply other threads:[~2008-09-26 17:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-25 4:23 package-stagefile-shell() breaks if DEPLOY_DIR is outside of TMPDIR Denys Dmytriyenko
2008-09-26 17:39 ` Denys Dmytriyenko [this message]
2008-09-26 19:22 ` base.bbclass problem? Was: " Koen Kooi
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=20080926173901.GA16384@denix.org \
--to=denis@denix.org \
--cc=openembedded-devel@lists.openembedded.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.