Why is the base-files recipe different?


Morten Bruun
 

Hi,

I'm trying to install different fstab files based on the image being built. As far as I can tell this should be possible by using BBCLASSEXTEND. 

The error I get is: 

Error: Transaction check error:
  file /etc/fstab conflicts between attempted installs of base-files-foo-3.0.14-r89.raspberrypi3 and base-files-3.0.14-r89.raspberrypi3

If I do the exact same thing with the iptables recipe - it works perfectly. Why is base-files different?

Any help is much appreciated,
Morten

Here is what I have done:
-----------------------------------

Created foo.class:

CLASSOVERRIDE .= ":class-foo"

python foo_virtclass_handler () {
    # Do nothing if this is inherited, as it's for BBCLASSEXTEND
    if "foo" not in (d.getVar('BBCLASSEXTEND') or ""):
        bb.error("Don't inherit foo, use BBCLASSEXTEND")
        return

    # Restore BPN
    bpn = d.getVar('BPN')
    newbpn = bpn.replace('-foo', '')
    d.setVar('BPN', newbpn)

    # Use default FILESPATH searching for patches and files
    filespath = d.getVar('FILESPATH', True)
    newfilespath = filespath.replace('-foo', '')
    d.setVar('FILESPATH', newfilespath)
}

addhandler foo_virtclass_handler
foo_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise"

============================================================

Added base-files_3.0.14.bbappend:

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"

BBCLASSEXTEND = "foo"

SRC_URI_append_class-foo = " file://fstab.foo "

do_install_append_class-foo () {
    install -d ${D}${sysconfdir}
    install -m 644 ${WORKDIR}/fstab.foo ${D}${sysconfdir}/fstab
}

============================================================

Added my fstab.foo in the base-files directory next to the .bbappend file.
Added IMAGE_INSTALL += "base-files-foo" to my local.conf.

============================================================

Join yocto@lists.yoctoproject.org to automatically receive all group messages.