From: linusnilsson@hotmail.com
To: yocto@lists.yoctoproject.org
Subject: Correct way for multiple recipes to install files in the same directory
Date: Thu, 11 Apr 2024 00:52:49 -0700 [thread overview]
Message-ID: <ZfwI.1712821969796887981.Ve9P@lists.yoctoproject.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 1227 bytes --]
Hi!
How/can I let multiple recipes install files in the same directory without getting a conflict during bitbake process?
Recipe 1 creates a user and its homedir:
inherit useradd
USERADD_PACKAGES = "${PN}"
USERADD_PARAM:${PN} = "-u 1000 -d /home/user1 -m -s /bin/bash -p 'XXX' user1"
do_install(){
install -d ${D}/home/user1
chown -R user1:user1 ${D}/home/user1
}
Recipe 2 wants to install some config-files inside /home/user1/.config/.
DEPENDS = "recipe1"
RDEPENDS:${PN} = "recipe1"
do_install(){
install -d ${D}/home/user1/.config/
install -m 0644 sourcefile ${D}/home/user1/.config/
chown -R user1:user1 ${D}/home/user1/.config/
}
There is also FILES directives at the end of each recipe for the corresponding files. For better readability I've removed everything that I deemed was irrelevant.
The problem I get when trying to bitbake the image is during the do_rootfs stage:
file /home/user1 conflicts between attempted installs of <recipe2> and <recipe1>
If I comment out the "chown" line from both recipes it seems to work but then I guess those directories will be owned by root during runtime, which will be a problem for user1.
Is there a proper way to do this?
Kind regards, Linus
[-- Attachment #2: Type: text/html, Size: 1436 bytes --]
next reply other threads:[~2024-04-11 7:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-11 7:52 linusnilsson [this message]
2024-04-11 8:02 ` [yocto] Correct way for multiple recipes to install files in the same directory Markus Volk
2024-04-11 8:45 ` Marko, Peter
2024-04-11 12:37 ` linusnilsson
2024-04-11 14:36 ` linusnilsson
2024-04-11 19:30 ` Marko, Peter
2024-04-12 6:07 ` linusnilsson
2024-04-12 16:14 ` Linus Nilsson
2024-04-12 22:48 ` Markus Volk
2024-04-13 10:16 ` Sv: " Linus Nilsson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZfwI.1712821969796887981.Ve9P@lists.yoctoproject.org \
--to=linusnilsson@hotmail.com \
--cc=yocto@lists.yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).