All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Postinstall improvements
@ 2012-12-04 13:59 Laurentiu Palcu
  2012-12-04 13:59 ` [PATCH 1/5] image.bbclass: run postinst scripts once, at rootfs time Laurentiu Palcu
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Laurentiu Palcu @ 2012-12-04 13:59 UTC (permalink / raw)
  To: openembedded-core, schnitzeltony

Hi,

This is the former RFC that was on the mailing list a couple of months ago.
Hopefully, this time the patches will make it in since last time the release
was to close to have these changes in.

So, the main improvement this patchset brings is running the icon cache
generation on host, at rootfs time, after all packages have been installed. This
will cut off a lot from the target's first boot time. Also, postinstalls for
gconf and gdk-pixbuf were also changed to run on host at rootfs time.

With these changes, just a handful of packages will need to run the postinstalls
on target (did the tests with core-image-sato). I prefer to approach the
remaining packages one by one.

My preliminary tests show no issues but, since there are lots of setups out there,
testing is always welcomed. Andreas, I know you have such a setup, could you take
these patches for a spin if you find some time?

Thanks,
Laurentiu

The following changes since commit da6c266b1184eed8b1bc851f24a9ee17ab56d562:

  xserver-xorg: restore packaging for the DRI/DRI2/DBE extensions (2012-12-03 16:38:35 +0000)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib lpalcu/postinst
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=lpalcu/postinst

Laurentiu Palcu (5):
  image.bbclass: run postinst scripts once, at rootfs time
  rootfs generation: export two new variables to postinst scriptlets
  gtk-icon-cache: run the icon generation at rootfs time
  gdk-pixbuf: generate the pixbuf loader's cache ar rootfs time
  gconf.bbclass: run postinstalls at rootfs time

 meta/classes/gconf.bbclass                         |   11 +++++++----
 meta/classes/gtk-icon-cache.bbclass                |   18 ++++++++++++++----
 meta/classes/image.bbclass                         |   20 +++++++++++++++++---
 meta/classes/package_rpm.bbclass                   |    2 ++
 meta/classes/rootfs_deb.bbclass                    |    2 ++
 meta/classes/rootfs_ipk.bbclass                    |    2 ++
 meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.24.1.bb |   17 +++++++++++++++--
 7 files changed, 59 insertions(+), 13 deletions(-)

-- 
1.7.9.5




^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/5] image.bbclass: run postinst scripts once, at rootfs time
  2012-12-04 13:59 [PATCH 0/5] Postinstall improvements Laurentiu Palcu
@ 2012-12-04 13:59 ` Laurentiu Palcu
  2012-12-04 14:10   ` Otavio Salvador
  2012-12-04 13:59 ` [PATCH 2/5] rootfs generation: export two new variables to postinst scriptlets Laurentiu Palcu
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Laurentiu Palcu @ 2012-12-04 13:59 UTC (permalink / raw)
  To: openembedded-core, schnitzeltony

This patch will allow the repeating postinst scriptlets to be run
only once, on host, at do_rootfs time. This will lower the time for
rootfs generation and, also, instead of running some time consuming
scriptlets at target's first boot, we will do on the host.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
---
 meta/classes/image.bbclass |   20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 7b24e4e..719d871 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -156,7 +156,7 @@ inherit ${IMAGE_CLASSES}
 
 IMAGE_POSTPROCESS_COMMAND ?= ""
 MACHINE_POSTPROCESS_COMMAND ?= ""
-ROOTFS_POSTPROCESS_COMMAND ?= ""
+ROOTFS_POSTPROCESS_COMMAND_prepend = "run_intercept_scriptlets; "
 
 # some default locales
 IMAGE_LINGUAS ?= "de-de fr-fr en-gb"
@@ -166,15 +166,29 @@ LINGUAS_INSTALL ?= "${@" ".join(map(lambda s: "locale-base-%s" % s, d.getVar('IM
 PSEUDO_PASSWD = "${IMAGE_ROOTFS}"
 
 do_rootfs[nostamp] = "1"
-do_rootfs[dirs] = "${TOPDIR}"
+do_rootfs[dirs] = "${TOPDIR} ${WORKDIR}/intercept_scripts"
 do_rootfs[lockfiles] += "${IMAGE_ROOTFS}.lock"
