Bug 3482

Summary: A lot of -dbg packages don't get installed on beagleboard platform
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Ming Liu <ming.liu>
Component: coreAssignee: Ming Liu <ming.liu>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: meta.mr.watcher, meta.watcher, sgw, song.liu, zhenfeng.zhao
Version: unspecified   
Target Milestone: 1.4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---
Attachments:
Description Flags
0001-rootfs_rpm.bbclass-normalize-arch-output-of-list_ins.patch none

Description Ming Liu 2012-11-23 09:40:29 UTC
Created attachment 948 [details]
0001-rootfs_rpm.bbclass-normalize-arch-output-of-list_ins.patch

Add the following to the local.conf:
    MACHINE ?= "beagleboard"

    EXTRA_IMAGE_FEATURES += "dbg-pkgs"

    IMAGE_INSTALL_append += "which"
    IMAGE_INSTALL_append += "grep"
    IMAGE_INSTALL_append += "sed"
    IMAGE_INSTALL_append += "gawk"

After compiling, noticed that all -dbg packages of above appended not got installed into the filesystem. (e.g. which.which is supposed to be in /usr/bin/.debug but not).

This is caused by function list_installed_packages defined in rootfs_rpm.bbclass is outputting wrong arch values("-" replaced by "_"), which then results in oe-pkgdata-util script missed processing some complementary packages with these wrong archs.  

And as observed, this also causes license information missing of specific packages.

This defect is introduced by: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=4a015e57ccee4fec8ab1da6717f4e2d5c4bb9ff5

Attached patch fixes it upon my test.
Comment 1 Ming Liu 2012-11-30 01:00:05 UTC
Comment on attachment 948 [details]
0001-rootfs_rpm.bbclass-normalize-arch-output-of-list_ins.patch

>From 59b5bbf7aae994e42bf82a3629a7536429dc0226 Mon Sep 17 00:00:00 2001
>From: Ming Liu <ming.liu@windriver.com>
>Date: Fri, 23 Nov 2012 16:32:23 +0800
>Subject: [PATCH] rootfs_rpm.bbclass: normalize arch output of
> list_installed_packages
>
>list_installed_packages should output uniform formatted archs for all
>packaging system(deb, rpm and ipk), for they are used by common code to
>grab the package infos. Otherwise, it will lead some -dbg packages to be
>missed processing in come cases.
>
>It's introduced by commit: fc985f51, package_rpm.bbclass: fix the arch
>(replace "-" with "_").
>
>Fixed by replacing "_" back to "-" in list_installed_packages, make it
>output real arch values which can be safely used.
>
>Signed-off-by: Ming Liu <ming.liu@windriver.com>
>---
> meta/classes/rootfs_rpm.bbclass |    2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass
>index c86cd09..300dd5f 100644
>--- a/meta/classes/rootfs_rpm.bbclass
>+++ b/meta/classes/rootfs_rpm.bbclass
>@@ -153,7 +153,7 @@ list_installed_packages() {
> 
> 	# print the info, need to different return counts
> 	if [ "$1" = "arch" ] ; then
>-		echo "$GET_LIST" | awk '{print $1, $2}'
>+		echo "$GET_LIST" | awk -v archs="${PACKAGE_ARCHS}" '{if(!index(archs, $2)) {gsub("_", "-", $2)} print $1, $2}'
>         elif [ "$1" = "file" ] ; then
> 		echo "$GET_LIST" | awk '{print $1, $3}'
>         else
>-- 
>1.7.10.1
>
Comment 2 Ming Liu 2012-11-30 01:14:29 UTC
The attached patch will introduce another issue when dealing with qemux86_64 or x86_64 platforms, which the regression fix provided in Comment 1, so pls reference it as the fix.