[oe] [oe-commits] Koen Kooi : initscripts: only run ldconfig on boot when ld.so. conf is present

Phil Blundell pb at reciva.com
Sat Nov 1 19:20:42 UTC 2008


On Sat, 2008-11-01 at 12:38 +0100, Stanislav Brabec wrote:
> And what about something like:
> if ..../ld.so.cache -ot /usr/lib -o /etc/ld.so.cache -ot /lib ; then
>     /sbin/ldconfig
> fi

That would work fine for DISTROs which only put libraries in those two
directories.  But, frankly, if you only have those two library paths you
are probably better off not using ldconfig and ld.so.conf at all.

Even in the simple case I think a better solution would probably be to
teach ldconfig to do this checking of mtimes, rather than having to wrap
every call to it in a shell conditional.

> Call ldconfig only if ld.so cache is outdated. Fast for users of package
> managers, working for others, fast in subsequent reboots.

Just as an aside, there isn't really any need to have complicated
runtime logic to handle all possible combinations of DISTRO policy.  Any
single DISTRO would clearly have only one policy (for example, either it
uses a package manager or it doesn't) and hence it can make these
determinations at build time.  As an example of that, DISTROs which use
package management but don't require ldconfig can just set
USE_LDCONFIG=0 and suppress all those postinsts altogether, rather than
emitting a postinst with convoluted tests for file existence that ends
up doing nothing.

p.






More information about the Openembedded-devel mailing list