Re: [yocto] Correct way for multiple recipes to install files in the same directory

2024-04-13 Thread Linus Nilsson
As I have no prior experience with classes I'll have to read through the manual 
to learn and I'll have that in mind, cheers. 

Från: Markus Volk 
Skickat: den 13 april 2024 00:48
Till: yocto@lists.yoctoproject.org ; 
linusnils...@hotmail.com 
Ämne: Re: [yocto] Correct way for multiple recipes to install files in the same 
directory

On Fri, Apr 12 2024 at 09:14:45 AM -07:00:00, Linus Nilsson 
 wrote:
I haven't worked with the classes yet but I can see how they can be used to 
make things a lot easier in my case.

But don't use classen too invasively. They can be problematic, e.g. an :append 
may be ignored depending on the BBFILE_PRIORITY of a layer

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#62927): https://lists.yoctoproject.org/g/yocto/message/62927
Mute This Topic: https://lists.yoctoproject.org/mt/105458437/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [yocto] Correct way for multiple recipes to install files in the same directory

2024-04-12 Thread Linus Nilsson
I found a solution and I'll try to break it down. There was the original 
problem with the conflict between the recipes and then there were the problem 
with the recipe not being aware of the existence of the user polkitd.

The solution for the first problem was to make sure that the permissions and 
ownership set by my recipe 2 matches the one in recipe 1 exactly, hence:
> 
> 
> Changing in recipe 2 from
> chown -R user1:user1 ${D}/home/user1/.config/
> to
> chown -R user1:user1 ${D}/home/user1/
> actually seems to solve the problem with those particular recipes.

The solution to the second problem (disk-automount recipe bitbake error because 
user polkitd is invalid) was to copy the creation of the user polkitd from the 
original polkit recipe into my recipe:
inherit useradd
USERADD_PACKAGES = "${PN}"
USERADD_PARAM:${PN} = "--system --no-create-home --user-group --home-dir 
${sysconfdir}/${BPN}-1 --shell /bin/nologin polkitd"

and then make sure that my disk-automount recipe matches the permissions and 
ownerships set up by the polkit recipe as well:
do_install:append() {
#Fix up permissions on polkit rules.d to work with rpm4 constraints
chmod 700 ${D}/${datadir}/polkit-1/rules.d
chmod 700 ${D}/${sysconfdir}/polkit-1/rules.d
chown polkitd:root ${D}/${datadir}/polkit-1/rules.d
chown polkitd:root ${D}/${sysconfdir}/polkit-1/rules.d
}

This is working but I can see some issues with copying code from one recipe to 
another. If the original recipe changes, I will need to manually update every 
one of my own recipes with the corresponding changes, which doesn't scale very 
well. Having this in mind I think that Markus Volk's post might be a nicer way 
to do things so I think I will consider his way of doing it in the future. I 
haven't worked with the classes yet but I can see how they can be used to make 
things a lot easier in my case.

Big thanks and great appreciation to everyone who came up with suggestions, 
they eventually led me towards a solution! :)

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#62925): https://lists.yoctoproject.org/g/yocto/message/62925
Mute This Topic: https://lists.yoctoproject.org/mt/105458437/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-