yoctobitbakerootfs

Why can't I copy files into the rootFS from a Yocto recipe


I am bringing up a newer version of Linux (we were running 3.14 on a buildroot system, which is ancient) and am trying to add an older version of mplayer as a workaround until our application can be updated to work with a newer/alternative video player. I have added a new recipe, and added that recipe to my build, but I can't seem to get a do_install that works.

Just for some background information, I am running the Pyro release of Poky. The target is an i.MX6.

Here is the original recipe I wrote.


    DESCRIPTION = "Load an older version of mplayer as a workaround until a new media player can be used."
    PRIORITY = "optional"
    LICENSE = "CLOSED"

    FILES_${PN} += "/usr/bin/mplayer \
        /usr/lib/libbz2.so.1.0.6 \
        /usr/lib/libfribidi.so.0.3.5"

    SRC_URI = "file://mplayer \
        file://libbz2.so.1.0.6 \
        file://libfribidi.so.0.3.5"

    do_install() {
        ln -s /usr/lib/libbz2.so.1.0.6 ${D}/usr/lib/libbz2.so
        ln -s /usr/lib/libfribidi.so.0.3.5 ${D}/usr/lib/libfribidi.so
    }

I also tried a stripped down version that only copied over the old mplayer executable. Note that I didn't use install since that prompted an "QA Issue : already stripped" error, that even adding "INSANE_SKIP_qwt_append = “already-stripped” to my local.conf did not resolve that.


    DESCRIPTION = "Load an older version of mplayer as a workaround until a new media player can be used."
    PRIORITY = "optional"
    LICENSE = "CLOSED"

    FILES_${PN} += "/usr/bin/mplayer"

    SRC_URI = "file://mplayer"

    do_install() {
        cp ${WORKDIR}/mplayer ${D}${base_bindir}/mplayer
    }

In the original recipe I am seeing that it can't create the link. Changing it to a relative path (adding the -r) made no difference.


    | ln: failed to create symbolic link '/home/gen-ccm-root/workdir/tools/poky/build-dev/tmp/work/armv7ahf-neon-poky-linux-gnueabi/temp-mplayer/1.0-r0/image/usr/lib/libbz2.so': No such file or directory
    | WARNING: exit code 1 from a shell command.
    | ERROR: Function failed: do_install (log file is located at /home/gen-ccm-root/workdir/tools/poky/build-dev/tmp/work/armv7ahf-neon-poky-linux-gnueabi/temp-mplayer/1.0-r0/temp/log.do_install.31008)
    ERROR: Task (/home/gen-ccm-root/workdir/tools/poky/meta-markem-imaje-private-bsp/recipes-core/temp-mplayer/temp-mplayer_1.0.bb:do_install) failed with exit code '1'

In the stripped down version, I am seeing the following:


    | DEBUG: Executing shell function do_install
    | cp: cannot create regular file '/home/gen-ccm-root/workdir/tools/poky/build-dev/tmp/work/armv7ahf-neon-poky-linux-gnueabi/temp-mplayer/1.0-r0/image/bin/mplayer': No such file or directory
    | WARNING: exit code 1 from a shell command.
    | ERROR: Function failed: do_install (log file is located at /home/gen-ccm-root/workdir/tools/poky/build-dev/tmp/work/armv7ahf-neon-poky-linux-gnueabi/temp-mplayer/1.0-r0/temp/log.do_install.30663)
    ERROR: Task (/home/gen-ccm-root/workdir/tools/poky/meta-markem-imaje-private-bsp/recipes-core/temp-mplayer/temp-mplayer_1.0.bb:do_install) failed with exit code '1'
    NOTE: Tasks Summary: Attempted 2721 tasks of which 2718 didn't need to be rerun and 1 failed.

I am not too worried about adding the ldconfig call (another problem for another day), but would at least like the files to appear in the RootFS, or at least successfully create an image. If I remove this recipe, I can build a usable image that I can burn into an SD card, so the issue I am pretty sure is in this recipe.

I have seen this question: Bitbake not installing my file in the rootfs image and used it as the basis for building this recipe, but I apparently missed something.


Solution

  • The original recipe does not copy the files to the destination. You first need to copy them over, then create symlinks.

    The second recipe copies a file to a directory that does not exist. Create it first.