All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gary Thomas <gary@mlbassoc.com>
To: Yocto Project <yocto@yoctoproject.org>
Subject: Very strange append issue
Date: Sun, 01 Dec 2013 07:01:36 -0700	[thread overview]
Message-ID: <529B4140.2040801@mlbassoc.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3607 bytes --]

I'm having a very strange behaviour in one of my recipes.  I have two
recipes which are tightly coupled.  In one, the 'disk-installer', I'd
like to reuse a source file from another 'installer' so that I only need
to make changes in a single place (good practice).  To this end, I have
a structure like this (the 'installer' recipe is in another layer):

meta-mytarget/packages/misc/
├── disk-installer_0.0.bb
├── installer
│   └── mytarget
│       ├── 6x_bootscript.txt -> ../../../../recipes-bsp/u-boot/u-boot-script-boundary/6x_bootscript.txt
│       ├── do_install.defaults
│       ├── do_install.post
├── installer_0.0.bbappend

In the 'disk-installer' recipe, I have:
   FILESEXTRAPATHS_prepend := "${THISDIR}/installer:"
so that 'disk-installer' can pick up (share) 'do_install.defaults'
That part works fine.  The problem is that there is a 'do_install_append()'
fragment in 'installer_0.0.bbappend' that is being attached to the
'do_install()' of 'disk-installer_0.0.bb'!

Here's what I mean - from 'disk-installer_0.0.bb':
do_install() {
     # Copy images for fully recoverable image
     MAC_ADDR=ignored . ${WORKDIR}/do_install.defaults
     for f in ${KERNEL} ${ROOTFS} ${UBOOT}; do
       if [ -e ${DEPLOY_DIR_IMAGE}/`basename $f` ]; then
         install -d ${D}/`dirname $f`
         cp -L ${DEPLOY_DIR_IMAGE}/`basename $f` ${D}/`dirname $f`
       fi
     done
}

and from 'installer_0.0.bbappend':
do_install_append() {
     # Additional installation steps
     install -m 0755 ${WORKDIR}/do_install.post ${D}/etc/do_install.post
     mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "U-Boot script" -d ${WORKDIR}/6x_bootscript.txt ${D}/etc/6x_bootscript
}

The 'installer' bit makes no sense for the 'disk-installer' recipe
and yet when this package is built, I get this in 'run.do_install':
do_install() {
     # Copy images for fully recoverable image
     MAC_ADDR=ignored . /local/p8301_new/tmp/work/mytarget-amltd-linux-gnueabi/disk-installer/0.0-r0/do_install.defaults
     for f in ${KERNEL} ${ROOTFS} ${UBOOT}; do
       if [ -e /local/p8301_new/tmp/deploy/images/mytarget/`basename $f` ]; then
         install -d /local/p8301_new/tmp/work/mytarget-amltd-linux-gnueabi/disk-installer/0.0-r0/image/`dirname $f`
         cp -L /local/p8301_new/tmp/deploy/images/mytarget/`basename $f` /local/p8301_new/tmp/work/mytarget-amltd-linux-gnueabi/disk-installer/0.0-r0/image/`dirname $f`
       fi
     done
     # Additional installation steps
     install -m 0755 /local/p8301_new/tmp/work/mytarget-amltd-linux-gnueabi/disk-installer/0.0-r0/do_install.post 
/local/p8301_new/tmp/work/mytarget-amltd-linux-gnueabi/disk-installer/0.0-r0/image/etc/do_install.post
     mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "U-Boot script" -d /local/p8301_new/tmp/work/mytarget-amltd-linux-gnueabi/disk-installer/0.0-r0/6x_bootscript.txt 
/local/p8301_new/tmp/work/mytarget-amltd-linux-gnueabi/disk-installer/0.0-r0/image/etc/6x_bootscript

}

I can see by the copied comment (#) lines that this fragment
is coming exactly from 'installer_0.0.bbappend'

This looks totally wrong to me.  Am I missing something (and
it should work this way)??

The complete recipes and fragments are attached in case my explanation
is a bit confusing.

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

[-- Attachment #2: disk-installer_0.0.bb --]
[-- Type: text/plain, Size: 871 bytes --]

DESCRIPTION = "Additional setup for self-contained disk based installer"
SECTION = "base"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 "
FILESEXTRAPATHS_prepend := "${THISDIR}/installer:"

# These files get dragged in by this process
DEPENDS += "amltd-console-image linux-boundary u-boot-fslc"

# Pick up defaults used by network installer
SRC_URI += " \
            file://do_install.defaults \
"

S = "${WORKDIR}"

PACKAGE_ARCH = "${MACHINE_ARCH}"

do_install() {
    # Copy images for fully recoverable image
    MAC_ADDR=ignored . ${WORKDIR}/do_install.defaults
    for f in ${KERNEL} ${ROOTFS} ${UBOOT}; do
      if [ -e ${DEPLOY_DIR_IMAGE}/`basename $f` ]; then
        install -d ${D}/`dirname $f`
        cp -L ${DEPLOY_DIR_IMAGE}/`basename $f` ${D}/`dirname $f`
      fi
    done
}

FILES_${PN} += "/local"

[-- Attachment #3: installer_0.0.bbappend --]
[-- Type: text/plain, Size: 507 bytes --]

#
# Just tell BitBake where to find my component files
#
FILESEXTRAPATHS_prepend := "${THISDIR}/installer:"

SRC_URI += " \
            file://do_install.post \
	    file://6x_bootscript.txt \
"

COMPATIBLE_MACHINE = "${MACHINE}"

do_install_append() {
    # Additional installation steps
    install -m 0755 ${WORKDIR}/do_install.post ${D}/etc/do_install.post            
    mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "U-Boot script" -d ${WORKDIR}/6x_bootscript.txt ${D}/etc/6x_bootscript
}



             reply	other threads:[~2013-12-01 14:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-01 14:01 Gary Thomas [this message]
2013-12-01 14:37 ` Very strange append issue Nicolas Dechesne
2013-12-01 14:50   ` Gary Thomas
2013-12-01 14:59     ` Nicolas Dechesne
2013-12-01 15:20       ` Gary Thomas
2013-12-02  1:02         ` Nathan Rossi
2013-12-02 15:00           ` Gary Thomas

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=529B4140.2040801@mlbassoc.com \
    --to=gary@mlbassoc.com \
    --cc=yocto@yoctoproject.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.