Re: [poky] execute pkg_postinst_ontarget when read-only-rootfs-delayed-postinsts is set for a read only rootfs
Alexander Kanavin <[email protected]>
| Newsgroups | org.yoctoproject.lists.poky |
|---|---|
| Message-ID | <CANNYZj_7bwTBr_P-2TnYhtAEr4wRhb2XsLwJS_63HnKwJ5g=Xw@mail.gmail.com> |
I’m not exactly sure, but is one supposed to specify one or the other, but not both at the same time? Alex On Tue 25. Jun 2024 at 15.08, Gassner, Tobias.ext via lists.yoctoproject.org <[email protected]> wrote: > Hi, > > we specify read-only-rootfs and use an overlayFS to* "make the roofts > writable"*. We also want to execute a postinstall script for our package > on the target: > > pkg_postinst_ontarget:${PN}() { > > #some code... > } > > in order for bitbake to not complain that a read-only rootfs and > pkg_postinst_ontarget don't work together, we also specify > read-only-rootfs-delayed-postinsts > <https://docs.yoctoproject.org/dev/ref-manual/features.html> > > However, it seems that the run-postinsts package is removed by the _uninstall_unneeded > function (in file meta/lib/oe/rootfs.py), because the image_rorfs flag > only checks for read-only-rootfs and not for read-only-rootfs-delayed-postinsts > as well. Hence, the postinst code is not executed. > > When I use the fix at the end of this post, the behavior is as expected. > However, I am not an expert in this area of the project and want to collect > your feedback first, before proposing to merge. > > PS: a pointer to read-only-rootfs-delayed-postinsts in the docu > <https://docs.yoctoproject.org/dev/dev-manual/read-only-rootfs.html#post-installation-scripts-and-read-only-root-filesystem> would > be very helpful. > > > Best regards > -Tobias > > > > From 608050984c5be67f506a0877fadbbe0b61575e54 Mon Sep 17 00:00:00 2001 > From: "Gassner, Tobias.ext" <[email protected]> > Date: Tue, 25 Jun 2024 13:30:17 +0200 > Subject: [PATCH] keep delayed-postinsts when > read-only-rootfs-delayed-postinsts is set for a read only rootfs > > Signed-off-by: Gassner, Tobias.ext <[email protected]> > --- > meta/lib/oe/rootfs.py | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py > index 8cd48f9450..5abce4ad7d 100644 > --- a/meta/lib/oe/rootfs.py > +++ b/meta/lib/oe/rootfs.py > @@ -269,7 +269,11 @@ class Rootfs(object, metaclass=ABCMeta): > self.pm.remove(["run-postinsts"]) > > image_rorfs = bb.utils.contains("IMAGE_FEATURES", > "read-only-rootfs", > + True, False, self.d) and \ > + not bb.utils.contains("IMAGE_FEATURES", > + > "read-only-rootfs-delayed-postinsts", > True, False, self.d) > + > image_rorfs_force = self.d.getVar('FORCE_RO_REMOVE') > > if image_rorfs or image_rorfs_force == "1": > > > -- > 2.45.2 > > -=-=-=-=-=-=-=-=-=-=-=- > Links: You receive all messages sent to this group. > View/Reply Online (#13391): > https://lists.yoctoproject.org/g/poky/message/13391 > Mute This Topic: https://lists.yoctoproject.org/mt/106869018/1686489 > Group Owner: [email protected] > Unsubscribe: https://lists.yoctoproject.org/g/poky/unsub [ > [email protected]] > -=-=-=-=-=-=-=-=-=-=-=- > >