Bug 3633 - Incremental RPM generation fails when removing features from core-image-sato.bb
Summary: Incremental RPM generation fails when removing features from core-image-sato.bb
Status: VERIFIED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 1.4
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.4
Assignee: Hongxu Jia
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2012-12-21 13:26 UTC by Stoicescu Cornel
Modified: 2013-02-06 08:15 UTC (History)
9 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments
log.do_rootfs (98.10 KB, application/octet-stream)
2012-12-21 13:26 UTC, Stoicescu Cornel
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stoicescu Cornel 2012-12-21 13:26:23 UTC
Created attachment 990 [details]
log.do_rootfs

Build Configuration:
BB_VERSION        = "1.17.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Ubuntu-12.04"
TARGET_SYS        = "x86_64-poky-linux"
MACHINE           = "qemux86-64"
DISTRO            = "poky"
DISTRO_VERSION    = "1.3+snapshot-20121221"
TUNE_FEATURES     = "m64"
TARGET_FPU        = ""
meta
meta-yocto
meta-yocto-bsp    = "(nobranch):90c0eb29f0b41e4ac2d3d17ebad7295c2ebdc02a"


1. Download poky source and prepare the build environment
2. Add the following line to conf/local.conf:
INC_RPM_IMAGE_GEN = "1"
3. Run "bitbake core-image-sato" to build an image
4. Comment out IMAGE_FEATURES in /meta/recipes-sato/images/core-image-sato.bb
5. Run "bitbake core-image-sato" to build an image

Notice do_rootfs fails:

"
log_check: There were error messages in the logfile
log_check: Matched keyword: [Fail]

  libpcre1                               xkbcomp                                                                                                ^MCommitting transaction...
Preparing...                    ######################################## [  0%]
   1:Removing gst-plugins-goo.. ######################################## [  0%]
   2:Removing python-xml        ######################################## [  0%]
   3:Removing hicolor-icon-th.. ######################################## [  1%]
gtk-update-icon-cache.real: Failed to open file /usr/share/icons/DMZ-Black/.icon-theme.cache : Permission denied
gtk-update-icon-cache.real: Failed to open file /usr/share/icons/DMZ-White/.icon-theme.cache : Permission denied
gtk-update-icon-cache.real: Failed to open file /usr/share/icons/default/.icon-theme.cache : Permission denied
gtk-update-icon-cache.real: Failed to open file /usr/share/icons/handhelds/.icon-theme.cache : Permission denied
gtk-update-icon-cache.real: Failed to open file /usr/share/icons/locolor/.icon-theme.cache : Permission denied
gtk-update-icon-cache.real: Failed to open file /usr/share/icons/redglass/.icon-theme.cache : Permission denied
gtk-update-icon-cache.real: Failed to open file /usr/share/icons/whiteglass/.icon-theme.cache : Permission denied
   4:Removing gst-plugins-goo.. ######################################## [  1%]
   5:Removing gst-plugins-bas.. ######################################## [  2%]
   6:Removing xserver-nodm-init ######################################## [  2%]
update-rc.d: /etc/init.d//home/cornel/SDD/Yocto/3poky/build/tmp/work/qemux86_64-poky-linux/core-image-sato/1.0-r0/rootfs: file does not exist
   7:Removing xhost             ######################################## [  3%]
--
 139:Removing libfm-locale-en.. ######################################## [ 63%]
 140:Removing settings-daemon   ######################################## [ 63%]
 141:Removing libicui18n50      ######################################## [ 64%]
 142:Removing libbz2-0          ######################################## [ 64%]
 143:Removing sato-icon-theme   ######################################## [ 65%]
