Bug 6072

Summary: Can't install dbus-1-1.6.18-r0@i586: no package provides initscripts-functions
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Jonathan Liu <net147>
Component: deploymentAssignee: Saul Wold <sgw>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: Medium CC: bluelightning, Qi.Chen, rcalhoun-bugzilla, richard.purdie, sgw
Version: 1.6   
Target Milestone: 1.6.1   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
Patch none

Description Jonathan Liu 2014-03-31 03:49:15 UTC
Build Configuration:
BB_VERSION        = "1.21.1"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Arch-rolling"
TARGET_SYS        = "i586-poky-linux"
MACHINE           = "qemux86"
DISTRO            = "poky"
DISTRO_VERSION    = "1.5+snapshot-20140331"
TUNE_FEATURES     = "m32 i586"
TARGET_FPU        = ""
meta              
meta-yocto        
meta-yocto-bsp    = "master:8210928e847fda7dbc145a94372b0beaf653a4f9"
meta-qt5          = "master:1fa7f364f682e5cfaa9d6e565b7ae6b8ec2a90ff"

1. git clone git://git.yoctoproject.org/poky
2. cd poky
3. git clone https://github.com/meta-qt5/meta-qt5.git
4. . oe-init-build-env
5. sed -i '12i\  ${TOPDIR}/../meta-qt5 \' conf/bblayers.conf
6. bitbake meta-toolchain-qt5


Results in the following errors in log.do_populate_sdk:
DEBUG: Executing python function do_populate_sdk
NOTE: Installing TARGET packages
NOTE: configuring RPM platform settings
NOTE: configuring RPM system provides
NOTE: configuring RPM DB settings
NOTE: configuring Smart settings
NOTE: Note: adding Smart channel qemux86 (35)
NOTE: Note: adding Smart channel i586 (30)
NOTE: Note: adding Smart channel all (25)
NOTE: adding Smart RPM DB channel
NOTE: Note: configuring RPM cross-install scriptlet_wrapper
NOTE: Executing '/home/net147/git/poky/build/tmp/sysroots/x86_64-linux/usr/bin/createrepo --update -q /home/net147/git/poky/build/tmp/deploy/rpm/all' ...
NOTE: Executing '/home/net147/git/poky/build/tmp/sysroots/x86_64-linux/usr/bin/createrepo --update -q /home/net147/git/poky/build/tmp/deploy/rpm/i586' ...
NOTE: Executing '/home/net147/git/poky/build/tmp/sysroots/x86_64-linux/usr/bin/createrepo --update -q /home/net147/git/poky/build/tmp/deploy/rpm/qemux86' ...
NOTE: Installing the following packages: packagegroup-core-standalone-sdk-target-dbg packagegroup-core-standalone-sdk-target packagegroup-qt5-toolchain-target
NOTE: to be installed: packagegroup-core-standalone-sdk-target-dbg@all packagegroup-core-standalone-sdk-target@all packagegroup-qt5-toolchain-target@all
NOTE: /home/net147/git/poky/build/tmp/sysroots/x86_64-linux/usr/bin/smart --data-dir=/home/net147/git/poky/build/tmp/work/i586-poky-linux/meta-toolchain-qt5/1.0-r0/sdk/image/opt/poky/1.5+snapshot/sysroots/i586-poky-linux/var/lib/smart install -y packagegroup-core-standalone-sdk-target-dbg@all packagegroup-core-standalone-sdk-target@all packagegroup-qt5-toolchain-target@all
ERROR: Unable to install packages. Command '/home/net147/git/poky/build/tmp/sysroots/x86_64-linux/usr/bin/smart --data-dir=/home/net147/git/poky/build/tmp/work/i586-poky-linux/meta-toolchain-qt5/1.0-r0/sdk/image/opt/poky/1.5+snapshot/sysroots/i586-poky-linux/var/lib/smart install -y packagegroup-core-standalone-sdk-target-dbg@all packagegroup-core-standalone-sdk-target@all packagegroup-qt5-toolchain-target@all' returned 1:
Loading cache...
Updating cache...               ######################################## [100%]

Computing transaction...error: Can't install dbus-1-1.6.18-r0@i586: no package provides initscripts-functions


DEBUG: Python function do_populate_sdk finished
ERROR: Function failed: do_populate_sdk



It seems the initscripts recipe isn't built so it can't find the initscripts-functions package.
Comment 1 Jonathan Liu 2014-03-31 04:04:39 UTC
There is an error in step 5, it should be:
sed -i '12i\  ${TOPDIR}/../meta-qt5 \\' conf/bblayers.conf
Comment 2 Saul Wold 2014-04-01 19:25:42 UTC
Can you reproduce this without the meta-qt5?  Dbus appears to use the update-rc.d bbclass which pulls in the initscript-functions conditionally on the usage of /etc/init.d/fucnction, I tried to install dbus with a core-image-minimal and it correctly installed initscripts-functions
Comment 3 Jonathan Liu 2014-04-02 04:16:17 UTC
It is reproducible without meta-qt5.

