cancel
Showing results for 
Search instead for 
Did you mean: 

Fail to add file into rootfs in Yocto

HYC
Associate

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

1 ACCEPTED SOLUTION

Accepted Solutions
Erwan SZYMANSKI
ST Employee

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.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

View solution in original post

2 REPLIES 2
Erwan SZYMANSKI
ST Employee

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.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

It is working, thank you @Erwan SZYMANSKI .