Bug 1507

Summary: [deb][arm] core-image-sato-sdk do_rootfs failed: task-base-extended: Depends: task-base but it is not going to be installed
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Dexuan Cui <dexuan.cui>
Component: coreAssignee: Dexuan Cui <dexuan.cui>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: High CC: dexuan.cui, lianhao.lu, meta.mr.watcher, meta.watcher, richard.purdie, sgw
Version: unspecified   
Target Milestone: 1.1 M4   
Hardware: x86   
OS: arm   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Dexuan Cui 2011-09-21 22:53:53 UTC
After Bug 1070  and Bug 1086 were fixed, on qemuarm, we actually still have an issue:

| + for i in '${package_to_install}'
| + apt-get install task-base-extended --force-yes --allow-unauthenticated
| Reading package lists...
| Building dependency tree...
| Reading state information...
| Some packages could not be installed. This may mean that you have
| requested an impossible situation or if you are using the unstable
| distribution that some required packages have not yet been created
| or been moved out of Incoming.
|
| Since you only requested a single operation it is extremely likely that
| the package is simply not installable and a bug report against
| that package should be filed.
| The following information may help to resolve the situation:
|
| The following packages have unmet dependencies:
|   task-base-extended: Depends: task-base but it is not going to be installed
| E: Broken packages
| + '[' 100 -ne 0 ']'
| + exit 1
NOTE: package core-image-sato-sdk-1.0-r0: task do_rootfs: Failed

