All of lore.kernel.org
 help / color / mirror / Atom feed
* Very strange append issue
@ 2013-12-01 14:01 Gary Thomas
  2013-12-01 14:37 ` Nicolas Dechesne
  0 siblings, 1 reply; 7+ messages in thread
From: Gary Thomas @ 2013-12-01 14:01 UTC (permalink / raw)
  To: Yocto Project

[-- 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
}



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-12-02 15:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-01 14:01 Very strange append issue Gary Thomas
2013-12-01 14:37 ` 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

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.