gtk-update-icon-cache.real: Failed to open file /usr/share/icons/DMZ-Black/.icon-theme.cache : Permission denied
gtk-update-icon-cache.real: Failed to open file /usr/share/icons/DMZ-White/.icon-theme.cache : Permission denied
gtk-update-icon-cache.real: Failed to open file /usr/share/icons/default/.icon-theme.cache : Permission denied
gtk-update-icon-cache.real: Failed to open file /usr/share/icons/handhelds/.icon-theme.cache : Permission denied
gtk-update-icon-cache.real: Failed to open file /usr/share/icons/locolor/.icon-theme.cache : Permission denied
gtk-update-icon-cache.real: Failed to open file /usr/share/icons/redglass/.icon-theme.cache : Permission denied
gtk-update-icon-cache.real: Failed to open file /usr/share/icons/whiteglass/.icon-theme.cache : Permission denied
 144:Removing gst-plugins-bas.. ######################################## [ 65%]
 145:Removing python-netclient  ######################################## [ 65%]
 146:Removing gst-plugins-bas.. ######################################## [ 66%]
 147:Removing python-zlib       ######################################## [ 66%]
 148:Removing mesa-dri-driver.. ######################################## [ 67%]
--
 153:Removing dbus-wait         ######################################## [ 69%]
 154:Removing python-resource   ######################################## [ 70%]
 155:Removing libmb1            ######################################## [ 70%]
 156:Removing matchbox-wm       ######################################## [ 70%]
 157:Removing connman-gnome     ######################################## [ 71%]
gtk-update-icon-cache.real: Failed to open file /usr/share/icons/DMZ-Black/.icon-theme.cache : Permission denied
gtk-update-icon-cache.real: Failed to open file /usr/share/icons/DMZ-White/.icon-theme.cache : Permission denied
gtk-update-icon-cache.real: Failed to open file /usr/share/icons/default/.icon-theme.cache : Permission denied
gtk-update-icon-cache.real: Failed to open file /usr/share/icons/handhelds/.icon-theme.cache : Permission denied
gtk-update-icon-cache.real: Failed to open file /usr/share/icons/locolor/.icon-theme.cache : Permission denied
gtk-update-icon-cache.real: Failed to open file /usr/share/icons/redglass/.icon-theme.cache : Permission denied
gtk-update-icon-cache.real: Failed to open file /usr/share/icons/whiteglass/.icon-theme.cache : Permission denied
 158:Removing python-core       ######################################## [ 71%]
 159:Removing file              ######################################## [ 72%]
 160:Removing python-crypt      ######################################## [ 72%]
 161:Removing xdpyinfo          ######################################## [ 73%]
 162:Removing libice6           ######################################## [ 73%]
--
 168:Removing python-codecs     ######################################## [ 76%]
 169:Removing libxcalibrate0    ######################################## [ 76%]
 170:Removing kernel-module-n.. ######################################## [ 77%]
/home/cornel/SDD/Yocto/3poky/build/tmp/work/qemux86_64-poky-linux/core-image-sato/1.0-r0/rootfs///install/tmp/rpm-tmp.63125: line 3: update-modules: command not found
 171:Removing gthumb            ######################################## [ 77%]
gtk-update-icon-cache.real: Failed to open file /usr/share/icons/DMZ-Black/.icon-theme.cache : Permission denied
gtk-update-icon-cache.real: Failed to open file /usr/share/icons/DMZ-White/.icon-theme.cache : Permission denied
gtk-update-icon-cache.real: Failed to open file /usr/share/icons/default/.icon-theme.cache : Permission denied
gtk-update-icon-cache.real: Failed to open file /usr/share/icons/handhelds/.icon-theme.cache : Permission denied
gtk-update-icon-cache.real: Failed to open file /usr/share/icons/locolor/.icon-theme.cache : Permission denied
gtk-update-icon-cache.real: Failed to open file /usr/share/icons/redglass/.icon-theme.cache : Permission denied
gtk-update-icon-cache.real: Failed to open file /usr/share/icons/whiteglass/.icon-theme.cache : Permission denied
 172:Removing kernel-module-x.. ######################################## [ 78%]
/home/cornel/SDD/Yocto/3poky/build/tmp/work/qemux86_64-poky-linux/core-image-sato/1.0-r0/rootfs///install/tmp/rpm-tmp.63125: line 3: update-modules: command not found
 173:Removing kernel-module-i.. ######################################## [ 78%]