This bug only happens on qemuarm  if we use deb packaging.
Comment 1 Dexuan Cui 2011-09-21 23:05:12 UTC
(In reply to comment #0)
> After Bug 1070  and Bug 1086 were fixed, on qemuarm, we actually still have an
> issue:
> 
> | + for i in '${package_to_install}'
> | + apt-get install task-base-extended --force-yes --allow-unauthenticated
> | Reading package lists...
> | Building dependency tree...
> | Reading state information...
> | Some packages could not be installed. This may mean that you have
> | requested an impossible situation or if you are using the unstable
> | distribution that some required packages have not yet been created
> | or been moved out of Incoming.
> |
> | Since you only requested a single operation it is extremely likely that
> | the package is simply not installable and a bug report against
> | that package should be filed.
> | The following information may help to resolve the situation:
> |
> | The following packages have unmet dependencies:
> |   task-base-extended: Depends: task-base but it is not going to be installed
> | E: Broken packages
> | + '[' 100 -ne 0 ']'
> | + exit 1
> NOTE: package core-image-sato-sdk-1.0-r0: task do_rootfs: Failed
> 
> This bug only happens on qemuarm  if we use deb packaging.

I finally got the root cause:
It's related to qemu-config.bb that uses a file
meta/recipes-bsp/qemu-config/qemu-config/qemuarm/shutdown.desktop, so in base.class:

override = bb.data.getVar('SRC_URI_OVERRIDES_PACKAGE_ARCH', d, 1)
    if override != '0':
        paths = []
        for p in [ "${PF}", "${P}", "${PN}", "files", "" ]:
            path = bb.data.expand(os.path.join("${FILE_DIRNAME}", p, "${MACHINE}"), d)
            if os.path.isdir(path):
                paths.append(path)
        if len(paths) != 0:
            for s in srcuri.split():
                if not s.startswith("file://"):
                    continue
                fetcher = bb.fetch2.Fetch([s], d)
                local = fetcher.localpath(s)
                for mp in paths:
                    if local.startswith(mp):
                        #bb.note("overriding PACKAGE_ARCH from %s to %s" % (pkg_arch, mach_arch))
                        bb.data.setVar('PACKAGE_ARCH', "${MACHINE_ARCH}", d)
                        return

After PACKAGE_ARCH is overridden from all to qemuarm, the generated deb file is stored at tmp/deploy/deb/qemuarm/qemu-config_1.0-r21_allarch.deb rather than  tmp/deploy/deb/all/qemu-config_1.0-r21_all.deb, hence the package qemu-config is  not installable -- task-base finally rdepends on qemu-config, so we get the do_rootfs failure.

I think the below patch can fix the bug:

--- a/meta/recipes-bsp/qemu-config/qemu-config.bb
+++ b/meta/recipes-bsp/qemu-config/qemu-config.bb
@@ -5,7 +5,9 @@ LIC_FILES_CHKSUM = -PR = "r21"
+PR = "r22"
+
+SRC_URI_OVERRIDES_PACKAGE_ARCH = "0"
Comment 2 Dexuan Cui 2011-09-21 23:09:53 UTC
(In reply to comment #1)
> (In reply to comment #0)
> > After Bug 1070  and Bug 1086 were fixed, on qemuarm, we actually still have an
> > issue:
> > This bug only happens on qemuarm  if we use deb packaging.
> 
> I finally got the root cause:
> It's related to qemu-config.bb that uses a file
> meta/recipes-bsp/qemu-config/qemu-config/qemuarm/shutdown.desktop, so in
> base.class:
> 
> After PACKAGE_ARCH is overridden from all to qemuarm, the generated deb file is
> stored at tmp/deploy/deb/qemuarm/qemu-config_1.0-r21_allarch.deb rather than 
> tmp/deploy/deb/all/qemu-config_1.0-r21_all.deb, hence the package qemu-config
> is  not installable -- task-base finally rdepends on qemu-config, so we get the
> do_rootfs failure.
> 
> I think the below patch can fix the bug:
> 
> --- a/meta/recipes-bsp/qemu-config/qemu-config.bb
> +++ b/meta/recipes-bsp/qemu-config/qemu-config.bb
> @@ -5,7 +5,9 @@ LIC_FILES_CHKSUM = -PR = "r21"
> +PR = "r22"
> +
> +SRC_URI_OVERRIDES_PACKAGE_ARCH = "0"

Previously I didn't always reproduce the bug because I didn't realized, to reproduce the bug, I need a clean build for qemuarm deb from scratch -- previously I usually built qemux86 deb first, and tmp/deploy/deb/all/qemu-config_1.0-r21_all.deb was there, so later building qemuarm deb could succeed.
Comment 3 Dexuan Cui 2011-09-22 01:42:21 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > (In reply to comment #0)
> > > After Bug 1070  and Bug 1086 were fixed, on qemuarm, we actually still have an
> > > issue:
> > > This bug only happens on qemuarm  if we use deb packaging.
> > 
> > I finally got the root cause:
> > It's related to qemu-config.bb that uses a file
> > meta/recipes-bsp/qemu-config/qemu-config/qemuarm/shutdown.desktop, so in
> > base.class:
> > 
> > After PACKAGE_ARCH is overridden from all to qemuarm, the generated deb file is
> > stored at tmp/deploy/deb/qemuarm/qemu-config_1.0-r21_allarch.deb rather than 
> > tmp/deploy/deb/all/qemu-config_1.0-r21_all.deb, hence the package qemu-config
> > is  not installable -- task-base finally rdepends on qemu-config, so we get the
> > do_rootfs failure.
> > 
> > I think the below patch can fix the bug:
> > 
> > --- a/meta/recipes-bsp/qemu-config/qemu-config.bb
> > +++ b/meta/recipes-bsp/qemu-config/qemu-config.bb
> > @@ -5,7 +5,9 @@ LIC_FILES_CHKSUM = -PR = "r21"
> > +PR = "r22"
> > +
> > +SRC_URI_OVERRIDES_PACKAGE_ARCH = "0"
> 
> Previously I didn't always reproduce the bug because I didn't realized, to
> reproduce the bug, I need a clean build for qemuarm deb from scratch --
> previously I usually built qemux86 deb first, and
> tmp/deploy/deb/all/qemu-config_1.0-r21_all.deb was there, so later building
> qemuarm deb could succeed.

Thanks RP a lot for the suggestions how to make the patch, I sent out the fix to oe-core mailing list:
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=dcui/bug-1507&id=8ff7be8d70f27701840026ed3ba2431341b6508a
Comment 4 Dexuan Cui 2011-09-22 16:05:01 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > (In reply to comment #1)
> > > (In reply to comment #0)
> > > > After Bug 1070  and Bug 1086 were fixed, on qemuarm, we actually still have an
> > > > issue:
> > > > This bug only happens on qemuarm  if we use deb packaging.
> > > 
> > > I finally got the root cause:
> > > It's related to qemu-config.bb that uses a file
> > > meta/recipes-bsp/qemu-config/qemu-config/qemuarm/shutdown.desktop, so in
> > > base.class:
> > > 
> > > After PACKAGE_ARCH is overridden from all to qemuarm, the generated deb file is
> > > stored at tmp/deploy/deb/qemuarm/qemu-config_1.0-r21_allarch.deb rather than 
> > > tmp/deploy/deb/all/qemu-config_1.0-r21_all.deb, hence the package qemu-config
> > > is  not installable -- task-base finally rdepends on qemu-config, so we get the
> > > do_rootfs failure.
> > > 
> > > I think the below patch can fix the bug:
> > > 
> > > --- a/meta/recipes-bsp/qemu-config/qemu-config.bb
> > > +++ b/meta/recipes-bsp/qemu-config/qemu-config.bb
> > > @@ -5,7 +5,9 @@ LIC_FILES_CHKSUM = -PR = "r21"
> > > +PR = "r22"
> > > +
> > > +SRC_URI_OVERRIDES_PACKAGE_ARCH = "0"
> > 
> > Previously I didn't always reproduce the bug because I didn't realized, to
> > reproduce the bug, I need a clean build for qemuarm deb from scratch --
> > previously I usually built qemux86 deb first, and
> > tmp/deploy/deb/all/qemu-config_1.0-r21_all.deb was there, so later building
> > qemuarm deb could succeed.
> 
> Thanks RP a lot for the suggestions how to make the patch, I sent out the fix
> to oe-core mailing list:
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=dcui/bug-1507&id=8ff7be8d70f27701840026ed3ba2431341b6508a

Fixed by http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=ca64b2eb1f1fd3b298e9384752b2fd806f7e4a12