[yocto] Debugging opkg installs

Paul Barker paul at paulbarker.me.uk
Wed Dec 17 10:28:40 PST 2014


On Mon, Dec 08, 2014 at 10:17:37AM -0800, Matt Schuckmann wrote:
> I'm looking for some tips on debugging package install problems. 
> Recently I've had a problem where edits to a pkg_postinst function in one of my recipes was not getting run when rebuilding my image. The only way I could get the pkg_postinst() function to run was to wipe out my complete openembedded build/tmp directory and let it rebuild everything from scratch (and the sstate cache). I'd really like to understand what was going on here. My guess is there was some sort of flag somewhere that was telling the opkg to not run the postinst script for that package because it had already been done once. 
> 
> It would also be nice to know how to run opkg installs locally on my dev system to test out recipes but I haven't quite worked out the right tools in place on my dev system and or what the right commands are.

Hi Matt,

I'm currently the maintainer of opkg so I can probably answer your questions.
I'm pretty busy at the minute though so sorry for the late reply.

If you want to run opkg with more verbosity you can add the '-V4' argument to
the opkg invocation to run at the highest verbosity level. Within OpenEmbedded I
think you need to append this to self.opkg_args in OpkgPM::__init__ in
meta/lib/oe/package_manager.py to ensure the argument is passed when opkg is
invoked to install packages into the rootfs. There is an OPKG_ARGS variable
which can be set in local.conf and is referenced by the code which invokes opkg,
but arguments I've specified in OPKG_ARGS have not been correctly passed to opkg
when I've ran builds. I've not had chance to debug why that variable doesn't
work though.

To install packages on your dev system you should be able to use the opkg binary
created by the build of opkg-native. That should reside in
tmp-glibc/sysroots/x86_64-linux/usr/bin/ within your build directory, though the
exact path may change depending on the libc used and the host architecture. The
opkg binary may be called 'opkg-cl'. You'll need to setup an opkg configuration
file for use on the dev system and I'd suggest you do this by copying the
contents of /etc/opkg/*.conf from your target system into a single conf file on
your dev system. You can pass '-f <path to opkg.conf>' to opkg to instruct it to
read from this new configuration file.

That should get you started, any further questions just ask.

> 
> Thanks,
> Matt S. 
> 

Cheers,

-- 
Paul Barker

Email: paul at paulbarker.me.uk
http://www.paulbarker.me.uk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20141217/33325ee7/attachment.pgp>


More information about the yocto mailing list