-do_rootfs[cleandirs] += "${S}"
+do_rootfs[cleandirs] += "${S} ${WORKDIR}/intercept_scripts"
 do_build[nostamp] = "1"
 
 # Must call real_do_rootfs() from inside here, rather than as a separate
 # task, so that we have a single fakeroot context for the whole process.
 do_rootfs[umask] = "022"
 
+
+run_intercept_scriptlets () {
+	if [ -d ${WORKDIR}/intercept_scripts ]; then
+		cd ${WORKDIR}/intercept_scripts
+		echo "Running intercept scripts:"
+		for script in *; do
+			if [ "$script" = "*" ]; then break; fi
+			echo "> Executing $script"
+			chmod +x $script
+			./$script
+		done
+	fi
+}
+
 fakeroot do_rootfs () {
 	#set -x
 	# When use the rpm incremental image generation, don't remove the rootfs
-- 
1.7.9.5




^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/5] rootfs generation: export two new variables to postinst scriptlets
  2012-12-04 13:59 [PATCH 0/5] Postinstall improvements Laurentiu Palcu
  2012-12-04 13:59 ` [PATCH 1/5] image.bbclass: run postinst scripts once, at rootfs time Laurentiu Palcu
@ 2012-12-04 13:59 ` Laurentiu Palcu
  2012-12-04 15:07   ` Otavio Salvador
  2012-12-04 13:59 ` [PATCH 3/5] gtk-icon-cache: run the icon generation at rootfs time Laurentiu Palcu
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Laurentiu Palcu @ 2012-12-04 13:59 UTC (permalink / raw)
  To: openembedded-core, schnitzeltony

In order for the postinst scriptlets to be able to run once we need to
export the location of the intercept scripts and also the location of
native sysrootfs. The gdk-pixbuf binaries will need the latter because
in order to generate the loaders.cache it will need to scan some shared
libraries that must be native. Even though the output is a text file.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
---
 meta/classes/package_rpm.bbclass |    2 ++
 meta/classes/rootfs_deb.bbclass  |    2 ++
 meta/classes/rootfs_ipk.bbclass  |    2 ++
 3 files changed, 6 insertions(+)

diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 1ff92ce..c7ac07a 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -475,6 +475,8 @@ export D="${target_rootfs}"
 export OFFLINE_ROOT="\$D"
 export IPKG_OFFLINE_ROOT="\$D"
 export OPKG_OFFLINE_ROOT="\$D"
+export INTERCEPT_DIR="${WORKDIR}/intercept_scripts"
+export NATIVE_ROOT=${STAGING_DIR_NATIVE}
 
 \$2 \$1/\$3 \$4
 if [ \$? -ne 0 ]; then
