From b11f8183074857be5a5920f093b4298884eec805 Mon Sep 17 00:00:00 2001 From: Laurentiu Palcu Date: Tue, 21 May 2013 14:17:19 +0300 Subject: rootfs_*.bbclass: add some helper functions This patch adds the following helper functions: * delayed_postinsts - outputs the list of delayed postinstalls; * save_postinsts - this will save the delayed postinstalls for ipk/deb in /etc/(ipk|deb)_postinsts; * rootfs_remove_packages - removes packages from an image; Additionaly, this patch will remove a piece of code in rootfs_ipk_do_rootfs which will be moved to image.bbclass and used for all backends; [YOCTO #4484] (From OE-Core rev: 928df79cd3964f775c4c6e4283ef84b8882f9328) Signed-off-by: Laurentiu Palcu Signed-off-by: Saul Wold Signed-off-by: Richard Purdie --- meta/classes/rootfs_rpm.bbclass | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'meta/classes/rootfs_rpm.bbclass') diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass index d373dab408..4194c5621c 100644 --- a/meta/classes/rootfs_rpm.bbclass +++ b/meta/classes/rootfs_rpm.bbclass @@ -114,8 +114,8 @@ fakeroot rootfs_rpm_do_rootfs () { ${ROOTFS_POSTPROCESS_COMMAND} if ${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "true", "false" ,d)}; then - if [ -d ${IMAGE_ROOTFS}/etc/rpm-postinsts ] ; then - if [ "`ls -A ${IMAGE_ROOTFS}/etc/rpm-postinsts`" != "" ] ; then + if [ -d ${IMAGE_ROOTFS}${sysconfdir}/rpm-postinsts ] ; then + if [ "`ls -A ${IMAGE_ROOTFS}${sysconfdir}/rpm-postinsts`" != "" ] ; then bberror "Some packages could not be configured offline and rootfs is read-only." exit 1 fi @@ -135,6 +135,20 @@ fakeroot rootfs_rpm_do_rootfs () { log_check rootfs } +rootfs_rpm_do_rootfs[vardeps] += "delayed_postinsts" + +delayed_postinsts() { + if [ -d ${IMAGE_ROOTFS}${sysconfdir}/rpm-postinsts ]; then + ls ${IMAGE_ROOTFS}${sysconfdir}/rpm-postinsts + fi +} + +save_postinsts() { + # this is just a stub. For RPM, the failed postinstalls are already saved in + # /etc/rpm-postinsts + true +} + remove_packaging_data_files() { # Save the rpmlib for increment rpm image generation t="${T}/saved_rpmlib/var/lib" @@ -165,6 +179,15 @@ rootfs_install_packages() { package_install_internal_rpm } +rootfs_remove_packages() { + rpm -e --nodeps --root=${IMAGE_ROOTFS} --dbpath=/var/lib/rpm\ + --define='_cross_scriptlet_wrapper ${WORKDIR}/scriptlet_wrapper'\ + --define='_tmppath /install/tmp' $@ + + # remove temp directory + rm -rf ${IMAGE_ROOTFS}/install +} + python () { if d.getVar('BUILD_IMAGES_FROM_FEEDS', True): flags = d.getVarFlag('do_rootfs', 'recrdeptask') -- cgit v1.2.3-54-g00ecf