xyf
xyf

Reputation: 714

Integrated a custom recipe but don't see any changes in rootfs after flashing

I created a custom recipe which includes some service files to be a part of sysfs, and even though I'm able to build the entire image and flash it, I just don't see any changes in the rootfs.

bitbake-layers show-recipes | grep <recipe-name>
// i see the newly added recipe here

The following is the do_install_append() in the recipe bb file:

do_install_append() {
   if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
      install -d ${D}/etc/initscripts
      install -d ${D}${systemd_unitdir}/system
      mv ${D}/etc/init.d/<daemon_file> ${D}/etc/initscripts/<daemon_file>
      install -m 0644 ${WORKDIR}/<recipe>/<service_file> ${D}${systemd_unitdir}/system/<service_file>

      install -d ${D}${systemd_unitdir}/system/multi-user.target.wants/
      ln -sf ${systemd_unitdir}/system/<service_file>  ${D}${systemd_unitdir}/system/multi-user.target.wants/<service_file>
  fi
}

I go into /etc/initscripts/ and don't see <daemon_file> for instance.

Is there anything else I should be looking into to debug the issue because the build itself runs fine?

Upvotes: 0

Views: 354

Answers (2)

Talel BELHAJSALEM
Talel BELHAJSALEM

Reputation: 4304

There is nothing wrong with your recipe.

Here are some points to consider:

  • Your do_install_append copies the file only if systemd is in DISTRO_FEATURES.

To make sure of that, check:

bitbake -e | grep ^DISTRO_FEATURES=

or add bbwarn "Message" into your recipe to make sure that the block is executed.

  • Make sure to add the files to FILES_${PN}:
FILES_${PN} += "/etc/initscripts/<daemon_file> \
                ${systemd_unitdir}/system/<service_file> \
                ${systemd_unitdir}/system/multi-user.target.wants/<service_file>"
  • Check the ${D} folder of the recipe before building the full image.
$ bitbake -e <recipe> | grep ^D=
D=".../tmp/work/.../<recipe>/<version>/image"

$ cd <path>
$ tree .

To activate systemd use:

INIT_MANAGER = "systemd"

Upvotes: 1

Ross Burton
Ross Burton

Reputation: 4053

Did you actually install the package this recipe creates into the image? Just because you bitbake a recipe doesn't mean the contents go into every image, you need to add the package name to IMAGE_INSTALL too.

Upvotes: 0

Related Questions