deploy
and pstage
directories outside the temp directory of a standard OE build. It works fine for building a filesystem, but when it comes to building a kernel or a bootloader, it brakes. After spending some time debugging this issue I submitted a bug report and followed up on the oe-dev mailing list. Below is the full text of my post.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:
WhenDEPLOY_DIR
is configured to be outside ofTMPDIR
, building a kernel breaks, ascp
cannot copy a file into itself:
What happens is inside thecp: `/OE/deploy/glibc/images/omap3evm/uImage.bin' and `/OE/deploy/glibc/images/omap3evm/uImage.bin' are the same file
do_deploy()
function of thekernel.bbclass
it callspackage_stagefile_shell()
with theuImage
binary inDEPLOY_DIR
as a parameter:
That function is supposed to save a copy of the file in the staging directory (packaged-staging magic):package_stagefile_shell ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_BASE_NAME}.bin
The problem there is it substitutes (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 }
sed
)TMPDIR
withPSTAGE_TMPDIR_STAGE
in file's path. It works ifDEPLOY_DIR
is insideTMPDIR
, but the path remains the same if otherwise, leading to the mentioned error.
The function above is a shell counterpart of the pythonpackage_stagefile()
. I grepped both of them and it appears the python function is used inside thepackage.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 inDEPLOY_DIR
.
So, changing abovesed
command to:
makes it work and doesn't seem to break anything else for me. I think the function maybe renamed tosed s#${DEPLOY_DIR}#${PSTAGE_TMPDIR_STAGE}#
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.
Koen thinks my "patch is a step in the right direction", whatever that means... :)
No comments:
Post a Comment