From 76e05725b8f351b4563aa48b689c0cc30873fbd1 Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Wed, 24 Jul 2013 17:26:08 +0100 Subject: [PATCH] classes/rootfs_rpm: implement BAD_RECOMMENDATIONS for RPM Add support for the BAD_RECOMMENDATIONS variable that can be used to prevent specific packages from being installed via an RRECOMMENDS relationship when using the RPM backend. (Previously this functionality was only available when using ipk packaging.) In the process this moves the defaulting of BAD_RECOMMENDATIONS (as empty) to bitbake.conf since it is no longer specific to the ipk backend, as well as unifying some of the code that creates the configuration for smart for use on the host and target. Fixes [YOCTO #3916]. (From OE-Core rev: 4e85129a7d47baf3e32b815cbc277bff84e085a0) Signed-off-by: Paul Eggleton Signed-off-by: Saul Wold Signed-off-by: Richard Purdie --- meta/classes/package_rpm.bbclass | 11 +++++++++-- meta/classes/rootfs_ipk.bbclass | 2 -- meta/classes/rootfs_rpm.bbclass | 3 +-- meta/conf/bitbake.conf | 2 ++ 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass index 1537079..324d83f 100644 --- a/meta/classes/package_rpm.bbclass +++ b/meta/classes/package_rpm.bbclass @@ -224,6 +224,14 @@ translate_oe_to_smart() { export pkgs_to_install } +package_write_smart_config() { + # Write common configuration for host and target usage + smart --data-dir=$1/var/lib/smart config --set rpm-nolinktos=1 + smart --data-dir=$1/var/lib/smart config --set rpm-noparentdirs=1 + for i in ${BAD_RECOMMENDATIONS}; do + smart --data-dir=$1/var/lib/smart flag --set ignore-recommends $i + done +} # # Install a bunch of packages using rpm. @@ -345,10 +353,9 @@ EOF rm -rf ${target_rootfs}/var/lib/smart smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-root=${target_rootfs} smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-dbpath=${rpmlibdir} - smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-nolinktos=1 - smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-noparentdirs=1 smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-extra-macros._var=${localstatedir} smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-extra-macros._tmppath=/install/tmp + package_write_smart_config ${target_rootfs} # Optional debugging #smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-log-level=debug #smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-log-file=/tmp/smart-debug-logfile diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass index 1403422..c9650cb 100644 --- a/meta/classes/rootfs_ipk.bbclass +++ b/meta/classes/rootfs_ipk.bbclass @@ -21,8 +21,6 @@ OPKG_POSTPROCESS_COMMANDS = "ipk_insert_feed_uris; " OPKGLIBDIR = "${localstatedir}/lib" -# Which packages to not install on the basis of a recommendation -BAD_RECOMMENDATIONS ?= "" MULTILIBRE_ALLOW_REP = "${OPKGLIBDIR}/opkg" fakeroot rootfs_ipk_do_rootfs () { diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass index 1b09c8d..30b52d4 100644 --- a/meta/classes/rootfs_rpm.bbclass +++ b/meta/classes/rootfs_rpm.bbclass @@ -163,8 +163,7 @@ rpm_setup_smart_target_config() { # Set up smart configuration for the target rm -rf ${IMAGE_ROOTFS}/var/lib/smart smart --data-dir=${IMAGE_ROOTFS}/var/lib/smart channel --add rpmsys type=rpm-sys -y - smart --data-dir=${IMAGE_ROOTFS}/var/lib/smart config --set rpm-nolinktos=1 - smart --data-dir=${IMAGE_ROOTFS}/var/lib/smart config --set rpm-noparentdirs=1 + package_write_smart_config ${IMAGE_ROOTFS} rm -f ${IMAGE_ROOTFS}/var/lib/smart/config.old } diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index 62a3936..07eb473 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf @@ -753,6 +753,8 @@ COMBINED_FEATURES[vardeps] += "DISTRO_FEATURES MACHINE_FEATURES" SERIAL_CONSOLE ??= "" SERIAL_CONSOLES ??= "${@d.getVar('SERIAL_CONSOLE', True).replace(' ', ';')}" +BAD_RECOMMENDATIONS ?= "" + # Make sure MACHINE isn't exported # (breaks binutils at least) MACHINE[unexport] = "1" -- 2.7.4