Skip to main content
Associate
Nov 23, 2023 08:48 UTC
Solved

Fail to add file into rootfs in Yocto

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.
Erwan SZYMANSKI
Erwan SZYMANSKIBest answer
ST Technical Moderator
Nov 23, 2023 09:34 UTC

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.

2 replies

Erwan SZYMANSKI
Erwan SZYMANSKIBest answer
ST Technical Moderator
Nov 23, 2023 09:34 UTC

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.
HYCAuthor
Associate
Nov 24, 2023 01:51 UTC

It is working, thank you @Erwan SZYMANSKI .