Bug 1755

Summary: preinst not run at rootfs time with rpm images
Product: [Build System, Metadata & Runtime] Meta-yocto Reporter: Richard Purdie <richard.purdie>
Component: meta-yoctoAssignee: Mark Hatle <mark.hatle>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: High CC: poky.bs.watcher, poky.watcher, sgw, yi.zhao
Version: unspecified   
Target Milestone: ---   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Richard Purdie 2011-11-07 05:23:20 UTC
At rootfs generation time the preinst (%pre) functions aren't being run with the rpm backand. An example is the dbus package which results in no messagebus user and problems with the image at runtime.

I did try adding "--pre" to the final rootfs rpm call at rootfs creation time but this attempts to run the script within a chroot using target rootfs binaries which isn't cross safe.
Comment 1 Richard Purdie 2011-11-07 05:24:32 UTC
For reference this looks like the reason the connman sanity tests are failing on the autobuilder as dbus isn't running in the images.
Comment 2 Richard Purdie 2011-11-07 17:07:33 UTC
I've put a hacktastic demo of a fix at http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/useradd&id=5f190959cb38f92f575d6f861f1f447ba9f4b8e8

I'm not suggesting we integrate that but it gives an idea of what the problems are:

a) base-passwd's preinst is fundamentally flawed as the files are unavailable
b) rpm needs to not run scripts under the chroot
c) We need $D in the environment
d) We need to tell rpm to run %pre
e) We need the native PATH in $PATH in the script so it finds the right tools

It also proves that if we fix those problems, connman/dbus start working properly in rpm images.
Comment 3 Saul Wold 2011-11-08 08:42:07 UTC
*** Bug 1699 has been marked as a duplicate of this bug. ***
Comment 5 Yi Zhao 2011-11-21 18:39:01 UTC
Verified with 20111117 build.

Tree/Branch: Poky/master
Poky Commit:f2d077255d9ddf9b87e9a781b989bcce69047cf5