[OE-core] [oe-core] How to query installed rpm packages

Paul Eggleton paul.eggleton at linux.intel.com
Tue May 29 13:32:58 UTC 2012


On Tuesday 29 May 2012 15:20:14 Giuseppe Condorelli wrote:
> What I'm not understanding is how I can invoke my shell function. Do you
> mean I have to invoke it as append function of populate_rootfs one? 

If you aren't including packaging data in the resulting image (i.e. 
IMAGE_FEATURES does not contain "package-management"), you need to do your rpm 
calls from a function called via ROOTFS_POSTPROCESS_COMMAND because afterwards 
the data will be removed and rpm will not be usable.

> What I really need is a way to query the rpm database
> out from the build system, as we normally do with host packages.
> I tried to have a standalone run of  the rpm command the
> list_installed_packages invokes but (obviously) I got a long series of
> errors.

Below is what I meant - you could put this into some bbclass that you could 
add using INHERIT += "someclass.bbclass" in local.conf:

------------- snip --------------
ROOTFS_POSTPROCESS_COMMAND += "do_some_packaging_stuff ; "

do_some_packaging_stuff() {
	list_installed_packages > /path/to/output/file
}
------------- snip --------------

Substitute list_installed_packages for a similar rpm query command to the one 
list_installed_packages uses.

Out of interest, what information are you querying from the packaging system?

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre




More information about the Openembedded-core mailing list