Skip to main content
Explorer
November 23, 2023
Solved

Fail to add file into rootfs in Yocto

  • November 23, 2023
  • 1 reply
  • 5180 views

I have a simple recipes, which used to install certain files to rootfs, as below:

DESCRIPTION = "A hello world example"
SECTION = "appauto"
DEPENDS = ""
LICENSE = "CLOSED"

FILESEXTRAPATHS:append := ":${THISDIR}/file"
SRC_URI = "file://hello.service \
"

do_install() {
install -d ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/hello.service ${D}${systemd_unitdir}/system

}

FILES_${PN} += "${systemd_unitdir}/system"

When bitbake this recipes, it will generate error message as:

NOTE: Executing Tasks
ERROR: appauto-1.0-r0 do_package: QA Issue: appauto: Files/directories were installed but not shipped in any package:
/lib
/lib/systemd
/lib/systemd/system
/lib/systemd/system/hello.service
Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.


However, if I change directories installation variables from "systemd_unitdir" to "base_bindir", then everything is OK.

Then I try many different directory variable, then I see "prefix", "base_prefix", "exec_prefix" is not working,

"base_bindir", "sysconfdir" and "localstatedir" is OK. Why?

 

In this case, I have to install my service to /lib/systemd/system/ to enable automatic execution.

Any comments are appreciated

Thanks.

HY

    This topic has been closed for replies.
    Best answer by Erwan SZYMANSKI

    Hello @HYC ,
    Can you try with replacing FILE_${PN} by FILE:${PN} ?  You will find example in existing recipes. I think you get inspired by an old recipe online that was formatted with the old syntax.

    Kind regards,
    Erwan.

    1 reply

    Technical Moderator
    November 23, 2023

    Hello @HYC ,
    Can you try with replacing FILE_${PN} by FILE:${PN} ?  You will find example in existing recipes. I think you get inspired by an old recipe online that was formatted with the old syntax.

    Kind regards,
    Erwan.

    HYCAuthor
    Explorer
    November 24, 2023

    It is working, thank you @Erwan SZYMANSKI .