Postinstall fixes
cover Postinstall fixes
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(-)
Signature · 1 line
1.7.9.5
PATCH 1/2 populate_sdk_(deb|ipk|rpm): export NATIVE_ROOT and INTERCEPT_DIR variables
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.
--- 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(+)
meta/classes/populate_sdk_deb.bbclass +2 -0
@@ -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
meta/classes/populate_sdk_ipk.bbclass +2 -0
@@ -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
meta/classes/populate_sdk_rpm.bbclass +2 -0
@@ -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/
Signature · 1 line
1.7.9.5
Re: [PATCH 1/2] populate_sdk_(deb|ipk|rpm): export NATIVE_ROOT and INTERCEPT_DIR variables
Quoted 6 lines · Laurentiu Palcu
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 <[email protected]>...
+ export NATIVE_ROOT=${STAGING_DIR_NATIVE}
Quoted 2 lines
...
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,
Signature · 3 lines
Otavio Salvador O.S. Systems E-mail: [email protected] 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
Quoted 14 lines · Otavio Salvador
On Mon, Dec 10, 2012 at 2:09 PM, Laurentiu Palcu <[email protected] <mailto:[email protected]>> 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 <[email protected]<mailto:[email protected]>>
...
Quoted 7 lines
+ export NATIVE_ROOT=${STAGING_DIR_NATIVE}
...Why you don't use
STAGING_DIR_NATIVEdirectly? 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!
Quoted 15 lines
Regards,
--
Otavio SalvadorO.S. Systems
E-mail: [email protected] <mailto:[email protected]>
http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
PATCH 2/2 gdk-pixbuf: handle postinstall errors differently
In reply to Laurentiu PalcuApparently 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.
--- meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.24.1.bb | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-)
meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.24.1.bb +17 -3
@@ -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
Signature · 1 line
1.7.9.5