[Openembedded-architecture] Changes that switching from smart to dnf will cause

Alexander Kanavin alexander.kanavin at linux.intel.com
Wed Feb 15 08:51:26 UTC 2017


On 02/15/2017 09:44 AM, Anders Darander wrote:
> Do you plan to convert the old pkg_postinst_${PN} to this one?

Only those that cannot run at cross-install time and defer themselves to 
first boot via 'exit 1' trick. The vast majority of pkg_postinst will 
stay as they are, and will run at cross-install time like now.

> How are they supposed to work on a read-only rootfs?

If you mean those that defer themselves to first boot, then same way as 
they do now: they don't work at all. If rootfs creation code detects 
that some package did the first boot deferral and the rootfs is read 
only, the build is halted with an error:

                 bb.fatal("The following packages could not be configured "
                          "offline and rootfs is read-only: %s" %
                          delayed_postinsts)

If you run into this situation, you have a choice to make: find a way to 
configure your software entirely at cross-install rootfs creation time, 
or find a way to not use the packages that require on target configuration.

> I'd say, ensure that the pkg_postinst_${PN} actually fails if something
> goes wrong, i.e. add `set -e`, and fix up everything that fails during
> rootfs...

The problem right now is that there is no way for postinst script to 
truly fail: if it fails, it's taken as a request to defer to first boot. 
Which may not be the intention at all. This is what I am aiming to fix 
with this change, it's not primarily about adding _ontarget, and I 
should've written the commit message and the email to this list differently.

> Ensure that they're run under `set -e`...

Not enough; see just above.

> In the worst case, there might be followup patches trying to convert
> pkg_postinst_ontarget_${PN} back to pkg_postinst_${PN}, for the
> ro-rootfs case.

Again, only those postinsts that do the 'exit 1' deferral trick (there's 
very few of them) need conversion. They are intended to run on target 
only, so nothing is changing for them, or for the rest of the postinsts 
that are not touched at all.

Hope this helps,
Alex




More information about the Openembedded-architecture mailing list