diff --git a/meta/classes/rootfs_deb.bbclass b/meta/classes/rootfs_deb.bbclass
index 881fdbd..955382f 100644
--- a/meta/classes/rootfs_deb.bbclass
+++ b/meta/classes/rootfs_deb.bbclass
@@ -48,6 +48,8 @@ fakeroot rootfs_deb_do_rootfs () {
 	export OFFLINE_ROOT=${IMAGE_ROOTFS}
 	export IPKG_OFFLINE_ROOT=${IMAGE_ROOTFS}
 	export OPKG_OFFLINE_ROOT=${IMAGE_ROOTFS}
+	export INTERCEPT_DIR=${WORKDIR}/intercept_scripts
+	export NATIVE_ROOT=${STAGING_DIR_NATIVE}
 
 	# Attempt to run preinsts
 	# Mark packages with preinst failures as unpacked
diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass
index fc69b7e..8766d24 100644
--- a/meta/classes/rootfs_ipk.bbclass
+++ b/meta/classes/rootfs_ipk.bbclass
@@ -69,6 +69,8 @@ fakeroot rootfs_ipk_do_rootfs () {
 	export OFFLINE_ROOT=${IMAGE_ROOTFS}
 	export IPKG_OFFLINE_ROOT=${IMAGE_ROOTFS}
 	export OPKG_OFFLINE_ROOT=${IPKG_OFFLINE_ROOT}
+	export INTERCEPT_DIR=${WORKDIR}/intercept_scripts
+	export NATIVE_ROOT=${STAGING_DIR_NATIVE}
 
 	package_install_internal_ipk
 
-- 
1.7.9.5




^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/5] gtk-icon-cache: run the icon generation at rootfs time
  2012-12-04 13:59 [PATCH 0/5] Postinstall improvements Laurentiu Palcu
  2012-12-04 13:59 ` [PATCH 1/5] image.bbclass: run postinst scripts once, at rootfs time Laurentiu Palcu
  2012-12-04 13:59 ` [PATCH 2/5] rootfs generation: export two new variables to postinst scriptlets Laurentiu Palcu
@ 2012-12-04 13:59 ` Laurentiu Palcu
  2012-12-04 13:59 ` [PATCH 4/5] gdk-pixbuf: generate the pixbuf loader's cache ar " Laurentiu Palcu
  2012-12-04 13:59 ` [PATCH 5/5] gconf.bbclass: run postinstalls at " Laurentiu Palcu
  4 siblings, 0 replies; 12+ messages in thread
From: Laurentiu Palcu @ 2012-12-04 13:59 UTC (permalink / raw)
  To: openembedded-core, schnitzeltony

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.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
---
 meta/classes/gtk-icon-cache.bbclass |   18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

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
 
 # Update the pixbuf loaders in case they haven't been registered yet
-- 
1.7.9.5




^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 4/5] gdk-pixbuf: generate the pixbuf loader's cache ar rootfs time
  2012-12-04 13:59 [PATCH 0/5] Postinstall improvements Laurentiu Palcu
                   ` (2 preceding siblings ...)
  2012-12-04 13:59 ` [PATCH 3/5] gtk-icon-cache: run the icon generation at rootfs time Laurentiu Palcu
@ 2012-12-04 13:59 ` Laurentiu Palcu
  2012-12-04 14:34   ` Burton, Ross
  2012-12-04 13:59 ` [PATCH 5/5] gconf.bbclass: run postinstalls at " Laurentiu Palcu
  4 siblings, 1 reply; 12+ messages in thread
From: Laurentiu Palcu @ 2012-12-04 13:59 UTC (permalink / raw)
  To: openembedded-core, schnitzeltony

This will generate the loaders.cache file for pixbuf, at rootfs time.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
---
 meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.24.1.bb |   17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.24.1.bb b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.24.1.bb
index 65a2d68..2377d0e 100644
--- a/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.24.1.bb
+++ b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.24.1.bb
@@ -58,9 +58,21 @@ FILES_${PN}-dbg += " \
 
 postinst_pixbufloader () {
 if [ "x$D" != "x" ]; then
-    exit 1
+# Update the target's pixbuf loader's cache. Since the native binary will
+# throw an error if the shared objects do not belong to the same ELF class,
+# we trick the gdk-pixbuf-query-loaders into scanning the native shared
+# objects and then we remove the NATIVE_ROOT prefix from the paths in
+# loaders.cache.
+gdk-pixbuf-query-loaders $(find $D/${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders \
+        -name *.so | sed -e "s:$D:$NATIVE_ROOT:g") > \
+        $D/${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders.cache || exit 1
+
+sed -i -e "s:$NATIVE_ROOT:/:g" $D/${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
+
+exit 0
 fi
 
+# Update the pixbuf loaders in case they haven't been registered yet
 GDK_PIXBUF_MODULEDIR=${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders gdk-pixbuf-query-loaders --update-cache
 
 if [ -x ${bindir}/gtk-update-icon-cache ] && [ -d ${datadir}/icons ]; then
@@ -93,6 +105,7 @@ do_install_append_class-native() {
 		GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
 
 	create_wrapper ${D}/${bindir}/gdk-pixbuf-query-loaders \
-		GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
+		GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache \
+		GDK_PIXBUF_MODULEDIR=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders
 }
 BBCLASSEXTEND = "native"
-- 
1.7.9.5




^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 5/5] gconf.bbclass: run postinstalls at rootfs time
  2012-12-04 13:59 [PATCH 0/5] Postinstall improvements Laurentiu Palcu
                   ` (3 preceding siblings ...)
  2012-12-04 13:59 ` [PATCH 4/5] gdk-pixbuf: generate the pixbuf loader's cache ar " Laurentiu Palcu
@ 2012-12-04 13:59 ` Laurentiu Palcu
  4 siblings, 0 replies; 12+ messages in thread
From: Laurentiu Palcu @ 2012-12-04 13:59 UTC (permalink / raw)
  To: openembedded-core, schnitzeltony

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
---
 meta/classes/gconf.bbclass |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/meta/classes/gconf.bbclass b/meta/classes/gconf.bbclass
index 7a3ee3c..38097bc 100644
--- a/meta/classes/gconf.bbclass
+++ b/meta/classes/gconf.bbclass
@@ -15,13 +15,16 @@ export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL = "1"
 
 gconf_postinst() {
 if [ "x$D" != "x" ]; then
-	exit 1
+	export GCONF_BACKEND_DIR=${STAGING_LIBDIR_NATIVE}/GConf/2
+	export GCONF_CONFIG_SOURCE="xml::$D${sysconfdir}/gconf/gconf.xml.defaults"
+else
+	export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
 fi
-SCHEMA_LOCATION=/etc/gconf/schemas
+
+SCHEMA_LOCATION=$D/etc/gconf/schemas
 for SCHEMA in ${SCHEMA_FILES}; do
 	if [ -e $SCHEMA_LOCATION/$SCHEMA ]; then
-		HOME=/root GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` \
-			gconftool-2 \
+		HOME=$D/root gconftool-2 \
 			--makefile-install-rule $SCHEMA_LOCATION/$SCHEMA > /dev/null
 	fi
 done
-- 
1.7.9.5




^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/5] image.bbclass: run postinst scripts once, at rootfs time
  2012-12-04 13:59 ` [PATCH 1/5] image.bbclass: run postinst scripts once, at rootfs time Laurentiu Palcu
@ 2012-12-04 14:10   ` Otavio Salvador
  0 siblings, 0 replies; 12+ messages in thread
From: Otavio Salvador @ 2012-12-04 14:10 UTC (permalink / raw)
  To: Laurentiu Palcu; +Cc: Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 2890 bytes --]

On Tue, Dec 4, 2012 at 11:59 AM, Laurentiu Palcu
<laurentiu.palcu@intel.com>wrote:

> This patch will allow the repeating postinst scriptlets to be run
> only once, on host, at do_rootfs time. This will lower the time for
> rootfs generation and, also, instead of running some time consuming
> scriptlets at target's first boot, we will do on the host.
>
> Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
> ---
>  meta/classes/image.bbclass |   20 +++++++++++++++++---
>  1 file changed, 17 insertions(+), 3 deletions(-)
>
> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> index 7b24e4e..719d871 100644
> --- a/meta/classes/image.bbclass
> +++ b/meta/classes/image.bbclass
> @@ -156,7 +156,7 @@ inherit ${IMAGE_CLASSES}
>
>  IMAGE_POSTPROCESS_COMMAND ?= ""
>  MACHINE_POSTPROCESS_COMMAND ?= ""
> -ROOTFS_POSTPROCESS_COMMAND ?= ""
> +ROOTFS_POSTPROCESS_COMMAND_prepend = "run_intercept_scriptlets; "
>
>  # some default locales
>  IMAGE_LINGUAS ?= "de-de fr-fr en-gb"
> @@ -166,15 +166,29 @@ LINGUAS_INSTALL ?= "${@" ".join(map(lambda s:
> "locale-base-%s" % s, d.getVar('IM
>  PSEUDO_PASSWD = "${IMAGE_ROOTFS}"
>
>  do_rootfs[nostamp] = "1"
> -do_rootfs[dirs] = "${TOPDIR}"
> +do_rootfs[dirs] = "${TOPDIR} ${WORKDIR}/intercept_scripts"
>  do_rootfs[lockfiles] += "${IMAGE_ROOTFS}.lock"
> -do_rootfs[cleandirs] += "${S}"
> +do_rootfs[cleandirs] += "${S} ${WORKDIR}/intercept_scripts"
>  do_build[nostamp] = "1"
>
>  # Must call real_do_rootfs() from inside here, rather than as a separate
>  # task, so that we have a single fakeroot context for the whole process.
>  do_rootfs[umask] = "022"
>
> +
> +run_intercept_scriptlets () {
> +       if [ -d ${WORKDIR}/intercept_scripts ]; then
> +               cd ${WORKDIR}/intercept_scripts
> +               echo "Running intercept scripts:"
> +               for script in *; do
> +                       if [ "$script" = "*" ]; then break; fi
>

This is personal choice but I'd use:

if [ ... ]; then
    break
fi

or

[ ... ] && break

The if in a single line seems confusing to read for me.


> +                       echo "> Executing $script"
> +                       chmod +x $script
> +                       ./$script
> +               done
> +       fi
> +}
> +
>  fakeroot do_rootfs () {
>         #set -x
>         # When use the rpm incremental image generation, don't remove the
> rootfs
> --
> 1.7.9.5
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>



-- 
Otavio Salvador                             O.S. Systems
E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br

[-- Attachment #2: Type: text/html, Size: 4277 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 4/5] gdk-pixbuf: generate the pixbuf loader's cache ar rootfs time
  2012-12-04 13:59 ` [PATCH 4/5] gdk-pixbuf: generate the pixbuf loader's cache ar " Laurentiu Palcu
@ 2012-12-04 14:34   ` Burton, Ross
  2012-12-05  9:28     ` Laurentiu Palcu
  0 siblings, 1 reply; 12+ messages in thread
From: Burton, Ross @ 2012-12-04 14:34 UTC (permalink / raw)
  To: Laurentiu Palcu; +Cc: openembedded-core

Hi,

On 4 December 2012 13:59, Laurentiu Palcu <laurentiu.palcu@intel.com> wrote:
> +# Update the target's pixbuf loader's cache. Since the native binary will
> +# throw an error if the shared objects do not belong to the same ELF class,
> +# we trick the gdk-pixbuf-query-loaders into scanning the native shared
> +# objects and then we remove the NATIVE_ROOT prefix from the paths in
> +# loaders.cache.

It's probably worth explaining why it's fine that only the loaders
from gdk-pixbuf-native are used and for example librsvg-native doesn't
need to be built.

Ross



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/5] rootfs generation: export two new variables to postinst scriptlets
  2012-12-04 13:59 ` [PATCH 2/5] rootfs generation: export two new variables to postinst scriptlets Laurentiu Palcu
@ 2012-12-04 15:07   ` Otavio Salvador
  2012-12-05 15:30     ` Richard Purdie
  0 siblings, 1 reply; 12+ messages in thread
From: Otavio Salvador @ 2012-12-04 15:07 UTC (permalink / raw)
  To: Laurentiu Palcu; +Cc: Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 2999 bytes --]

On Tue, Dec 4, 2012 at 11:59 AM, Laurentiu Palcu
<laurentiu.palcu@intel.com>wrote:

> In order for the postinst scriptlets to be able to run once we need to
> export the location of the intercept scripts and also the location of
> native sysrootfs. The gdk-pixbuf binaries will need the latter because
> in order to generate the loaders.cache it will need to scan some shared
> libraries that must be native. Even though the output is a text file.
>
> Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
> ---
>  meta/classes/package_rpm.bbclass |    2 ++
>  meta/classes/rootfs_deb.bbclass  |    2 ++
>  meta/classes/rootfs_ipk.bbclass  |    2 ++
>  3 files changed, 6 insertions(+)
>
> diff --git a/meta/classes/package_rpm.bbclass
> b/meta/classes/package_rpm.bbclass
> index 1ff92ce..c7ac07a 100644
> --- a/meta/classes/package_rpm.bbclass
> +++ b/meta/classes/package_rpm.bbclass
> @@ -475,6 +475,8 @@ export D="${target_rootfs}"
>  export OFFLINE_ROOT="\$D"
>  export IPKG_OFFLINE_ROOT="\$D"
>  export OPKG_OFFLINE_ROOT="\$D"
> +export INTERCEPT_DIR="${WORKDIR}/intercept_scripts"
> +export NATIVE_ROOT=${STAGING_DIR_NATIVE}
>

The NATIVE_ROOT seems a duplication, I'd prefer you to use
STAGING_DIR_NATIVE in code as this is a known variable name and makes it
easy to understand.


>  \$2 \$1/\$3 \$4
>  if [ \$? -ne 0 ]; then
> diff --git a/meta/classes/rootfs_deb.bbclass
> b/meta/classes/rootfs_deb.bbclass
> index 881fdbd..955382f 100644
> --- a/meta/classes/rootfs_deb.bbclass
> +++ b/meta/classes/rootfs_deb.bbclass
> @@ -48,6 +48,8 @@ fakeroot rootfs_deb_do_rootfs () {
>         export OFFLINE_ROOT=${IMAGE_ROOTFS}
>         export IPKG_OFFLINE_ROOT=${IMAGE_ROOTFS}
>         export OPKG_OFFLINE_ROOT=${IMAGE_ROOTFS}
> +       export INTERCEPT_DIR=${WORKDIR}/intercept_scripts
> +       export NATIVE_ROOT=${STAGING_DIR_NATIVE}
>
>         # Attempt to run preinsts
>         # Mark packages with preinst failures as unpacked
> diff --git a/meta/classes/rootfs_ipk.bbclass
> b/meta/classes/rootfs_ipk.bbclass
> index fc69b7e..8766d24 100644
> --- a/meta/classes/rootfs_ipk.bbclass
> +++ b/meta/classes/rootfs_ipk.bbclass
> @@ -69,6 +69,8 @@ fakeroot rootfs_ipk_do_rootfs () {
>         export OFFLINE_ROOT=${IMAGE_ROOTFS}
>         export IPKG_OFFLINE_ROOT=${IMAGE_ROOTFS}
>         export OPKG_OFFLINE_ROOT=${IPKG_OFFLINE_ROOT}
> +       export INTERCEPT_DIR=${WORKDIR}/intercept_scripts
> +       export NATIVE_ROOT=${STAGING_DIR_NATIVE}
>
>         package_install_internal_ipk
>
> --
> 1.7.9.5
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>



-- 
Otavio Salvador                             O.S. Systems
E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br

[-- Attachment #2: Type: text/html, Size: 4092 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 4/5] gdk-pixbuf: generate the pixbuf loader's cache ar rootfs time
  2012-12-04 14:34   ` Burton, Ross
@ 2012-12-05  9:28     ` Laurentiu Palcu
  2012-12-14 14:24       ` Burton, Ross
  0 siblings, 1 reply; 12+ messages in thread
From: Laurentiu Palcu @ 2012-12-05  9:28 UTC (permalink / raw)
  To: Burton, Ross; +Cc: openembedded-core



On 12/04/2012 04:34 PM, Burton, Ross wrote:
> It's probably worth explaining why it's fine that only the loaders
> from gdk-pixbuf-native are used and for example librsvg-native doesn't
> need to be built.
First off, the librsvg postinstall scriptlet is still postponed to run
on target, at first boot. I didn't touch that one, yet. We will deal
with this one (and others) in subsequent patches. Secondly, the
gdk-pixbuf postinstall scriptlet will exit 1 if the command fails. So,
if one has librsvg built and the native one is not present, the
gdk-pixbuf scriptlet will fail on host because it will not find the
native SVG pixbuf loader and it will be postponed to run on target at
first boot. No harm done, this is the current behavior anyway.

However, if we want to be able to run all postinstall scriptlets on host
in order to support read-only rootfs, we might need to have
librsvg-native built too so that we generate the pixbuf loader cache on
host at rootfs install time.

Let's take it step-by-step though and see how the current changes
behave. What do you think?

Thanks,
Laurentiu



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/5] rootfs generation: export two new variables to postinst scriptlets
  2012-12-04 15:07   ` Otavio Salvador
@ 2012-12-05 15:30     ` Richard Purdie
  0 siblings, 0 replies; 12+ messages in thread
From: Richard Purdie @ 2012-12-05 15:30 UTC (permalink / raw)
  To: Otavio Salvador; +Cc: Patches, about the oe-core layer

On Tue, 2012-12-04 at 13:07 -0200, Otavio Salvador wrote:
> 
> 
> 
> On Tue, Dec 4, 2012 at 11:59 AM, Laurentiu Palcu
> <laurentiu.palcu@intel.com> wrote:
>         In order for the postinst scriptlets to be able to run once we
>         need to
>         export the location of the intercept scripts and also the
>         location of
>         native sysrootfs. The gdk-pixbuf binaries will need the latter
>         because
>         in order to generate the loaders.cache it will need to scan
>         some shared
>         libraries that must be native. Even though the output is a
>         text file.
>         
>         Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
>         ---
>          meta/classes/package_rpm.bbclass |    2 ++
>          meta/classes/rootfs_deb.bbclass  |    2 ++
>          meta/classes/rootfs_ipk.bbclass  |    2 ++
>          3 files changed, 6 insertions(+)
>         
>         diff --git a/meta/classes/package_rpm.bbclass
>         b/meta/classes/package_rpm.bbclass
>         index 1ff92ce..c7ac07a 100644
>         --- a/meta/classes/package_rpm.bbclass
>         +++ b/meta/classes/package_rpm.bbclass
>         @@ -475,6 +475,8 @@ export D="${target_rootfs}"
>          export OFFLINE_ROOT="\$D"
>          export IPKG_OFFLINE_ROOT="\$D"
>          export OPKG_OFFLINE_ROOT="\$D"
>         +export INTERCEPT_DIR="${WORKDIR}/intercept_scripts"
>         +export NATIVE_ROOT=${STAGING_DIR_NATIVE}
> 
> 
> The NATIVE_ROOT seems a duplication, I'd prefer you to use
> STAGING_DIR_NATIVE in code as this is a known variable name and makes
> it easy to understand.
 
I'm going to disagree on that, I think this does make sense in the
context of the functions we're changing here.

On the other hand I'd love to simplify the whole *OFFLINE_ROOT mess but
that is for a different patch...

Cheers,

Richard





^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 4/5] gdk-pixbuf: generate the pixbuf loader's cache ar rootfs time
  2012-12-05  9:28     ` Laurentiu Palcu
@ 2012-12-14 14:24       ` Burton, Ross
  0 siblings, 0 replies; 12+ messages in thread
From: Burton, Ross @ 2012-12-14 14:24 UTC (permalink / raw)
  To: Laurentiu Palcu; +Cc: openembedded-core

On 5 December 2012 09:28, Laurentiu Palcu <laurentiu.palcu@intel.com> wrote:
> However, if we want to be able to run all postinstall scriptlets on host
> in order to support read-only rootfs, we might need to have
> librsvg-native built too so that we generate the pixbuf loader cache on
> host at rootfs install time.

Not true - the icon cache explicitly only loads .png and .xpm, so my
point was that it's entirely safe to run gtk-update-icon-cache at
rootfs time as those loaders are part of gdk-pixbuf, which must be
available natively if we're running gtk-update-icon-cache.

Ross



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-12-14 14:39 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-04 13:59 [PATCH 0/5] Postinstall improvements Laurentiu Palcu
2012-12-04 13:59 ` [PATCH 1/5] image.bbclass: run postinst scripts once, at rootfs time Laurentiu Palcu
2012-12-04 14:10   ` Otavio Salvador
2012-12-04 13:59 ` [PATCH 2/5] rootfs generation: export two new variables to postinst scriptlets Laurentiu Palcu
2012-12-04 15:07   ` Otavio Salvador
2012-12-05 15:30     ` Richard Purdie
2012-12-04 13:59 ` [PATCH 3/5] gtk-icon-cache: run the icon generation at rootfs time Laurentiu Palcu
2012-12-04 13:59 ` [PATCH 4/5] gdk-pixbuf: generate the pixbuf loader's cache ar " Laurentiu Palcu
2012-12-04 14:34   ` Burton, Ross
2012-12-05  9:28     ` Laurentiu Palcu
2012-12-14 14:24       ` Burton, Ross
2012-12-04 13:59 ` [PATCH 5/5] gconf.bbclass: run postinstalls at " Laurentiu Palcu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.