Instructions using new clone of poky:
1. git clone git://git.yoctoproject.org/poky
2. cd poky
3. . oe-init-build-env
4. echo 'TOOLCHAIN_TARGET_TASK_append_pn-meta-toolchain = " dbus-wait"' >> conf/local.conf
5. bitbake meta-toolchain

Instructions using existing clone of poky:
1. echo 'TOOLCHAIN_TARGET_TASK_append_pn-meta-toolchain = " dbus-wait"' >> conf/local.conf
2. bitbake -c cleansstate initscripts meta-toolchain
3. bitbake meta-toolchain
Comment 4 Paul Eggleton 2014-04-02 09:49:00 UTC
What's going on here is the usual for this type of error - there's no DEPENDS anywhere to force the initscripts recipe to be built and the RDEPENDS on initscrips-functions is added dynamically during packaging, which means nothing guarantees that the initscripts-functions package will be available.

We'll have to add an explicit RDEPENDS on initscripts-functions in at least one common place to get around this.
Comment 5 Saul Wold 2014-04-02 21:38:25 UTC
There are 2 possibly places to do this: sysvinit and systemd recipes since both 
of them actually rely on the init.d/function file, they are also common places 
for each of the 2 init systems that need those files.

Thoughts?
Comment 6 Paul Eggleton 2014-04-22 17:52:52 UTC
I suspect we'll need to have it in both places, since you can have either one enabled and not the other. It seems to me though that the point of splitting this was to try to allow systemd-based configurations where you don't need to have initscripts installed, and presumably even not have initscripts-functions installed unless its needed. So whatever solution we come up with will have to take that into account.
Comment 7 Rob Calhoun 2014-04-23 15:36:13 UTC
I got the same error yesterday ("Computing transaction...error: Can't install dbus-1-1.6.18-r0@armv7a_vfp_neon: no package provides initscripts-function
s") when doing a clean build under daisy, DISTRO = "poky". The clean operation was a scorched-earth one, trashing the sstate-cache and tmp directories in order to resolve some complaints about incompatible native tool versions.

Per this ticket the workaround was to do an independent "bitbake initscripts" then  bake the image.


Repro:

bitbake -c cleanall on {sysvinit, dbus, initscripts} then baking the image works.

bitbake -c cleanall on {sysvinit, dbus, initscripts,image recipe} then baking the image fails with initscripts dependency.

There is an explicit RDEPENDS on initscripts-functions in poky/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb  so anything that builds sysvinit should automatically build initscripts-functions.

Baking sysvinit after cleanall rebuilds initscripts as expected; image can then be baked successfully. Perhaps the issue not with initscripts directly but rather how the sysvinit package is tracked as a dependency.
Comment 8 Saul Wold 2014-05-16 21:48:19 UTC
Rob, which image where you working with and were you using systemd?  I think I 
need a little more information on your failure.  I have been working with this 
issue and looking at a patch adding initscripts as a DEPENDS in 
update-rc.d.bbclass, but that seems to have cause a different failure when 
buiding meta-toolchain, but not when building an actual image
Comment 9 Rob Calhoun 2014-05-21 20:07:46 UTC
Finally got around to trying to track this down. For the record I am working with daisy branch as of 98ad3cb2c0f5975a0df4cebc06775aaae657700d (1.6.1).

The "no package provides initscript-functions" doesn't occur when building core-image-minimal. The difference between that image and my own is that I don't include packagegroup-core-boot in IMAGE_INSTALL, and packagegroup-core-boot adds initscripts as an RDEPENDS.

The sysvinit recipe, meanwhile, has a RDEPENDS dependency on initscripts-functions, but perhaps since this is failing at image creation time, perhaps it should really be a DEPENDS instead (or in addition?)

Probably this is not worth fixing. I am running into this because of my aversion to using sysvinit (vs busybox init), and busybox init is not really supported by yocto.
Comment 10 Paul Eggleton 2014-05-22 07:47:08 UTC
I honestly do think this needs to be fixed. We introduced this initscripts-functions package, we should take measures to ensure it gets built so that this error doesn't occur.
Comment 11 Paul Eggleton 2014-05-22 16:55:55 UTC
FYI, It's not necessarily intuitive and I had to test it because I wasn't sure, but thanks to recrdeptasks, just adding a DEPENDS on initscripts will cause initscripts-functions to be packaged. Thus, we should be able to add a DEPENDS on initscripts to both systemd and sysvinit and that will cause an initscripts-functions package to be built, but not force it to be installed unless a particular package requires it.
Comment 12 Saul Wold 2014-05-27 19:03:32 UTC
I attached a patch that I am working with to address this issue, can you please 
try it in your environment.  One important thing to confirm is that it does not 
bring in additional items that you do not want installed.
Comment 13 Saul Wold 2014-05-27 19:03:34 UTC
Created attachment 1980 [details]
Patch