Raxesh Oriya
Raxesh Oriya

Reputation: 413

FIle is not being copied in WORKDIR from Image recipe in Yocto

I am trying to install a simple file to /etc directory of target rootfs. I am building core-image-sato. "raxy_test" file(in below recipe) is not even being copied in WORKDIR also.

Am I doing anything wrong?

I am able to do same with normal recipe but not with image recipe.

What is the difference between normal and image recipe?

DESCRIPTION = "Image with Sato, a mobile environment and visual style for \                                                                                                                    
mobile devices. The image supports X11 with a Sato theme, Pimlico \
applications, and contains terminal, editor, and file manager."

IMAGE_FEATURES += "splash package-management x11-base x11-sato ssh-server-dropbear hwcodecs"

LICENSE = "MIT"

inherit core-image

TOOLCHAIN_HOST_TASK_append = " nativesdk-intltool nativesdk-glib-2.0"
TOOLCHAIN_HOST_TASK_remove_task-populate-sdk-ext = " nativesdk-intltool nativesdk-glib-2.0"

LICENSE="CLOSED"
LIC_FILES_CHKSUM="" 

SRC_URI = "\
          file://raxy_test \
          "   
do_install() {
    install -d ${D}${sysconfdir}
    install -m 0755 raxy_test ${D}${sysconfdir}
}

I expect "raxy_test" file to be present in WORKDIR as well as in /etc directory of target.

Any help will really be appreciated, Thanks...!!!

Upvotes: 0

Views: 1923

Answers (1)

PierreOlivier
PierreOlivier

Reputation: 1556

Multiple things:

  • You use a image recipe (core-image-sato) to add a file in your image. You should use a separate recipe for this modification;
  • The install is not correct (WORKDIR is not used);
  • You do not populate the packages (FILES_${PN} not present).

For the separate recipe, create a file (for example myrecipe.bb or whatever you want) in a recipes-* sub directory (you need to place it at the same folder level than other recipes !). I did not test it but I think this can be a base:

DESCRIPTION = "My recipe"
LICENSE="CLOSED"

PR = "r0"
PV = "0.1"

SRC_URI = " file://raxy_test "

 # Create package specific skeleton
do_install() {
    install -d ${D}${sysconfdir}
    install -m 0755 ${WORKDIR}/raxy_test ${D}${sysconfdir}/raxy_test
}

# Populate packages
FILES_${PN} = "${sysconfdir}"

You can notice that some things have changed:

The install must include the ${WORKDIR} path:

install -m 0755 ${WORKDIR}/raxy_test ${D}${sysconfdir}

And we need to populate the package:

FILES_${PN} = "${sysconfdir}"

This will add the files in ${sysconfdir} into the package ${PN} (which is by default the recipe name).

Upvotes: 2

Related Questions