From patchwork Sun Aug 5 16:58:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [4/5] gtk-icon-cache: call postinst scriplet at do_rootfs time Date: Sun, 05 Aug 2012 16:58:39 -0000 From: Laurentiu Palcu X-Patchwork-Id: 33901 Message-Id: <501EA63F.9090304@intel.com> To: openembedded-core@lists.openembedded.org On 08/04/2012 10:51 PM, Khem Raj wrote: > On Sat, Aug 4, 2012 at 12:37 PM, Andreas Müller > wrote: >> And less than 3min on overo with the patches we sent (and my xfce >> image is full of gtk-icon-update). Don't misunderstand me: I agree on >> doing things like this on host if possible. But for me the main time >> waiting on a new image is do_rootfs and I just suggest to think about >> having these tasks run only once - but we can do this later or never. >> A bit off topic: As far as I can remember there were times when it was >> a no-go having gtk-native in oe-core. I hope they are over... > > I certainly agree with you that it should be run once. However what if > you changed something in icons between towo do rootfs runs ? > but I would like to know how much build time is it adding to do_rootfs ? Short answer: *less than 2 secs* Long answer: In order to measure the time added to do_rootfs by the gtk-update-icon-cache calls, I modified gtk+ recipe to create a wrapper script, as seen in attachment [1]. I compiled core-image-sato using the following setup: CPU: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz, 4 cores with HT RAM: 8GB Storage: SSD The measurements are in attachment [2]. Conclusion: I would say that a delay of less than 2 seconds added to do_rootfs is not that bad, in my opinion. Of course, we can optimize this as much as possible but, is it worth the effort? You could give it a test yourselves and let me know your results. I will send a version 2 of the patchset(as soon as we all agree on the solution), with some changes suggested by Mark and some PR bumps suggested by Koen. [1] - measure_time.patch [2] - do_rootfs.log Thanks, Laurentiu > sometimes over optimising is bad too. > > _______________________________________________ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core > diff --git a/meta/recipes-gnome/gtk+/gtk+_2.24.8.bb b/meta/recipes-gnome/gtk+/gtk+_2.24.8.bb index 878eb87..e77ecce 100644 --- a/meta/recipes-gnome/gtk+/gtk+_2.24.8.bb +++ b/meta/recipes-gnome/gtk+/gtk+_2.24.8.bb @@ -41,6 +41,18 @@ BBCLASSEXTEND = "native" RRECOMMENDS_${PN}_virtclass-native = "" DEPENDS_virtclass-native = "glib-2.0-native atk-native pango-native cairo-native gdk-pixbuf-native" +do_install_append_virtclass-native () { + mv ${D}/${bindir}/gtk-update-icon-cache ${D}/${bindir}/gtk-update-icon-cache.real + + cat << "EOF" > ${D}/${bindir}/gtk-update-icon-cache +#!/bin/bash + +echo "Executing: gtk-update-icon-cache $@" >> ${TMPDIR}/do_rootfs.log +/usr/bin/time --f "real:%e user:%U sys:%S" -o ${TMPDIR}/do_rootfs.log --append gtk-update-icon-cache.real $@ +EOF + chmod +x ${D}/${bindir}/gtk-update-icon-cache +} + python populate_packages_prepend () { prologue = d.getVar("postinst_prologue", True)