/home/cornel/SDD/Yocto/3poky/build/tmp/work/qemux86_64-poky-linux/core-image-sato/1.0-r0/rootfs///install/tmp/rpm-tmp.63125: line 3: update-modules: command not found
 174:Removing libgstvideo-0.1.. ######################################## [ 79%]

ERROR: Function failed: do_rootfs (see /home/cornel/SDD/Yocto/3poky/build/tmp/work/qemux86_64-poky-linux/core-image-sato/1.0-r0/temp/log.do_rootfs.6760 for further information)
"
Comment 1 Yi Zhao 2012-12-26 09:05:17 UTC
If I only remove "ssh-server-dropbear" in IMAGE_FEATURES line, there is no this issue. 

Robert, Would you please take a look at this ?

Thanks,
Yi
Comment 2 Chen Qi 2012-12-26 09:14:15 UTC
FWIW, it may be related to a recent commit of postinsts.

Notice this code snippet:
+for icondir in $D/usr/share/icons/*/ ; do
+       gtk-update-icon-cache -fqt  $icondir
+done

And see details below.

commit dec1e7fdcee5980202c36cb43597fc9110103312
Author: Laurentiu Palcu <laurentiu.palcu@intel.com>
Date:   Tue Sep 18 18:56:04 2012 +0300

    gtk-icon-cache: run the icon generation at rootfs time
    
    This change will allow for the icon cache generation at rootfs time and
    only once, at the end. So, even though there will be many packages
    depending on gtk+, the icon cache generation will be done once.
    Hopefully, this will lower the target's first boot time significantly
    by using the power of the host machine to generate the cache.
    
    (From OE-Core rev: 74e34f6828771095a25d2c2de89f468b33e359f7)
    
    Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
    Signed-off-by: Saul Wold <sgw@linux.intel.com>
    Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

diff --git a/meta/classes/gtk-icon-cache.bbclass b/meta/classes/gtk-icon-cache.bbclass
index 01fb2f3..f87a30f 100644
--- a/meta/classes/gtk-icon-cache.bbclass
+++ b/meta/classes/gtk-icon-cache.bbclass
@@ -1,12 +1,22 @@
 FILES_${PN} += "${datadir}/icons/hicolor"
 
-DEPENDS += "${@['hicolor-icon-theme', '']['${BPN}' == 'hicolor-icon-theme']}"
+DEPENDS += "${@['hicolor-icon-theme', '']['${BPN}' == 'hicolor-icon-theme']} gtk+-native"
 
-# This could run on the host as icon cache files are architecture independent,
-# but there is no gtk-update-icon-cache built natively.
 gtk_icon_cache_postinst() {
 if [ "x$D" != "x" ]; then
-        exit 1
+    if [ ! -f $INTERCEPT_DIR/update_icon_cache ]; then
+        cat << "EOF" > $INTERCEPT_DIR/update_icon_cache
+#!/bin/sh
+
+# update native pixbuf loaders
+gdk-pixbuf-query-loaders --update-cache
+
+for icondir in $D/usr/share/icons/*/ ; do
+       gtk-update-icon-cache -fqt  $icondir
+done
+EOF
+    fi
+    exit 0
 fi
Comment 3 Hongxu Jia 2013-01-10 00:31:57 UTC
There are defects to support prerm/postrm at image creation time:
  1) update-rc.d:support postrm at image creation time
  2) gtk-icon-cache.bbclass:support postrm at image creation time
  3) avahi.inc:support postrm at image creation time
  4) libnss-mdns:support prerm at image creation time
  5) distcc:support postrm at image creation time
  6) matchbox-keyboard-im:support postinst and postrm at image creation time

This bug is about 2)gtk-icon-cache.bbclass.
I am working on it.
Comment 5 liang li 2013-02-06 08:15:34 UTC
no such error when build qemux86 sato-image with test steps of the defect with poky master branch git commit 7e9cb437b1b720e656f4a33f73c07c5dc7356a2c.