[PATCH 0/2] Postinstall fixes

STALE5049d

Revision v1 of 2 in this series.

5 messages, 3 authors, 2012-12-10 · open the first message on its own page

[PATCH 0/2] Postinstall fixes

From: Laurentiu Palcu <hidden>
Date: 2012-12-10 16:23:53

Hi,

This patchset contains two fixes:
* when generating the SDK target sysroot, postinstall scriptlets could
  not benefit of the latest postinstall improvements because NATIVE_ROOT and
  INTERCEPT_DIR were not exported in populate_sdk_(deb|ipk|rpm).bbclass.
* gdk-pixbuf-query-loaders always returns 0 and the exit condition was not effective.
  Without this change the SDK builds failed because sed -i created some temporary
  files that could not be tarred and tar_sdk function failed;

Thanks,
Laurentiu

The following changes since commit c607095894cab60493ddfc4b967b0325e1c313b4:

  bitbake: Revert "BBHandler: Ensure parser state engine is correctly reset for new parsing" (2012-12-07 18:09:01 +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 (2):
  populate_sdk_(deb|ipk|rpm): export NATIVE_ROOT and INTERCEPT_DIR
    variables
  gdk-pixbuf: handle postinstall errors differently

 meta/classes/populate_sdk_deb.bbclass              |    2 ++
 meta/classes/populate_sdk_ipk.bbclass              |    2 ++
 meta/classes/populate_sdk_rpm.bbclass              |    2 ++
 meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.24.1.bb |   20 +++++++++++++++++---
 4 files changed, 23 insertions(+), 3 deletions(-)

-- 
1.7.9.5


[PATCH 1/2] populate_sdk_(deb|ipk|rpm): export NATIVE_ROOT and INTERCEPT_DIR variables

From: Laurentiu Palcu <hidden>
Date: 2012-12-10 16:23:53

In order for the postinstall scripts to have access to the recent
improvements when generating the target SDK sysroot, export these
variables in populate_sdk.

Signed-off-by: Laurentiu Palcu <redacted>
---
 meta/classes/populate_sdk_deb.bbclass |    2 ++
 meta/classes/populate_sdk_ipk.bbclass |    2 ++
 meta/classes/populate_sdk_rpm.bbclass |    2 ++
 3 files changed, 6 insertions(+)
diff --git a/meta/classes/populate_sdk_deb.bbclass b/meta/classes/populate_sdk_deb.bbclass
index f2d0621..1e28b61 100644
--- a/meta/classes/populate_sdk_deb.bbclass
+++ b/meta/classes/populate_sdk_deb.bbclass
@@ -34,6 +34,8 @@ populate_sdk_deb () {
 	export INSTALL_PACKAGES_ATTEMPTONLY_DEB="${TOOLCHAIN_TARGET_TASK_ATTEMPTONLY}"
 	export PACKAGES_LINGUAS_DEB=""
 	export INSTALL_TASK_DEB="populate_sdk-target"
+	export INTERCEPT_DIR=${WORKDIR}/intercept_scripts
+	export NATIVE_ROOT=${STAGING_DIR_NATIVE}
 
 	package_install_internal_deb
 
diff --git a/meta/classes/populate_sdk_ipk.bbclass b/meta/classes/populate_sdk_ipk.bbclass
index 65a95e7..3a5ecda 100644
--- a/meta/classes/populate_sdk_ipk.bbclass
+++ b/meta/classes/populate_sdk_ipk.bbclass
@@ -26,6 +26,8 @@ populate_sdk_ipk() {
 	export OFFLINE_ROOT=${INSTALL_ROOTFS_IPK}
 	export IPKG_OFFLINE_ROOT=${INSTALL_ROOTFS_IPK}
 	export OPKG_OFFLINE_ROOT=${IPKG_OFFLINE_ROOT}
+	export INTERCEPT_DIR=${WORKDIR}/intercept_scripts
+	export NATIVE_ROOT=${STAGING_DIR_NATIVE}
 
 	package_install_internal_ipk
 
diff --git a/meta/classes/populate_sdk_rpm.bbclass b/meta/classes/populate_sdk_rpm.bbclass
index 1c54049..b5aa601 100644
--- a/meta/classes/populate_sdk_rpm.bbclass
+++ b/meta/classes/populate_sdk_rpm.bbclass
@@ -40,6 +40,8 @@ populate_sdk_rpm () {
 	export INSTALL_PROVIDENAME_RPM="/bin/sh /bin/bash /usr/bin/env /usr/bin/perl pkgconfig pkgconfig(pkg-config)"
 	export INSTALL_TASK_RPM="populate_sdk-target"
 	export INSTALL_COMPLEMENTARY_RPM=""
+	export INTERCEPT_DIR=${WORKDIR}/intercept_scripts
+	export NATIVE_ROOT=${STAGING_DIR_NATIVE}
 
 	# Setup base system configuration
 	mkdir -p ${INSTALL_ROOTFS_RPM}/etc/rpm/
-- 
1.7.9.5


[PATCH 2/2] gdk-pixbuf: handle postinstall errors differently

From: Laurentiu Palcu <hidden>
Date: 2012-12-10 16:24:10

Apparently gdk-pixbuf-query-loaders always returns 0 but writes any
errors to stderr. So, the conditional exit at the end of the command was
useless. Write the errors to a file and exit only if the file size is
greater than 0.

Signed-off-by: Laurentiu Palcu <redacted>
---
 meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.24.1.bb |   20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 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 2377d0e..33a43be 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
@@ -63,12 +63,26 @@ if [ "x$D" != "x" ]; then
 # 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
+gdk-pixbuf-query-loaders $(ls -d -1 $D/${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders/*.so |\
+        sed -e "s:$D:$NATIVE_ROOT:g") > \
+        $D/${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders.cache \
+        2>$D/${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders.err
+
+# gdk-pixbuf-query-loaders always returns 0, so we need to check if loaders.err
+# has anything in it
+if [ -s $D/${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders.err ]; then
+	echo "${PN} postinstall scriptlet failed:"
+	cat $D/${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders.err
+	rm $D/${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders.err
+	# we've got errors, postpone postinstall for first boot
+	exit 1
+fi
 
 sed -i -e "s:$NATIVE_ROOT:/:g" $D/${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
 
+# remove the empty loaders.err
+rm $D/${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders.err
+
 exit 0
 fi
 
-- 
1.7.9.5


Re: [PATCH 1/2] populate_sdk_(deb|ipk|rpm): export NATIVE_ROOT and INTERCEPT_DIR variables

From: Otavio Salvador <hidden>
Date: 2012-12-10 16:34:18

On Mon, Dec 10, 2012 at 2:09 PM, Laurentiu Palcu
[off-list ref]wrote:
In order for the postinstall scripts to have access to the recent
improvements when generating the target SDK sysroot, export these
variables in populate_sdk.

Signed-off-by: Laurentiu Palcu <redacted>
...
+       export NATIVE_ROOT=${STAGING_DIR_NATIVE}
...
Why you don't use STAGING_DIR_NATIVE directly? This seems to have no good
reason for a variable with same content of a well known variable.

Regards,

-- 
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

Re: [PATCH 1/2] populate_sdk_(deb|ipk|rpm): export NATIVE_ROOT and INTERCEPT_DIR variables

From: Saul Wold <hidden>
Date: 2012-12-10 23:42:22

On 12/10/2012 08:19 AM, Otavio Salvador wrote:


On Mon, Dec 10, 2012 at 2:09 PM, Laurentiu Palcu
<laurentiu.palcu@intel.com <mailto:laurentiu.palcu@intel.com>> wrote:

    In order for the postinstall scripts to have access to the recent
    improvements when generating the target SDK sysroot, export these
    variables in populate_sdk.

    Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com
    <mailto:laurentiu.palcu@intel.com>>
    ...

    +       export NATIVE_ROOT=${STAGING_DIR_NATIVE}
    ...


Why you don't use STAGING_DIR_NATIVE directly? This seems to have no
good reason for a variable with same content of a well known variable.
I believe that Richard already commented on this naming and agrees that we need both.

Sau!
Regards,

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



_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help