From 1855e94280bdbce2de84cb81cdd61f01950d05d9 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 15 Dec 2011 21:08:49 +0000 Subject: opkg: Update svn 625 -> 633 and fix preinst issues There is a major issue with opkg images at the moment as preinst functions are not being executed before their dependencies are installed and this is leading to corruption of images containing avahi/dbus in particular. There are various changes in upstream opkg in the last 8 revisions which make changes in this area but sadly these aren't enough to get things working for us. I've updated to the latest svn revision with this patch since it makes sense to pull in those changes first and then supplement them with the attached patches. There is a full description of the patches in the patch headers but in summary they: a) Ensure preinst functions execute with their dependencies installed. This is a pretty invasive change as it changes the package install ordering in general. b) Ensure opkg sets $D, not $PKG_ROOT which we don't use c) Change opkg to allow execution of postinstall functions which fail resulting in execution on the target device as rootfs_ipk.bbclass currently does manually. The remaining changes interface this with the rest of the OE build infrastructure, adding in the option to tell opkg to run the preinst and postinst functions, ensure the correct environment is present for the postinst scripts and removing the now unneeded rootfs_ipk class code which opkg now does itself. [YOCTO #1711] (From OE-Core rev: 2feba313c991170747381c7cf821a45c2cd04632) Signed-off-by: Richard Purdie --- meta/classes/rootfs_ipk.bbclass | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) (limited to 'meta/classes/rootfs_ipk.bbclass') diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass index ec0195159e..b5556fa254 100644 --- a/meta/classes/rootfs_ipk.bbclass +++ b/meta/classes/rootfs_ipk.bbclass @@ -60,14 +60,14 @@ fakeroot rootfs_ipk_do_rootfs () { export INSTALL_CONF_IPK="${IPKGCONF_TARGET}" export INSTALL_PACKAGES_IPK="${PACKAGE_INSTALL}" - package_install_internal_ipk - #post install export D=${IMAGE_ROOTFS} export OFFLINE_ROOT=${IMAGE_ROOTFS} export IPKG_OFFLINE_ROOT=${IMAGE_ROOTFS} export OPKG_OFFLINE_ROOT=${IPKG_OFFLINE_ROOT} + package_install_internal_ipk + # Distro specific packages should create this #mkdir -p ${IMAGE_ROOTFS}/etc/opkg/ #grep "^arch" ${IPKGCONF_TARGET} >${IMAGE_ROOTFS}/etc/opkg/arch.conf @@ -75,28 +75,8 @@ fakeroot rootfs_ipk_do_rootfs () { ${OPKG_POSTPROCESS_COMMANDS} ${ROOTFS_POSTINSTALL_COMMAND} - runtime_script_required=0 - - # Base-passwd needs to run first to install /etc/passwd and friends - if [ -e ${IMAGE_ROOTFS}${opkglibdir}/info/base-passwd.preinst ] ; then - sh ${IMAGE_ROOTFS}${opkglibdir}/info/base-passwd.preinst - fi - - for i in ${IMAGE_ROOTFS}${opkglibdir}/info/*.preinst; do - if [ -f $i ] && ! sh $i; then - runtime_script_required=1 - opkg-cl ${IPKG_ARGS} flag unpacked `basename $i .preinst` - fi - done - for i in ${IMAGE_ROOTFS}${opkglibdir}/info/*.postinst; do - if [ -f $i ] && ! sh $i configure; then - runtime_script_required=1 - opkg-cl ${IPKG_ARGS} flag unpacked `basename $i .postinst` - fi - done - if ${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "true", "false" ,d)}; then - if [ $runtime_script_required -eq 1 ]; then + if grep Status:.install.ok.unpacked ${IMAGE_ROOTFS}${opkglibdir}status; then echo "Some packages could not be configured offline and rootfs is read-only." exit 1 fi -- cgit v1.2.3-54-g00ecf