opkg intercept for ldconfig on oe-core
Hi all,
I was looking at the opkg intercept functionality, and if I'm understanding this properly, it looks like it changes the PATH so that e.g. ldconfig is redirected to the script under /usr/share/opkg/intercept/ldconfig when running postinst scripts. That way, when installing a bunch of libraries, ldconfig can be run once at the end rather than once for every package.
However, the postinst scripts for libraries are generated with ldconfig_postinst_fragment() in meta/classes/package.bbclass, which looks like this:
ldconfig_postinst_fragment() {
if [ x"$D" = "x" ]; then
if [ -x /sbin/ldconfig ]; then /sbin/ldconfig ; fi
fi
}
Because this script uses the full absolute path to ldconfig, the opkg intercept ldconfig script isn't being invoked. I verified this by putting an echo in /usr/share/opkg/intercept/ldconfig, which I saw only when I changed my package's postinst script to
ldconfig_postinst_fragment() {
if [ x"$D" = "x" ]; then
ldconfig
fi
}
In the history of package.bbclass, it originally used to look like this, but was changed in 2008 in a sync from OE.dev.
Is this expected behavior? Is opkg intercept still supported? Should we fix this, and if so, what would be a safe way to do it?
Thanks,
Ben
On Fri, Jan 30, 2015 at 9:06 PM, Ben Shelton <[email protected]> wrote:
...
Quoted 2 lines
Is this expected behavior? Is opkg intercept still supported? Should we fix this, and if so, what would be a safe way to do it?
I don't know if this is the expected behavior for now but the intercept does make sound like a very good mechanism for the embedded. It should reduces the time spent in an upgrade and also reduce the writing in the storage. Both very good consequences of adopting it.
However I am not sure how much work would be need to revert this change and confirm it does not regret somehow. Did you test changing the postinst fragment?
Signature · 3 lines
Otavio Salvador O.S. Systems http://www.ossystems.com.br http://code.ossystems.com.br Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750