* [PATCH v3 01/13] rootfs_rpm.bbclass: Revert to default shell logging behavior
2012-12-12 18:31 [PATCH v3 00/13] Smart package management integration Paul Eggleton
@ 2012-12-12 18:31 ` Paul Eggleton
2012-12-12 18:31 ` [PATCH v3 02/13] classes/*_rpm: integrate Smart into RPM filesystem construction Paul Eggleton
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Paul Eggleton @ 2012-12-12 18:31 UTC (permalink / raw)
To: openembedded-core
From: Mark Hatle <mark.hatle@windriver.com>
Remove the set +x, and revert to the normal logging behavior.
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
meta/classes/rootfs_rpm.bbclass | 2 --
1 file changed, 2 deletions(-)
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass
index c4fb470..2bb1b08 100644
--- a/meta/classes/rootfs_rpm.bbclass
+++ b/meta/classes/rootfs_rpm.bbclass
@@ -40,8 +40,6 @@ RPM="rpm ${RPMOPTS}"
do_rootfs[lockfiles] += "${DEPLOY_DIR_RPM}/rpm.lock"
fakeroot rootfs_rpm_do_rootfs () {
- set +x
-
${RPM_PREPROCESS_COMMANDS}
#createrepo "${DEPLOY_DIR_RPM}"
--
1.7.10.4
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH v3 02/13] classes/*_rpm: integrate Smart into RPM filesystem construction
2012-12-12 18:31 [PATCH v3 00/13] Smart package management integration Paul Eggleton
2012-12-12 18:31 ` [PATCH v3 01/13] rootfs_rpm.bbclass: Revert to default shell logging behavior Paul Eggleton
@ 2012-12-12 18:31 ` Paul Eggleton
2012-12-12 18:31 ` [PATCH v3 03/13] classes/rootfs_rpm: install smart instead of zypper in rpm-based images Paul Eggleton
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Paul Eggleton @ 2012-12-12 18:31 UTC (permalink / raw)
To: openembedded-core
Use Smart to construct the root filesystem for images and the contents
of SDKs rather than the custom scripts around rpm we had previously.
This ensures the result when producing an updated image will be the
same as upgrading to the same package versions from an older image on
the target, as well as allowing us to remove a substantial amount of
code making the rpm classes much easier to follow.
Some bugfixes from Bogdan Marinescu <bogdan.marinescu@intel.com>.
SDK implementation and testing as well as a number of bugfixes from
Mark Hatle <mark.hatle@windriver.com>.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
meta/classes/package_rpm.bbclass | 531 ++++++---------------------------
meta/classes/populate_sdk_rpm.bbclass | 51 +---
meta/classes/rootfs_rpm.bbclass | 34 ++-
3 files changed, 121 insertions(+), 495 deletions(-)
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 293c52c..4b81b68 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -16,88 +16,27 @@ python package_rpm_install () {
bb.fatal("package_rpm_install not implemented!")
}
-RPMCONF_TARGET_BASE = "${DEPLOY_DIR_RPM}/solvedb"
-RPMCONF_HOST_BASE = "${DEPLOY_DIR_RPM}/solvedb-sdk"
#
-# Update the Packages depsolver db in ${DEPLOY_DIR_RPM}
+# Update the packages indexes ${DEPLOY_DIR_RPM}
#
package_update_index_rpm () {
if [ ! -z "${DEPLOY_KEEP_PACKAGES}" -o ! -e "${DEPLOY_DIR_RPM}" ]; then
return
fi
- # Update target packages
base_archs="`echo ${PACKAGE_ARCHS} | sed 's/-/_/g'`"
ml_archs="`echo ${MULTILIB_PACKAGE_ARCHS} | sed 's/-/_/g'`"
- package_update_index_rpm_common "${RPMCONF_TARGET_BASE}" base_archs ml_archs
+ sdk_archs="`echo ${SDK_PACKAGE_ARCHS} | sed 's/-/_/g'`"
- # Update SDK packages
- base_archs="`echo ${SDK_PACKAGE_ARCHS} | sed 's/-/_/g'`"
- package_update_index_rpm_common "${RPMCONF_HOST_BASE}" base_archs
-}
-
-package_update_index_rpm_common () {
- rpmconf_base="$1"
- shift
-
- createdirs=""
- for archvar in "$@"; do
- eval archs=\${${archvar}}
- packagedirs=""
- for arch in $archs; do
- packagedirs="${DEPLOY_DIR_RPM}/$arch $packagedirs"
- rm -rf ${DEPLOY_DIR_RPM}/$arch/solvedb.done
- done
-
- cat /dev/null > ${rpmconf_base}-${archvar}.conf
- for pkgdir in $packagedirs; do
- if [ -e $pkgdir/ ]; then
- echo "Generating solve db for $pkgdir..."
- echo $pkgdir/solvedb >> ${rpmconf_base}-${archvar}.conf
- createdirs="$createdirs $pkgdir"
- fi
- done
- done
- rpm-createsolvedb.py "${RPM}" $createdirs
-}
-
-#
-# Generate an rpm configuration suitable for use against the
-# generated depsolver db's...
-#
-package_generate_rpm_conf () {
- # Update target packages
- package_generate_rpm_conf_common "${RPMCONF_TARGET_BASE}" base_archs ml_archs
-
- # Update SDK packages
- package_generate_rpm_conf_common "${RPMCONF_HOST_BASE}" base_archs
-}
-
-package_generate_rpm_conf_common() {
- rpmconf_base="$1"
- shift
+ archs=`for arch in $base_archs $ml_archs $sdk_archs ; do
+ echo $arch
+ done | sort | uniq`
- printf "_solve_dbpath " > ${rpmconf_base}.macro
- o_colon="false"
-
- for archvar in "$@"; do
- printf "_solve_dbpath " > ${rpmconf_base}-${archvar}.macro
- colon="false"
- for each in `cat ${rpmconf_base}-${archvar}.conf` ; do
- if [ "$o_colon" = "true" ]; then
- printf ":" >> ${rpmconf_base}.macro
- fi
- if [ "$colon" = "true" ]; then
- printf ":" >> ${rpmconf_base}-${archvar}.macro
- fi
- printf "%s" $each >> ${rpmconf_base}.macro
- o_colon="true"
- printf "%s" $each >> ${rpmconf_base}-${archvar}.macro
- colon="true"
- done
- printf "\n" >> ${rpmconf_base}-${archvar}.macro
+ for arch in $archs; do
+ if [ -d ${DEPLOY_DIR_RPM}/$arch ] ; then
+ createrepo --update -q ${DEPLOY_DIR_RPM}/$arch
+ fi
done
- printf "\n" >> ${rpmconf_base}.macro
}
rpm_log_check() {
@@ -122,150 +61,23 @@ rpm_log_check() {
#
-# Resolve package names to filepaths
-# resolve_pacakge <pkgname> <solvdb conffile>
-#
-resolve_package_rpm () {
- local conffile="$1"
- shift
- local pkg_name=""
- for solve in `cat ${conffile}`; do
- pkg_name=$(${RPM} -D "_dbpath $solve" -D "__dbi_txn create nofsync" -q --qf "%{packageorigin}\n" "$@" | grep -v "is not installed" || true)
- if [ -n "$pkg_name" -a "$pkg_name" != "(none)" ]; then
- echo $pkg_name
- break;
- fi
- done
-}
-
-# rpm common command and options
-rpm_common_comand () {
-
- local target_rootfs="${INSTALL_ROOTFS_RPM}"
-
- ${RPM} --root ${target_rootfs} \
- --predefine "_rpmds_sysinfo_path ${target_rootfs}/etc/rpm/sysinfo" \
- --predefine "_rpmrc_platform_path ${target_rootfs}/etc/rpm/platform" \
- -D "_var ${localstatedir}" \
- -D "_dbpath ${rpmlibdir}" \
- -D "_tmppath /install/tmp" \
- --noparentdirs --nolinktos \
- -D "__dbi_txn create nofsync private" \
- -D "_cross_scriptlet_wrapper ${WORKDIR}/scriptlet_wrapper" $@
-}
-
-# install or remove the pkg
-rpm_update_pkg () {
-
- manifest=$1
- # The manifest filename, e.g. total_solution.manifest
- m_name=${manifest##/*/}
- local target_rootfs="${INSTALL_ROOTFS_RPM}"
- installdir=$target_rootfs/install
- pre_btmanifest=$installdir/pre_bt.manifest
- cur_btmanifest=$installdir/cur_bt.manifest
-
- # Install/remove the different pkgs when total_solution.manifest is
- # comming and incremental image generation is enabled.
- if [ "${INC_RPM_IMAGE_GEN}" = "1" -a -d "${target_rootfs}${rpmlibdir}" \
- -a "$m_name" = "total_solution.manifest" \
- -a "${INSTALL_COMPLEMENTARY_RPM}" != "1" ]; then
- # Get the previous installed list
- rpm --root $target_rootfs --dbpath ${rpmlibdir} \
- -qa --qf '%{PACKAGEORIGIN} %{BUILDTIME}\n' | sort -u -o $pre_btmanifest
- # Get the current installed list (based on install/var/lib/rpm)
- rpm --root $installdir -D "_dbpath $installdir" \
- -qa --qf '%{PACKAGEORIGIN} %{BUILDTIME}\n' | sort -u -o $cur_btmanifest
- comm -1 -3 $cur_btmanifest $pre_btmanifest | sed 's#.*/\(.*\)\.rpm .*#\1#' > \
- $installdir/remove.manifest
- comm -2 -3 $cur_btmanifest $pre_btmanifest | awk '{print $1}' > \
- $installdir/incremental.manifest
-
- # Attempt to remove unwanted pkgs, the scripts(pre, post, etc.) has not
- # been run by now, so don't have to run them(preun, postun, etc.) when
- # erase the pkg
- if [ -s $installdir/remove.manifest ]; then
- rpm_common_comand --noscripts --nodeps \
- -e `cat $installdir/remove.manifest`
- fi
-
- # Attempt to install the incremental pkgs
- if [ -s $installdir/incremental.manifest ]; then
- rpm_common_comand --replacefiles --replacepkgs \
- -Uvh $installdir/incremental.manifest
- fi
- else
- # Attempt to install
- rpm_common_comand --replacepkgs -Uhv $manifest
- fi
-}
-
-process_pkg_list_rpm() {
- local insttype=$1
- shift
- # $@ is special POSIX linear array can not be assigned
- # to a local variable directly in dash since its separated by
- # space and dash expands it before assignment
- # and local x=1 2 3 and not x="1 2 3"
- local pkgs
- pkgs="$@"
- local confbase=${INSTALL_CONFBASE_RPM}
-
- printf "" > ${target_rootfs}/install/base_archs.pkglist
- printf "" > ${target_rootfs}/install/ml_archs.pkglist
-
- for pkg in $pkgs; do
- echo "Processing $pkg..."
-
- archvar=base_archs
- ml_pkg=$pkg
- for i in ${MULTILIB_PREFIX_LIST} ; do
- subst=${pkg#${i}-}
- if [ $subst != $pkg ] ; then
- ml_pkg=$subst
- archvar=ml_archs
- break
- fi
- done
-
- echo $ml_pkg >> ${target_rootfs}/install/$archvar.pkglist
- done
-
- local manifestpfx="install"
- local extraopt=""
- if [ "$insttype" = "attemptonly" ] ; then
- manifestpfx="install_attemptonly"
- extraopt="-i"
- fi
-
- rpmresolve $extraopt ${confbase}-base_archs.conf ${target_rootfs}/install/base_archs.pkglist -o ${target_rootfs}/install/${manifestpfx}.manifest
- if [ -s ${target_rootfs}/install/ml_archs.pkglist ] ; then
- rpmresolve $extraopt ${confbase}-ml_archs.conf ${target_rootfs}/install/ml_archs.pkglist -o ${target_rootfs}/install/${manifestpfx}_multilib.manifest
- fi
-}
-
-#
# Install a bunch of packages using rpm.
-# There are 3 solutions in an image's FRESH generation:
-# 1) initial_solution
-# 2) total_solution
-# 3) COMPLEMENTARY solution
+# There are two solutions in an image's FRESH generation:
+# 1) main package solution
+# 2) complementary solution
#
-# It is different when incremental image generation is enabled in the
-# SECOND generation:
-# 1) The initial_solution is skipped.
-# 2) The incremental image generation takes action during the total_solution
-# installation, the previous installed COMPLEMENTARY pkgs usually would be
-# removed here, the new COMPLEMENTARY ones would be installed in the next
-# step.
-# 3) The COMPLEMENTARY would always be installed since it is
-# generated based on the second step's image.
+# It is different when incremental image generation is enabled:
+# 1) The incremental image generation takes action during the main package
+# installation, the previous installed complementary packages would
+# usually be removed here, and the new complementary ones would be
+# installed in the next step.
+# 2) The complementary would always be installed since it is
+# generated based on the first step's image.
#
# the following shell variables needs to be set before calling this func:
# INSTALL_ROOTFS_RPM - install root dir
# INSTALL_PLATFORM_RPM - main platform
# INSTALL_PLATFORM_EXTRA_RPM - extra platform
-# INSTALL_CONFBASE_RPM - configuration file base name
# INSTALL_PACKAGES_RPM - packages to be installed
# INSTALL_PACKAGES_ATTEMPTONLY_RPM - packages attemped to be installed only
# INSTALL_PACKAGES_LINGUAS_RPM - additional packages for uclibc
@@ -275,15 +87,20 @@ process_pkg_list_rpm() {
package_install_internal_rpm () {
- local target_rootfs="${INSTALL_ROOTFS_RPM}"
- local platform="`echo ${INSTALL_PLATFORM_RPM} | sed 's#-#_#g'`"
- local platform_extra="`echo ${INSTALL_PLATFORM_EXTRA_RPM} | sed 's#-#_#g'`"
- local confbase="${INSTALL_CONFBASE_RPM}"
- local package_to_install="${INSTALL_PACKAGES_RPM}"
- local package_attemptonly="${INSTALL_PACKAGES_ATTEMPTONLY_RPM}"
- local package_linguas="${INSTALL_PACKAGES_LINGUAS_RPM}"
- local providename="${INSTALL_PROVIDENAME_RPM}"
- local task="${INSTALL_TASK_RPM}"
+ local target_rootfs="$INSTALL_ROOTFS_RPM"
+ local platform="`echo $INSTALL_PLATFORM_RPM | sed 's#-#_#g'`"
+ local platform_extra="`echo $INSTALL_PLATFORM_EXTRA_RPM | sed 's#-#_#g'`"
+ local package_to_install="$INSTALL_PACKAGES_RPM"
+ local package_attemptonly="$INSTALL_PACKAGES_ATTEMPTONLY_RPM"
+ local package_linguas="$INSTALL_PACKAGES_LINGUAS_RPM"
+ local providename="$INSTALL_PROVIDENAME_RPM"
+ local task="$INSTALL_TASK_RPM"
+
+ # Configure internal RPM environment when using Smart
+ export RPM_ETCRPM=${target_rootfs}/etc/rpm
+
+ # Setup temporary directory -- install...
+ mkdir -p ${target_rootfs}/install
if [ "${INSTALL_COMPLEMENTARY_RPM}" != "1" ] ; then
# Setup base system configuration
@@ -306,166 +123,74 @@ package_install_internal_rpm () {
# Tell RPM that the "/" directory exist and is available
mkdir -p ${target_rootfs}/etc/rpm/sysinfo
echo "/" >${target_rootfs}/etc/rpm/sysinfo/Dirnames
+
if [ ! -z "$providename" ]; then
cat /dev/null > ${target_rootfs}/etc/rpm/sysinfo/Providename
for provide in $providename ; do
echo $provide >> ${target_rootfs}/etc/rpm/sysinfo/Providename
done
fi
- else
- # We may run through the complementary installs multiple times. For each time
- # we should add the previous solution manifest to the full "original" set to
- # avoid duplicate install steps.
- echo "Update original solution..."
- for m in ${target_rootfs}/install/initial_solution.manifest \
- ${target_rootfs}/install/total_solution.manifest; do
- if [ -s $m ]; then
- cat $m >> ${target_rootfs}/install/original_solution.manifest
- rm -f $m
- fi
- done
- sort -u ${target_rootfs}/install/original_solution.manifest -o ${target_rootfs}/install/original_solution.manifest.new
- mv ${target_rootfs}/install/original_solution.manifest.new ${target_rootfs}/install/original_solution.manifest
- fi
- # Setup manifest of packages to install...
- mkdir -p ${target_rootfs}/install
- rm -f ${target_rootfs}/install/install.manifest
- rm -f ${target_rootfs}/install/install_multilib.manifest
- rm -f ${target_rootfs}/install/install_attemptonly.manifest
+ # Configure RPM... we enforce these settings!
+ mkdir -p ${target_rootfs}${rpmlibdir}
+ mkdir -p ${target_rootfs}${rpmlibdir}/log
+ # After change the __db.* cache size, log file will not be generated automatically,
+ # that will raise some warnings, so touch a bare log for rpm write into it.
+ touch ${target_rootfs}${rpmlibdir}/log/log.0000000001
+ if [ ! -e ${target_rootfs}${rpmlibdir}/DB_CONFIG ]; then
+ cat > ${target_rootfs}${rpmlibdir}/DB_CONFIG << EOF
+# ================ Environment
+set_data_dir .
+set_create_dir .
+set_lg_dir ./log
+set_tmp_dir ./tmp
+set_flags db_log_autoremove on
- # Uclibc builds don't provide this stuff...
- if [ x${TARGET_OS} = "xlinux" ] || [ x${TARGET_OS} = "xlinux-gnueabi" ] ; then
- if [ ! -z "${package_linguas}" ]; then
- process_pkg_list_rpm linguas ${package_linguas}
- fi
- fi
+# -- thread_count must be >= 8
+set_thread_count 64
- if [ ! -z "${package_to_install}" ]; then
- process_pkg_list_rpm default ${package_to_install}
- fi
+# ================ Logging
- # Normal package installation
-
- # Generate an install solution by doing a --justdb install, then recreate it with
- # an actual package install!
- if [ -s ${target_rootfs}/install/install.manifest ]; then
- echo "# Install manifest padding" >> ${target_rootfs}/install/install.manifest
- ${RPM} --predefine "_rpmds_sysinfo_path ${target_rootfs}/etc/rpm/sysinfo" \
- --predefine "_rpmrc_platform_path ${target_rootfs}/etc/rpm/platform" \
- --root "${target_rootfs}/install" \
- -D "_dbpath ${target_rootfs}/install" -D "`cat ${confbase}-base_archs.macro`" \
- -D "__dbi_txn create nofsync" \
- -U --justdb --replacepkgs --noscripts --notriggers --noparentdirs --nolinktos --ignoresize \
- ${target_rootfs}/install/install.manifest
- fi
+# ================ Memory Pool
+set_cachesize 0 1048576 0
+set_mp_mmapsize 268435456
- if [ ! -z "${package_attemptonly}" ]; then
- echo "Adding attempt only packages..."
- process_pkg_list_rpm attemptonly ${package_attemptonly}
- cat ${target_rootfs}/install/install_attemptonly.manifest | while read pkg_name
- do
- echo "Attempting $pkg_name..." >> "`dirname ${BB_LOGFILE}`/log.do_${task}_attemptonly.${PID}"
- ${RPM} --predefine "_rpmds_sysinfo_path ${target_rootfs}/etc/rpm/sysinfo" \
- --predefine "_rpmrc_platform_path ${target_rootfs}/etc/rpm/platform" \
- --root "${target_rootfs}/install" \
- -D "_dbpath ${target_rootfs}/install" -D "`cat ${confbase}.macro`" \
- -D "__dbi_txn create nofsync private" \
- -U --justdb --replacepkgs --noscripts --notriggers --noparentdirs --nolinktos --ignoresize \
- $pkg_name >> "`dirname ${BB_LOGFILE}`/log.do_${task}_attemptonly.${PID}" 2>&1 || true
- done
- fi
+# ================ Locking
+set_lk_max_locks 16384
+set_lk_max_lockers 16384
+set_lk_max_objects 16384
+ mutex_set_max 163840
- #### Note: 'Recommends' is an arbitrary tag that means _SUGGESTS_ in OE-core..
- # Add any recommended packages to the image
- # RPM does not solve for recommended packages because they are optional...
- # So we query them and tree them like the ATTEMPTONLY packages above...
- # Change the loop to "1" to run this code...
- loop=0
- if [ $loop -eq 1 ]; then
- echo "Processing recommended packages..."
- cat /dev/null > ${target_rootfs}/install/recommend.list
- while [ $loop -eq 1 ]; do
- # Dump the full set of recommends...
- ${RPM} --predefine "_rpmds_sysinfo_path ${target_rootfs}/etc/rpm/sysinfo" \
- --predefine "_rpmrc_platform_path ${target_rootfs}/etc/rpm/platform" \
- --root "${target_rootfs}/install" \
- -D "_dbpath ${target_rootfs}/install" -D "`cat ${confbase}.macro`" \
- -D "__dbi_txn create nofsync private" \
- -qa --qf "[%{RECOMMENDS}\n]" | sort -u > ${target_rootfs}/install/recommend
- # Did we add more to the list?
- grep -v -x -F -f ${target_rootfs}/install/recommend.list ${target_rootfs}/install/recommend > ${target_rootfs}/install/recommend.new || true
- # We don't want to loop unless there is a change to the list!
- loop=0
- cat ${target_rootfs}/install/recommend.new | \
- while read pkg ; do
- # Ohh there was a new one, we'll need to loop again...
- loop=1
- echo "Processing $pkg..."
- found=0
- for archvar in base_archs ml_archs ; do
- pkg_name=$(resolve_package_rpm ${confbase}-${archvar}.conf ${pkg})
- if [ -n "$pkg_name" ]; then
- found=1
- break
- fi
- done
+# ================ Replication
+EOF
+ fi
- if [ $found -eq 0 ]; then
- echo "Note: Unable to find package $pkg -- suggests"
- echo "Unable to find package $pkg." >> "`dirname ${BB_LOGFILE}`/log.do_${task}_recommend.${PID}"
- continue
+ # Create database so that smart doesn't complain (lazy init)
+ rpm --root $target_rootfs --dbpath /var/lib/rpm -qa > /dev/null
+
+ # Configure smart
+ 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
+ smart --data-dir=${target_rootfs}/var/lib/smart channel --add rpmsys type=rpm-sys -y
+
+ for arch in $platform_extra ; do
+ if [ -d ${DEPLOY_DIR_RPM}/$arch -a ! -e ${target_rootfs}/install/channel.$arch.stamp ] ; then
+ smart --data-dir=${target_rootfs}/var/lib/smart channel --add $arch type=rpm-md type=rpm-md baseurl=${DEPLOY_DIR_RPM}/$arch -y
+ touch ${target_rootfs}/install/channel.$arch.stamp
fi
- echo "Attempting $pkg_name..." >> "`dirname ${BB_LOGFILE}`/log.do_{task}_recommend.${PID}"
- ${RPM} --predefine "_rpmds_sysinfo_path ${target_rootfs}/etc/rpm/sysinfo" \
- --predefine "_rpmrc_platform_path ${target_rootfs}/etc/rpm/platform" \
- --root "${target_rootfs}/install" \
- -D "_dbpath ${target_rootfs}/install" -D "`cat ${confbase}.macro`" \
- -D "__dbi_txn create nofsync private" \
- -U --justdb --replacepkgs --noscripts --notriggers --noparentdirs --nolinktos --ignoresize \
- $pkg_name >> "`dirname ${BB_LOGFILE}`/log.do_${task}_recommend.${PID}" 2>&1 || true
done
- cat ${target_rootfs}/install/recommend.list ${target_rootfs}/install/recommend.new | sort -u > ${target_rootfs}/install/recommend.new.list
- mv -f ${target_rootfs}/install/recommend.new.list ${target_rootfs}/install/recommend.list
- rm ${target_rootfs}/install/recommend ${target_rootfs}/install/recommend.new
- done
fi
- # Now that we have a solution, pull out a list of what to install...
- echo "Manifest: ${target_rootfs}/install/install_solution.manifest"
- ${RPM} -D "_dbpath ${target_rootfs}/install" -qa --qf "%{packageorigin}\n" \
- --root "${target_rootfs}/install" \
- -D "__dbi_txn create nofsync private" \
- > ${target_rootfs}/install/install_solution.manifest
-
- touch ${target_rootfs}/install/install_multilib_solution.manifest
-
- if [ -s "${target_rootfs}/install/install_multilib.manifest" ]; then
- # multilib package installation
- echo "# Install multilib manifest padding" >> ${target_rootfs}/install/install_multilib.manifest
-
- # Generate an install solution by doing a --justdb install, then recreate it with
- # an actual package install!
- ${RPM} --predefine "_rpmds_sysinfo_path ${target_rootfs}/etc/rpm/sysinfo" \
- --predefine "_rpmrc_platform_path ${target_rootfs}/etc/rpm/platform" \
- --root "${target_rootfs}/install" \
- -D "_dbpath ${target_rootfs}/install" -D "`cat ${confbase}-ml_archs.macro`" \
- -D "__dbi_txn create nofsync" \
- -U --justdb --replacepkgs --noscripts --notriggers --noparentdirs --nolinktos --ignoresize \
- ${target_rootfs}/install/install_multilib.manifest
-
- # Now that we have a solution, pull out a list of what to install...
- echo "Manifest: ${target_rootfs}/install/install_multilib.manifest"
- ${RPM} -D "_dbpath ${target_rootfs}/install" -qa --qf "%{packageorigin}\n" \
- --root "${target_rootfs}/install" \
- -D "__dbi_txn create nofsync private" \
- > ${target_rootfs}/install/install_multilib_solution.manifest
-
+ # Uclibc builds don't provide this stuff...
+ if [ x${TARGET_OS} != "xlinux" ] && [ x${TARGET_OS} != "xlinux-gnueabi" ] ; then
+ package_linguas=""
fi
- cat ${target_rootfs}/install/install_solution.manifest \
- ${target_rootfs}/install/install_multilib_solution.manifest | sort -u > ${target_rootfs}/install/total_solution.manifest
-
# Construct install scriptlet wrapper
cat << EOF > ${WORKDIR}/scriptlet_wrapper
#!/bin/bash
@@ -491,93 +216,17 @@ fi
EOF
chmod 0755 ${WORKDIR}/scriptlet_wrapper
+ smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-extra-macros._cross_scriptlet_wrapper=${WORKDIR}/scriptlet_wrapper
- # Configure RPM... we enforce these settings!
- mkdir -p ${target_rootfs}${rpmlibdir}
- mkdir -p ${target_rootfs}${rpmlibdir}/log
- # After change the __db.* cache size, log file will not be generated automatically,
- # that will raise some warnings, so touch a bare log for rpm write into it.
- touch ${target_rootfs}${rpmlibdir}/log/log.0000000001
- cat > ${target_rootfs}${rpmlibdir}/DB_CONFIG << EOF
-# ================ Environment
-set_data_dir .
-set_create_dir .
-set_lg_dir ./log
-set_tmp_dir ./tmp
-set_flags db_log_autoremove on
-
-# -- thread_count must be >= 8
-set_thread_count 64
-
-# ================ Logging
+ smart --data-dir=${target_rootfs}/var/lib/smart install -y ${package_to_install} ${package_linguas}
-# ================ Memory Pool
-set_cachesize 0 1048576 0
-set_mp_mmapsize 268435456
-
-# ================ Locking
-set_lk_max_locks 16384
-set_lk_max_lockers 16384
-set_lk_max_objects 16384
-mutex_set_max 163840
-
-# ================ Replication
-EOF
-
- if [ "${INSTALL_COMPLEMENTARY_RPM}" = "1" ] ; then
- # Only install packages not already installed (dependency calculation will
- # almost certainly have added some that have been)
- sort -u ${target_rootfs}/install/original_solution.manifest > ${target_rootfs}/install/original_solution_sorted.manifest
- sort -u ${target_rootfs}/install/total_solution.manifest > ${target_rootfs}/install/total_solution_sorted.manifest
- comm -2 -3 ${target_rootfs}/install/total_solution_sorted.manifest \
- ${target_rootfs}/install/original_solution_sorted.manifest > \
- ${target_rootfs}/install/diff.manifest
- mv ${target_rootfs}/install/diff.manifest ${target_rootfs}/install/total_solution.manifest
- elif [ "${INC_RPM_IMAGE_GEN}" = "1" -a -f "${target_rootfs}/etc/passwd" ]; then
- echo "Skipping pre install due to existing image"
- else
- # RPM is special. It can't handle dependencies and preinstall scripts correctly. Its
- # probably a feature. The only way to convince rpm to actually run the preinstall scripts
- # for base-passwd and shadow first before installing packages that depend on these packages
- # is to do two image installs, installing one set of packages, then the other.
- rm -f ${target_rootfs}/install/initial_install.manifest
- echo "Installing base dependencies first (base-passwd, base-files and shadow) since rpm is special"
- grep /base-passwd-[0-9] ${target_rootfs}/install/total_solution.manifest >> ${target_rootfs}/install/initial_install.manifest || true
- grep /base-files-[0-9] ${target_rootfs}/install/total_solution.manifest >> ${target_rootfs}/install/initial_install.manifest || true
- grep /shadow-[0-9] ${target_rootfs}/install/total_solution.manifest >> ${target_rootfs}/install/initial_install.manifest || true
-
- if [ -s ${target_rootfs}/install/initial_install.manifest ]; then
- echo "# Initial Install manifest padding..." >> ${target_rootfs}/install/initial_install.manifest
-
- # Generate an install solution by doing a --justdb install, then recreate it with
- # an actual package install!
- mkdir -p ${target_rootfs}/initial
-
- ${RPM} --predefine "_rpmds_sysinfo_path ${target_rootfs}/etc/rpm/sysinfo" \
- --predefine "_rpmrc_platform_path ${target_rootfs}/etc/rpm/platform" \
- --root "${target_rootfs}/install" \
- -D "_dbpath ${target_rootfs}/initial" -D "`cat ${confbase}.macro`" \
- -D "__dbi_txn create nofsync" \
- -U --justdb --replacepkgs --noscripts --notriggers --noparentdirs --nolinktos --ignoresize \
- ${target_rootfs}/install/initial_install.manifest
-
- ${RPM} -D "_dbpath ${target_rootfs}/initial" -qa --qf "%{packageorigin}\n" \
- -D "__dbi_txn create nofsync private" \
- --root "${target_rootfs}/install" \
- > ${target_rootfs}/install/initial_solution.manifest
-
- rpm_update_pkg ${target_rootfs}/install/initial_solution.manifest
-
- grep -Fv -f ${target_rootfs}/install/initial_solution.manifest ${target_rootfs}/install/total_solution.manifest > ${target_rootfs}/install/total_solution.manifest.new
- mv ${target_rootfs}/install/total_solution.manifest.new ${target_rootfs}/install/total_solution.manifest
-
- rm -rf ${target_rootfs}/initial
- fi
+ if [ ! -z "${package_attemptonly}" ]; then
+ echo "Installing attempt only packages..."
+ for pkg_name in ${package_attemptonly} ; do
+ echo "Attempting $pkg_name..." >> "`dirname ${BB_LOGFILE}`/log.do_${task}_attemptonly.${PID}"
+ smart --data-dir=${target_rootfs}/var/lib/smart install -y $pkg_name >> "`dirname ${BB_LOGFILE}`/log.do_${task}_attemptonly.${PID}" 2>&1 || true
+ done
fi
-
- echo "Installing main solution manifest (${target_rootfs}/install/total_solution.manifest)"
-
- rpm_update_pkg ${target_rootfs}/install/total_solution.manifest
}
python write_specfile () {
diff --git a/meta/classes/populate_sdk_rpm.bbclass b/meta/classes/populate_sdk_rpm.bbclass
index 1c54049..1d6b1be 100644
--- a/meta/classes/populate_sdk_rpm.bbclass
+++ b/meta/classes/populate_sdk_rpm.bbclass
@@ -1,10 +1,20 @@
+# Smart is python based, so be sure python-native is available to us.
+EXTRANATIVEPATH += "python-native"
+
do_populate_sdk[depends] += "rpm-native:do_populate_sysroot"
do_populate_sdk[depends] += "rpmresolve-native:do_populate_sysroot"
+do_populate_sdk[depends] += "python-smartpm-native:do_populate_sysroot"
+
+# Needed for update-alternatives
+do_populate_sdk[depends] += "opkg-native:do_populate_sysroot"
+
+# Creating the repo info in do_rootfs
do_populate_sdk[depends] += "createrepo-native:do_populate_sysroot"
+
do_populate_sdk[recrdeptask] += "do_package_write_rpm"
rpmlibdir = "/var/lib/rpm"
-RPMOPTS="--dbpath ${rpmlibdir} --define='_openall_before_chroot 1'"
+RPMOPTS="--dbpath ${rpmlibdir}"
RPM="rpm ${RPMOPTS}"
do_populate_sdk[lockfiles] += "${DEPLOY_DIR_RPM}/rpm.lock"
@@ -16,58 +26,29 @@ populate_sdk_post_rpm () {
# remove lock files
rm -f ${target_rootfs}/__db.*
- # Move manifests into the directory with the logs
- mv ${target_rootfs}/install/*.manifest ${T}/
-
# Remove all remaining resolver files
rm -rf ${target_rootfs}/install
+ rm -rf ${target_rootfs}/var/lib/smart
}
populate_sdk_rpm () {
package_update_index_rpm
- package_generate_rpm_conf
## install target ##
# This needs to work in the same way as rootfs_rpm.bbclass!
#
export INSTALL_ROOTFS_RPM="${SDK_OUTPUT}/${SDKTARGETSYSROOT}"
export INSTALL_PLATFORM_RPM="${TARGET_ARCH}"
- export INSTALL_CONFBASE_RPM="${RPMCONF_TARGET_BASE}"
export INSTALL_PACKAGES_RPM="${TOOLCHAIN_TARGET_TASK}"
export INSTALL_PACKAGES_ATTEMPTONLY_RPM="${TOOLCHAIN_TARGET_TASK_ATTEMPTONLY}"
export INSTALL_PACKAGES_LINGUAS_RPM=""
- export INSTALL_PROVIDENAME_RPM="/bin/sh /bin/bash /usr/bin/env /usr/bin/perl pkgconfig pkgconfig(pkg-config)"
+ export INSTALL_PROVIDENAME_RPM=""
export INSTALL_TASK_RPM="populate_sdk-target"
export INSTALL_COMPLEMENTARY_RPM=""
# Setup base system configuration
mkdir -p ${INSTALL_ROOTFS_RPM}/etc/rpm/
- mkdir -p ${INSTALL_ROOTFS_RPM}${rpmlibdir}
- mkdir -p ${INSTALL_ROOTFS_RPM}${rpmlibdir}/log
- cat > ${INSTALL_ROOTFS_RPM}${rpmlibdir}/DB_CONFIG << EOF
-# ================ Environment
-set_data_dir .
-set_create_dir .
-set_lg_dir ./log
-set_tmp_dir ./tmp
-
-# -- thread_count must be >= 8
-set_thread_count 64
-
-# ================ Logging
-
-# ================ Memory Pool
-set_mp_mmapsize 268435456
-
-# ================ Locking
-set_lk_max_locks 16384
-set_lk_max_lockers 16384
-set_lk_max_objects 16384
-mutex_set_max 163840
-
-# ================ Replication
-EOF
# List must be prefered to least preferred order
INSTALL_PLATFORM_EXTRA_RPM=""
@@ -84,7 +65,6 @@ EOF
echo "Installing NATIVESDK packages"
export INSTALL_ROOTFS_RPM="${SDK_OUTPUT}"
export INSTALL_PLATFORM_RPM="${SDK_ARCH}"
- export INSTALL_CONFBASE_RPM="${RPMCONF_HOST_BASE}"
export INSTALL_PACKAGES_RPM="${TOOLCHAIN_HOST_TASK}"
export INSTALL_PACKAGES_ATTEMPTONLY_RPM="${TOOLCHAIN_TARGET_HOST_ATTEMPTONLY}"
export INSTALL_PACKAGES_LINGUAS_RPM=""
@@ -112,11 +92,6 @@ EOF
rm -rf ${SDK_OUTPUT}/etc
populate_sdk_log_check populate_sdk
-
- # Workaround so the parser knows we need the resolve_package function!
- if false ; then
- resolve_package_rpm foo ${RPMCONF_TARGET_BASE}.conf || true
- fi
}
python () {
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass
index 2bb1b08..d0b0d57 100644
--- a/meta/classes/rootfs_rpm.bbclass
+++ b/meta/classes/rootfs_rpm.bbclass
@@ -7,11 +7,15 @@ ROOTFS_PKGMANAGE = "rpm zypper"
# Add 50Meg of extra space for zypper database space
IMAGE_ROOTFS_EXTRA_SPACE_append = "${@base_contains("PACKAGE_INSTALL", "zypper", " + 51200", "" ,d)}"
+# Smart is python based, so be sure python-native is available to us.
+EXTRANATIVEPATH += "python-native"
+
# Postinstalls on device are handled within this class at present
ROOTFS_PKGMANAGE_BOOTSTRAP = ""
do_rootfs[depends] += "rpm-native:do_populate_sysroot"
do_rootfs[depends] += "rpmresolve-native:do_populate_sysroot"
+do_rootfs[depends] += "python-smartpm-native:do_populate_sysroot"
# Needed for update-alternatives
do_rootfs[depends] += "opkg-native:do_populate_sysroot"
@@ -21,8 +25,8 @@ do_rootfs[depends] += "createrepo-native:do_populate_sysroot"
do_rootfs[recrdeptask] += "do_package_write_rpm"
-RPM_PREPROCESS_COMMANDS = "package_update_index_rpm; package_generate_rpm_conf; "
-RPM_POSTPROCESS_COMMANDS = ""
+RPM_PREPROCESS_COMMANDS = "package_update_index_rpm; "
+RPM_POSTPROCESS_COMMANDS = "rpm_setup_smart_target_config; "
#
# Allow distributions to alter when [postponed] package install scripts are run
@@ -32,7 +36,7 @@ POSTINSTALL_INITPOSITION ?= "98"
rpmlibdir = "/var/lib/rpm"
opkglibdir = "${localstatedir}/lib/opkg"
-RPMOPTS="--dbpath ${rpmlibdir} --define='_openall_before_chroot 1'"
+RPMOPTS="--dbpath ${rpmlibdir}"
RPM="rpm ${RPMOPTS}"
# RPM doesn't work with multiple rootfs generation at once due to collisions in the use of files
@@ -42,13 +46,10 @@ do_rootfs[lockfiles] += "${DEPLOY_DIR_RPM}/rpm.lock"
fakeroot rootfs_rpm_do_rootfs () {
${RPM_PREPROCESS_COMMANDS}
- #createrepo "${DEPLOY_DIR_RPM}"
-
# install packages
# This needs to work in the same way as populate_sdk_rpm.bbclass!
export INSTALL_ROOTFS_RPM="${IMAGE_ROOTFS}"
export INSTALL_PLATFORM_RPM="${TARGET_ARCH}"
- export INSTALL_CONFBASE_RPM="${RPMCONF_TARGET_BASE}"
export INSTALL_PACKAGES_RPM="${PACKAGE_INSTALL}"
export INSTALL_PACKAGES_ATTEMPTONLY_RPM="${PACKAGE_INSTALL_ATTEMPTONLY}"
export INSTALL_PACKAGES_LINGUAS_RPM="${LINGUAS_INSTALL}"
@@ -114,18 +115,10 @@ EOF
# remove lock files
rm -f ${IMAGE_ROOTFS}${rpmlibdir}/__db.*
- # Move manifests into the directory with the logs
- mv ${IMAGE_ROOTFS}/install/*.manifest ${T}/
-
# Remove all remaining resolver files
rm -rf ${IMAGE_ROOTFS}/install
log_check rootfs
-
- # Workaround so the parser knows we need the resolve_package function!
- if false ; then
- resolve_package_rpm foo ${RPMCONF_TARGET_BASE}.conf || true
- fi
}
remove_packaging_data_files() {
@@ -135,10 +128,19 @@ remove_packaging_data_files() {
mkdir -p $t
mv ${IMAGE_ROOTFS}${rpmlibdir} $t
rm -rf ${IMAGE_ROOTFS}${opkglibdir}
+ rm -rf ${IMAGE_ROOTFS}/var/lib/smart
+}
+
+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
+ rm -f ${IMAGE_ROOTFS}/var/lib/smart/config.old
}
-RPM_QUERY_CMD = '${RPM} --root $INSTALL_ROOTFS_RPM -D "_dbpath ${rpmlibdir}" \
- -D "__dbi_txn create nofsync private"'
+RPM_QUERY_CMD = '${RPM} --root $INSTALL_ROOTFS_RPM -D "_dbpath ${rpmlibdir}"'
list_installed_packages() {
GET_LIST=$(${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{ARCH} %{PACKAGEORIGIN} %{Platform}\n]")
--
1.7.10.4
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH v3 03/13] classes/rootfs_rpm: install smart instead of zypper in rpm-based images
2012-12-12 18:31 [PATCH v3 00/13] Smart package management integration Paul Eggleton
2012-12-12 18:31 ` [PATCH v3 01/13] rootfs_rpm.bbclass: Revert to default shell logging behavior Paul Eggleton
2012-12-12 18:31 ` [PATCH v3 02/13] classes/*_rpm: integrate Smart into RPM filesystem construction Paul Eggleton
@ 2012-12-12 18:31 ` Paul Eggleton
2012-12-12 18:31 ` [PATCH v3 04/13] Update sanity tests to use smart instead of zypper Paul Eggleton
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Paul Eggleton @ 2012-12-12 18:31 UTC (permalink / raw)
To: openembedded-core
Switch over to smart on the target when package-management is enabled.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
meta/classes/rootfs_rpm.bbclass | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass
index d0b0d57..a507ad6 100644
--- a/meta/classes/rootfs_rpm.bbclass
+++ b/meta/classes/rootfs_rpm.bbclass
@@ -2,10 +2,10 @@
# Creates a root filesystem out of rpm packages
#
-ROOTFS_PKGMANAGE = "rpm zypper"
+ROOTFS_PKGMANAGE = "rpm smartpm"
-# Add 50Meg of extra space for zypper database space
-IMAGE_ROOTFS_EXTRA_SPACE_append = "${@base_contains("PACKAGE_INSTALL", "zypper", " + 51200", "" ,d)}"
+# Add 50Meg of extra space for Smart
+IMAGE_ROOTFS_EXTRA_SPACE_append = "${@base_contains("PACKAGE_INSTALL", "smartpm", " + 51200", "" ,d)}"
# Smart is python based, so be sure python-native is available to us.
EXTRANATIVEPATH += "python-native"
--
1.7.10.4
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH v3 04/13] Update sanity tests to use smart instead of zypper
2012-12-12 18:31 [PATCH v3 00/13] Smart package management integration Paul Eggleton
` (2 preceding siblings ...)
2012-12-12 18:31 ` [PATCH v3 03/13] classes/rootfs_rpm: install smart instead of zypper in rpm-based images Paul Eggleton
@ 2012-12-12 18:31 ` Paul Eggleton
2012-12-12 18:31 ` [PATCH v3 05/13] package_rpm: Update the way the multilib package names are translated Paul Eggleton
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Paul Eggleton @ 2012-12-12 18:31 UTC (permalink / raw)
To: openembedded-core
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
meta/classes/imagetest-qemu.bbclass | 6 ++---
.../sanity/{zypper_help => smart_help} | 24 ++++++++++----------
.../sanity/{zypper_search => smart_query} | 24 ++++++++++----------
.../scenario/qemuarm/core-image-lsb | 4 ++--
.../scenario/qemuarm/core-image-sato | 4 ++--
.../scenario/qemuarm/core-image-sato-sdk | 4 ++--
.../scenario/qemumips/core-image-lsb | 4 ++--
.../scenario/qemumips/core-image-sato | 4 ++--
.../scenario/qemumips/core-image-sato-sdk | 4 ++--
.../scenario/qemuppc/core-image-lsb | 4 ++--
.../scenario/qemuppc/core-image-sato | 4 ++--
.../scenario/qemuppc/core-image-sato-sdk | 4 ++--
.../scenario/qemux86-64/core-image-lsb | 4 ++--
.../scenario/qemux86-64/core-image-sato | 4 ++--
.../scenario/qemux86-64/core-image-sato-sdk | 4 ++--
.../scenario/qemux86/core-image-lsb | 4 ++--
.../scenario/qemux86/core-image-sato | 4 ++--
.../scenario/qemux86/core-image-sato-sdk | 4 ++--
.../tools/{zypper_test.sh => smart_test.sh} | 22 +++++++++---------
19 files changed, 68 insertions(+), 68 deletions(-)
rename scripts/qemuimage-tests/sanity/{zypper_help => smart_help} (52%)
rename scripts/qemuimage-tests/sanity/{zypper_search => smart_query} (50%)
rename scripts/qemuimage-tests/tools/{zypper_test.sh => smart_test.sh} (46%)
diff --git a/meta/classes/imagetest-qemu.bbclass b/meta/classes/imagetest-qemu.bbclass
index ce20164..06ba3e3 100644
--- a/meta/classes/imagetest-qemu.bbclass
+++ b/meta/classes/imagetest-qemu.bbclass
@@ -86,10 +86,10 @@ def qemuimagetest_main(d):
for test in list:
(scen, case, fullpath) = test
- """Skip rpm/zypper if package_rpm not set for PACKAGE_CLASSES"""
- if case.find("zypper") != -1 or case.find("rpm") != -1:
+ """Skip rpm/smart if package_rpm not set for PACKAGE_CLASSES"""
+ if case.find("smart") != -1 or case.find("rpm") != -1:
if d.getVar("PACKAGE_CLASSES", True).find("rpm", 0, 11) == -1:
- bb.note("skip rpm/zypper cases since package_rpm not set in PACKAGE_CLASSES")
+ bb.note("skip rpm/smart cases since package_rpm not set in PACKAGE_CLASSES")
continue
else:
final_list.append((scen, case, fullpath))
diff --git a/scripts/qemuimage-tests/sanity/zypper_help b/scripts/qemuimage-tests/sanity/smart_help
similarity index 52%
rename from scripts/qemuimage-tests/sanity/zypper_help
rename to scripts/qemuimage-tests/sanity/smart_help
index 94f82c4..0eeac26 100755
--- a/scripts/qemuimage-tests/sanity/zypper_help
+++ b/scripts/qemuimage-tests/sanity/smart_help
@@ -1,7 +1,7 @@
#!/bin/bash
-# Zypper Check Test Case for Sanity Test
+# Smart Check Test Case for Sanity Test
# The case boot up the Qemu target with `runqemu qemuxxx`.
-# Then check if zypper command can work in target.
+# Then check if smart command can work in target.
#
# Author: Jiajun Xu <jiajun.xu@intel.com>
#
@@ -26,13 +26,13 @@ else
RET=1
fi
-# Check if zypper help can work in target
-if [ $RET -eq 0 -a -f $TOOLS/zypper_test.sh ]; then
- # Copy zypper_test.sh into target
- Test_Target_Pre ${TARGET_IPADDR} $TOOLS/zypper_test.sh
+# Check if smart --help can work in target
+if [ $RET -eq 0 -a -f $TOOLS/smart_test.sh ]; then
+ # Copy smart_test.sh into target
+ Test_Target_Pre ${TARGET_IPADDR} $TOOLS/smart_test.sh
if [ $? -eq 0 ]; then
- # Run zypper_test.sh to check if zypper help can work in target
- Test_SSH ${TARGET_IPADDR} "sh $TARGET_TEST_DIR/zypper_test.sh help"
+ # Run smart_test.sh to check if smart --help can work in target
+ Test_SSH ${TARGET_IPADDR} "sh $TARGET_TEST_DIR/smart_test.sh --help"
RET=$?
else
RET=1
@@ -40,13 +40,13 @@ if [ $RET -eq 0 -a -f $TOOLS/zypper_test.sh ]; then
fi
if [ ${RET} -eq 0 ]; then
- Test_Info "zypper help Test PASS"
+ Test_Info "smart --help Test PASS"
Test_Kill_Qemu
- Test_Print_Result "zypper_help" 0
+ Test_Print_Result "smart_help" 0
exit 0
else
- Test_Info "zypper help FAIL, Pls. check above error log"
+ Test_Info "smart --help FAIL, Pls. check above error log"
Test_Kill_Qemu
- Test_Print_Result "zypper_help" 1
+ Test_Print_Result "smart_help" 1
exit 1
fi
diff --git a/scripts/qemuimage-tests/sanity/zypper_search b/scripts/qemuimage-tests/sanity/smart_query
similarity index 50%
rename from scripts/qemuimage-tests/sanity/zypper_search
rename to scripts/qemuimage-tests/sanity/smart_query
index e687ead..779ee63 100755
--- a/scripts/qemuimage-tests/sanity/zypper_search
+++ b/scripts/qemuimage-tests/sanity/smart_query
@@ -1,7 +1,7 @@
#!/bin/bash
-# Zypper Check Test Case for Sanity Test
+# Smart Check Test Case for Sanity Test
# The case boot up the Qemu target with `runqemu qemuxxx`.
-# Then check if zypper command can work in target.
+# Then check if smart command can work in target.
#
# Author: Jiajun Xu <jiajun.xu@intel.com>
#
@@ -26,13 +26,13 @@ else
RET=1
fi
-# Check if zypper search can work in target
-if [ $RET -eq 0 -a -f $TOOLS/zypper_test.sh ]; then
- # Copy zypper_test.sh into target
- Test_Target_Pre ${TARGET_IPADDR} $TOOLS/zypper_test.sh
+# Check if smart query can work in target
+if [ $RET -eq 0 -a -f $TOOLS/smart_test.sh ]; then
+ # Copy smart_test.sh into target
+ Test_Target_Pre ${TARGET_IPADDR} $TOOLS/smart_test.sh
if [ $? -eq 0 ]; then
- # Run zypper_test.sh to check if zypper search can work in target
- Test_SSH ${TARGET_IPADDR} "sh $TARGET_TEST_DIR/zypper_test.sh search avahi"
+ # Run smart_test.sh to check if smart query can work in target
+ Test_SSH ${TARGET_IPADDR} "sh $TARGET_TEST_DIR/smart_test.sh query avahi*"
RET=$?
else
RET=1
@@ -40,13 +40,13 @@ if [ $RET -eq 0 -a -f $TOOLS/zypper_test.sh ]; then
fi
if [ ${RET} -eq 0 ]; then
- Test_Info "zypper search package avahi Test PASS"
+ Test_Info "smart query package avahi Test PASS"
Test_Kill_Qemu
- Test_Print_Result "zypper_search" 0
+ Test_Print_Result "smart_query" 0
exit 0
else
- Test_Info "zypper search package avahi FAIL, Pls. check above error log"
+ Test_Info "smart query package avahi FAIL, Pls. check above error log"
Test_Kill_Qemu
- Test_Print_Result "zypper_search" 1
+ Test_Print_Result "smart_query" 1
exit 1
fi
diff --git a/scripts/qemuimage-tests/scenario/qemuarm/core-image-lsb b/scripts/qemuimage-tests/scenario/qemuarm/core-image-lsb
index 4fa6068..c0fff0e 100644
--- a/scripts/qemuimage-tests/scenario/qemuarm/core-image-lsb
+++ b/scripts/qemuimage-tests/scenario/qemuarm/core-image-lsb
@@ -1,7 +1,7 @@
sanity ssh
sanity scp
sanity dmesg
-sanity zypper_help
-sanity zypper_search
+sanity smart_help
+sanity smart_query
sanity rpm_query
sanity shutdown
diff --git a/scripts/qemuimage-tests/scenario/qemuarm/core-image-sato b/scripts/qemuimage-tests/scenario/qemuarm/core-image-sato
index 0e79703..1ddcab4 100644
--- a/scripts/qemuimage-tests/scenario/qemuarm/core-image-sato
+++ b/scripts/qemuimage-tests/scenario/qemuarm/core-image-sato
@@ -1,8 +1,8 @@
sanity ssh
sanity scp
sanity dmesg
-sanity zypper_help
-sanity zypper_search
+sanity smart_help
+sanity smart_query
sanity rpm_query
sanity connman
sanity shutdown
diff --git a/scripts/qemuimage-tests/scenario/qemuarm/core-image-sato-sdk b/scripts/qemuimage-tests/scenario/qemuarm/core-image-sato-sdk
index 726842c..50d7ad0 100644
--- a/scripts/qemuimage-tests/scenario/qemuarm/core-image-sato-sdk
+++ b/scripts/qemuimage-tests/scenario/qemuarm/core-image-sato-sdk
@@ -1,8 +1,8 @@
sanity ssh
sanity scp
sanity dmesg
-sanity zypper_help
-sanity zypper_search
+sanity smart_help
+sanity smart_query
sanity rpm_query
sanity compiler
sanity connman
diff --git a/scripts/qemuimage-tests/scenario/qemumips/core-image-lsb b/scripts/qemuimage-tests/scenario/qemumips/core-image-lsb
index 4fa6068..c0fff0e 100644
--- a/scripts/qemuimage-tests/scenario/qemumips/core-image-lsb
+++ b/scripts/qemuimage-tests/scenario/qemumips/core-image-lsb
@@ -1,7 +1,7 @@
sanity ssh
sanity scp
sanity dmesg
-sanity zypper_help
-sanity zypper_search
+sanity smart_help
+sanity smart_query
sanity rpm_query
sanity shutdown
diff --git a/scripts/qemuimage-tests/scenario/qemumips/core-image-sato b/scripts/qemuimage-tests/scenario/qemumips/core-image-sato
index 0e79703..1ddcab4 100644
--- a/scripts/qemuimage-tests/scenario/qemumips/core-image-sato
+++ b/scripts/qemuimage-tests/scenario/qemumips/core-image-sato
@@ -1,8 +1,8 @@
sanity ssh
sanity scp
sanity dmesg
-sanity zypper_help
-sanity zypper_search
+sanity smart_help
+sanity smart_query
sanity rpm_query
sanity connman
sanity shutdown
diff --git a/scripts/qemuimage-tests/scenario/qemumips/core-image-sato-sdk b/scripts/qemuimage-tests/scenario/qemumips/core-image-sato-sdk
index 726842c..50d7ad0 100644
--- a/scripts/qemuimage-tests/scenario/qemumips/core-image-sato-sdk
+++ b/scripts/qemuimage-tests/scenario/qemumips/core-image-sato-sdk
@@ -1,8 +1,8 @@
sanity ssh
sanity scp
sanity dmesg
-sanity zypper_help
-sanity zypper_search
+sanity smart_help
+sanity smart_query
sanity rpm_query
sanity compiler
sanity connman
diff --git a/scripts/qemuimage-tests/scenario/qemuppc/core-image-lsb b/scripts/qemuimage-tests/scenario/qemuppc/core-image-lsb
index 4fa6068..c0fff0e 100644
--- a/scripts/qemuimage-tests/scenario/qemuppc/core-image-lsb
+++ b/scripts/qemuimage-tests/scenario/qemuppc/core-image-lsb
@@ -1,7 +1,7 @@
sanity ssh
sanity scp
sanity dmesg
-sanity zypper_help
-sanity zypper_search
+sanity smart_help
+sanity smart_query
sanity rpm_query
sanity shutdown
diff --git a/scripts/qemuimage-tests/scenario/qemuppc/core-image-sato b/scripts/qemuimage-tests/scenario/qemuppc/core-image-sato
index 0e79703..1ddcab4 100644
--- a/scripts/qemuimage-tests/scenario/qemuppc/core-image-sato
+++ b/scripts/qemuimage-tests/scenario/qemuppc/core-image-sato
@@ -1,8 +1,8 @@
sanity ssh
sanity scp
sanity dmesg
-sanity zypper_help
-sanity zypper_search
+sanity smart_help
+sanity smart_query
sanity rpm_query
sanity connman
sanity shutdown
diff --git a/scripts/qemuimage-tests/scenario/qemuppc/core-image-sato-sdk b/scripts/qemuimage-tests/scenario/qemuppc/core-image-sato-sdk
index 726842c..50d7ad0 100644
--- a/scripts/qemuimage-tests/scenario/qemuppc/core-image-sato-sdk
+++ b/scripts/qemuimage-tests/scenario/qemuppc/core-image-sato-sdk
@@ -1,8 +1,8 @@
sanity ssh
sanity scp
sanity dmesg
-sanity zypper_help
-sanity zypper_search
+sanity smart_help
+sanity smart_query
sanity rpm_query
sanity compiler
sanity connman
diff --git a/scripts/qemuimage-tests/scenario/qemux86-64/core-image-lsb b/scripts/qemuimage-tests/scenario/qemux86-64/core-image-lsb
index 4fa6068..c0fff0e 100644
--- a/scripts/qemuimage-tests/scenario/qemux86-64/core-image-lsb
+++ b/scripts/qemuimage-tests/scenario/qemux86-64/core-image-lsb
@@ -1,7 +1,7 @@
sanity ssh
sanity scp
sanity dmesg
-sanity zypper_help
-sanity zypper_search
+sanity smart_help
+sanity smart_query
sanity rpm_query
sanity shutdown
diff --git a/scripts/qemuimage-tests/scenario/qemux86-64/core-image-sato b/scripts/qemuimage-tests/scenario/qemux86-64/core-image-sato
index 0e79703..1ddcab4 100644
--- a/scripts/qemuimage-tests/scenario/qemux86-64/core-image-sato
+++ b/scripts/qemuimage-tests/scenario/qemux86-64/core-image-sato
@@ -1,8 +1,8 @@
sanity ssh
sanity scp
sanity dmesg
-sanity zypper_help
-sanity zypper_search
+sanity smart_help
+sanity smart_query
sanity rpm_query
sanity connman
sanity shutdown
diff --git a/scripts/qemuimage-tests/scenario/qemux86-64/core-image-sato-sdk b/scripts/qemuimage-tests/scenario/qemux86-64/core-image-sato-sdk
index 726842c..50d7ad0 100644
--- a/scripts/qemuimage-tests/scenario/qemux86-64/core-image-sato-sdk
+++ b/scripts/qemuimage-tests/scenario/qemux86-64/core-image-sato-sdk
@@ -1,8 +1,8 @@
sanity ssh
sanity scp
sanity dmesg
-sanity zypper_help
-sanity zypper_search
+sanity smart_help
+sanity smart_query
sanity rpm_query
sanity compiler
sanity connman
diff --git a/scripts/qemuimage-tests/scenario/qemux86/core-image-lsb b/scripts/qemuimage-tests/scenario/qemux86/core-image-lsb
index 4fa6068..c0fff0e 100644
--- a/scripts/qemuimage-tests/scenario/qemux86/core-image-lsb
+++ b/scripts/qemuimage-tests/scenario/qemux86/core-image-lsb
@@ -1,7 +1,7 @@
sanity ssh
sanity scp
sanity dmesg
-sanity zypper_help
-sanity zypper_search
+sanity smart_help
+sanity smart_query
sanity rpm_query
sanity shutdown
diff --git a/scripts/qemuimage-tests/scenario/qemux86/core-image-sato b/scripts/qemuimage-tests/scenario/qemux86/core-image-sato
index 0e79703..1ddcab4 100644
--- a/scripts/qemuimage-tests/scenario/qemux86/core-image-sato
+++ b/scripts/qemuimage-tests/scenario/qemux86/core-image-sato
@@ -1,8 +1,8 @@
sanity ssh
sanity scp
sanity dmesg
-sanity zypper_help
-sanity zypper_search
+sanity smart_help
+sanity smart_query
sanity rpm_query
sanity connman
sanity shutdown
diff --git a/scripts/qemuimage-tests/scenario/qemux86/core-image-sato-sdk b/scripts/qemuimage-tests/scenario/qemux86/core-image-sato-sdk
index 726842c..50d7ad0 100644
--- a/scripts/qemuimage-tests/scenario/qemux86/core-image-sato-sdk
+++ b/scripts/qemuimage-tests/scenario/qemux86/core-image-sato-sdk
@@ -1,8 +1,8 @@
sanity ssh
sanity scp
sanity dmesg
-sanity zypper_help
-sanity zypper_search
+sanity smart_help
+sanity smart_query
sanity rpm_query
sanity compiler
sanity connman
diff --git a/scripts/qemuimage-tests/tools/zypper_test.sh b/scripts/qemuimage-tests/tools/smart_test.sh
similarity index 46%
rename from scripts/qemuimage-tests/tools/zypper_test.sh
rename to scripts/qemuimage-tests/tools/smart_test.sh
index 5e8e7aa..f278a25 100644
--- a/scripts/qemuimage-tests/tools/zypper_test.sh
+++ b/scripts/qemuimage-tests/tools/smart_test.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# zypper test script running in target
+# smart test script running in target
#
# Author: Jiajun Xu <jiajun.xu@intel.com>
#
@@ -14,32 +14,32 @@ Target_Info()
Target_Err()
{
- echo -e "\tTARGET: zypper command has issue when running, Pls. check the error log"
+ echo -e "\tTARGET: smart command has issue when running, Pls. check the error log"
echo -e "\tTARGET: ##### Error Log #####"
$1
echo -e "\tTARGET: ##### End #####"
}
-which zypper
+which smart
if [ $? -ne 0 ]; then
- Target_Info "No zypper command found"
+ Target_Info "No smart command found"
exit 1
fi
-if [ zypper > /dev/null 2>&1 ]; then
- Target_Info "zypper command run without problem"
+if [ smart > /dev/null 2>&1 ]; then
+ Target_Info "smart command run without problem"
else
- Target_Err zypper
+ Target_Err smart
exit 1
fi
-# run zypper with specific command parsed to zypper_test.sh
-zypper $* > /dev/null 2>&1
+# run smart with specific command parsed to smart_test.sh
+smart $* > /dev/null 2>&1
if [ $? -eq 0 ]; then
- Target_Info "zypper $* work without problem"
+ Target_Info "smart $* work without problem"
exit 0
else
- Target_Err zypper $*
+ Target_Err "smart $*"
exit 1
fi
--
1.7.10.4
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH v3 05/13] package_rpm: Update the way the multilib package names are translated
2012-12-12 18:31 [PATCH v3 00/13] Smart package management integration Paul Eggleton
` (3 preceding siblings ...)
2012-12-12 18:31 ` [PATCH v3 04/13] Update sanity tests to use smart instead of zypper Paul Eggleton
@ 2012-12-12 18:31 ` Paul Eggleton
2012-12-12 18:31 ` [PATCH v3 06/13] package_rpm.bbclass: Fix the way the RPM platform file is generated Paul Eggleton
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Paul Eggleton @ 2012-12-12 18:31 UTC (permalink / raw)
To: openembedded-core
From: Mark Hatle <mark.hatle@windriver.com>
The variable MULTILIB_PACKAGE_ARCHS has been removed in favor of a
repurposed MULTILIB_PREFIX_LIST. The format of this item is now
<libid>:<arch>:<arch1>:...:<archN>. This ensures that we can correctly
translate the libid to one of the supported archs in a tri-lib system.
All of the users of MULTILIB_PREFIX_LIST and MULTILIB_PACKAGE_ARCHS have
been modified accordingly.
Also change the way attempted packages are installed, verify the package
exists in the translate functions, then perform the install in one single
operation. This results in a significantly faster install time.
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
meta/classes/package_rpm.bbclass | 188 ++++++++++++++++++++++++++++++---
meta/classes/populate_sdk_rpm.bbclass | 28 +++--
meta/classes/rootfs_rpm.bbclass | 47 ++++-----
3 files changed, 216 insertions(+), 47 deletions(-)
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 4b81b68..4f60daf 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -24,11 +24,24 @@ package_update_index_rpm () {
return
fi
- base_archs="`echo ${PACKAGE_ARCHS} | sed 's/-/_/g'`"
- ml_archs="`echo ${MULTILIB_PACKAGE_ARCHS} | sed 's/-/_/g'`"
- sdk_archs="`echo ${SDK_PACKAGE_ARCHS} | sed 's/-/_/g'`"
+ sdk_archs=`echo "${SDK_PACKAGE_ARCHS}" | tr - _`
+
+ target_archs=""
+ for i in ${MULTILIB_PREFIX_LIST} ; do
+ old_IFS="$IFS"
+ IFS=":"
+ set $i
+ IFS="$old_IFS"
+ shift # remove mlib
+ while [ -n "$1" ]; do
+ target_archs="$target_archs $1"
+ shift
+ done
+ done
- archs=`for arch in $base_archs $ml_archs $sdk_archs ; do
+ target_archs=`echo "$target_archs" | tr - _`
+
+ archs=`for arch in $target_archs $sdk_archs ; do
echo $arch
done | sort | uniq`
@@ -59,6 +72,143 @@ rpm_log_check() {
true
}
+# Translate the RPM/Smart format names to the OE multilib format names
+# Input via stdin (only the first item per line is converted!)
+# Output via stdout
+translate_smart_to_oe() {
+ arg1="$1"
+
+ # Dump installed packages
+ while read pkg arch other ; do
+ if [ -z "$pkg" ]; then
+ continue
+ fi
+ new_pkg=$pkg
+ fixed_arch=`echo "$arch" | tr _ -`
+ for i in ${MULTILIB_PREFIX_LIST} ; do
+ old_IFS="$IFS"
+ IFS=":"
+ set $i
+ IFS="$old_IFS"
+ mlib="$1"
+ shift
+ while [ -n "$1" ]; do
+ cmp_arch=$1
+ shift
+ if [ "$arch" = "$cmp_arch" -o "$fixed_arch" = "$cmp_arch" ]; then
+ if [ "$mlib" = "default" ]; then
+ new_pkg="$pkg"
+ else
+ new_pkg="$mlib-$pkg"
+ fi
+ break
+ fi
+ done
+ if [ "$arch" = "$cmp_arch" -o "$fixed_arch" = "$cmp_arch" ]; then
+ break
+ fi
+ done
+
+ #echo "$pkg -> $new_pkg" >&2
+ if [ "$arg1" = "arch" ]; then
+ echo $new_pkg $cmp_arch $other
+ else
+ echo $new_pkg $other
+ fi
+ done
+}
+
+# Translate the OE multilib format names to the RPM/Smart format names
+# Input via arguments
+# Ouput via pkgs_to_install
+translate_oe_to_smart() {
+ default_archs=""
+ sdk_mode=""
+ if [ "$1" = "--sdk" ]; then
+ shift
+ sdk_mode="true"
+ # Need to reverse the order of the SDK_ARCHS highest -> lowest priority
+ archs=`echo "${SDK_PACKAGE_ARCHS}" | tr - _`
+ for arch in $archs ; do
+ default_archs="$arch $default_archs"
+ done
+ fi
+
+ attemptonly="Error"
+ if [ "$1" = "--attemptonly" ]; then
+ attemptonly="Warning"
+ shift
+ fi
+
+ # Dump a list of all available packages
+ [ ! -e ${target_rootfs}/install/tmp/fullpkglist.query ] && smart --data-dir=${target_rootfs}/var/lib/smart query --output ${target_rootfs}/install/tmp/fullpkglist.query
+
+ pkgs_to_install=""
+ for pkg in "$@" ; do
+ new_pkg="$pkg"
+ if [ -z "$sdk_mode" ]; then
+ for i in ${MULTILIB_PREFIX_LIST} ; do
+ old_IFS="$IFS"
+ IFS=":"
+ set $i
+ IFS="$old_IFS"
+ mlib="$1"
+ shift
+ if [ "$mlib" = "default" ]; then
+ if [ -z "$default_archs" ]; then
+ default_archs=$@
+ fi
+ continue
+ fi
+ subst=${pkg#${mlib}-}
+ if [ "$subst" != "$pkg" ]; then
+ feeds=$@
+ while [ -n "$1" ]; do
+ arch="$1"
+ arch=`echo "$arch" | tr - _`
+ shift
+ if grep -q '^'$subst'-[^-]*-[^-]*@'$arch'$' ${target_rootfs}/install/tmp/fullpkglist.query ; then
+ new_pkg="$subst@$arch"
+ # First found is best match
+ break
+ fi
+ done
+ if [ "$pkg" = "$new_pkg" ]; then
+ # Failed to translate, package not found!
+ echo "$attemptonly: $pkg not found in the $mlib feeds ($feeds)." >&2
+ if [ "$attemptonly" = "Error" ]; then
+ exit 1
+ fi
+ continue
+ fi
+ fi
+ done
+ fi
+ # Apparently not a multilib package...
+ if [ "$pkg" = "$new_pkg" ]; then
+ default_archs_fixed=`echo "$default_archs" | tr - _`
+ for arch in $default_archs_fixed ; do
+ if grep -q '^'$pkg'-[^-]*-[^-]*@'$arch'$' ${target_rootfs}/install/tmp/fullpkglist.query ; then
+ new_pkg="$pkg@$arch"
+ # First found is best match
+ break
+ fi
+ done
+ if [ "$pkg" = "$new_pkg" ]; then
+ # Failed to translate, package not found!
+ echo "$attemptonly: $pkg not found in the base feeds ($default_archs)." >&2
+ if [ "$attemptonly" = "Error" ]; then
+ exit 1
+ fi
+ continue
+ fi
+ fi
+ #echo "$pkg -> $new_pkg" >&2
+ pkgs_to_install="${pkgs_to_install} ${new_pkg}"
+ done
+ export pkgs_to_install
+}
+
#
# Install a bunch of packages using rpm.
@@ -96,18 +246,26 @@ package_install_internal_rpm () {
local providename="$INSTALL_PROVIDENAME_RPM"
local task="$INSTALL_TASK_RPM"
+ local sdk_mode=""
+ if [ "$1" = "--sdk" ]; then
+ sdk_mode="--sdk"
+ fi
+
# Configure internal RPM environment when using Smart
export RPM_ETCRPM=${target_rootfs}/etc/rpm
# Setup temporary directory -- install...
- mkdir -p ${target_rootfs}/install
+ rm -rf ${target_rootfs}/install
+ mkdir -p ${target_rootfs}/install/tmp
+ channel_priority=5
if [ "${INSTALL_COMPLEMENTARY_RPM}" != "1" ] ; then
# Setup base system configuration
mkdir -p ${target_rootfs}/etc/rpm/
echo "${platform}${TARGET_VENDOR}-${TARGET_OS}" > ${target_rootfs}/etc/rpm/platform
if [ ! -z "$platform_extra" ]; then
for pt in $platform_extra ; do
+ channel_priority=$(expr $channel_priority + 5)
case $pt in
noarch | any | all)
os="`echo ${TARGET_OS} | sed "s,-.*,,"`.*"
@@ -178,11 +336,14 @@ EOF
smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-extra-macros._tmppath=/install/tmp
smart --data-dir=${target_rootfs}/var/lib/smart channel --add rpmsys type=rpm-sys -y
- for arch in $platform_extra ; do
+ platform_extra_fixed=`echo "$platform_extra" | tr - _`
+ for arch in $platform_extra_fixed ; do
if [ -d ${DEPLOY_DIR_RPM}/$arch -a ! -e ${target_rootfs}/install/channel.$arch.stamp ] ; then
smart --data-dir=${target_rootfs}/var/lib/smart channel --add $arch type=rpm-md type=rpm-md baseurl=${DEPLOY_DIR_RPM}/$arch -y
+ smart --data-dir=${target_rootfs}/var/lib/smart channel --set $arch priority=$channel_priority
touch ${target_rootfs}/install/channel.$arch.stamp
fi
+ channel_priority=$(expr $channel_priority - 5)
done
fi
@@ -218,14 +379,15 @@ EOF
chmod 0755 ${WORKDIR}/scriptlet_wrapper
smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-extra-macros._cross_scriptlet_wrapper=${WORKDIR}/scriptlet_wrapper
- smart --data-dir=${target_rootfs}/var/lib/smart install -y ${package_to_install} ${package_linguas}
+ # Determine what to install
+ translate_oe_to_smart ${sdk_mode} ${package_to_install} ${package_linguas}
- if [ ! -z "${package_attemptonly}" ]; then
- echo "Installing attempt only packages..."
- for pkg_name in ${package_attemptonly} ; do
- echo "Attempting $pkg_name..." >> "`dirname ${BB_LOGFILE}`/log.do_${task}_attemptonly.${PID}"
- smart --data-dir=${target_rootfs}/var/lib/smart install -y $pkg_name >> "`dirname ${BB_LOGFILE}`/log.do_${task}_attemptonly.${PID}" 2>&1 || true
- done
+ [ -n "$pkgs_to_install" ] && smart --data-dir=${target_rootfs}/var/lib/smart install -y ${pkgs_to_install}
+
+ if [ -n "${package_attemptonly}" ]; then
+ translate_oe_to_smart ${sdk_mode} --attemptonly $package_attemptonly
+ echo "Attempting $pkgs_to_install"
+ smart --data-dir=${target_rootfs}/var/lib/smart install -y $pkgs_to_install >> "`dirname ${BB_LOGFILE}`/log.do_${task}_attemptonly.${PID}" 2>&1 || true
fi
}
diff --git a/meta/classes/populate_sdk_rpm.bbclass b/meta/classes/populate_sdk_rpm.bbclass
index 1d6b1be..396f1a2 100644
--- a/meta/classes/populate_sdk_rpm.bbclass
+++ b/meta/classes/populate_sdk_rpm.bbclass
@@ -52,8 +52,16 @@ populate_sdk_rpm () {
# List must be prefered to least preferred order
INSTALL_PLATFORM_EXTRA_RPM=""
- for each_arch in ${MULTILIB_PACKAGE_ARCHS} ${PACKAGE_ARCHS} ; do
- INSTALL_PLATFORM_EXTRA_RPM="$each_arch $INSTALL_PLATFORM_EXTRA_RPM"
+ for i in ${MULTILIB_PREFIX_LIST} ; do
+ old_IFS="$IFS"
+ IFS=":"
+ set $i
+ IFS="$old_IFS"
+ shift #remove mlib
+ while [ -n "$1" ]; do
+ INSTALL_PLATFORM_EXTRA_RPM="$INSTALL_PLATFORM_EXTRA_RPM $1"
+ shift
+ done
done
export INSTALL_PLATFORM_EXTRA_RPM
@@ -79,7 +87,7 @@ populate_sdk_rpm () {
done
export INSTALL_PLATFORM_EXTRA_RPM
- package_install_internal_rpm
+ package_install_internal_rpm --sdk
populate_sdk_post_rpm ${INSTALL_ROOTFS_RPM}
# move host RPM library data
@@ -96,8 +104,11 @@ populate_sdk_rpm () {
python () {
# The following code should be kept in sync w/ the rootfs_rpm version.
- ml_package_archs = ""
- ml_prefix_list = ""
+
+ # package_arch order is reversed. This ensures the -best- match is listed first!
+ package_archs = d.getVar("PACKAGE_ARCHS", True) or ""
+ package_archs = ":".join(package_archs.split()[::-1])
+ ml_prefix_list = "%s:%s" % ('default', package_archs)
multilibs = d.getVar('MULTILIBS', True) or ""
for ext in multilibs.split():
eext = ext.split(':')
@@ -107,11 +118,8 @@ python () {
if default_tune:
localdata.setVar("DEFAULTTUNE", default_tune)
package_archs = localdata.getVar("PACKAGE_ARCHS", True) or ""
- package_archs = " ".join([i in "all noarch any".split() and i or eext[1]+"_"+i for i in package_archs.split()])
- ml_package_archs += " " + package_archs
- ml_prefix_list += " " + eext[1]
- #bb.note("ML_PACKAGE_ARCHS %s %s %s" % (eext[1], localdata.getVar("PACKAGE_ARCHS", True) or "(none)", overrides))
- d.setVar('MULTILIB_PACKAGE_ARCHS', ml_package_archs)
+ package_archs = ":".join([i in "all noarch any".split() and i or eext[1]+"_"+i for i in package_archs.split()][::-1])
+ ml_prefix_list += " %s:%s" % (eext[1], package_archs)
d.setVar('MULTILIB_PREFIX_LIST', ml_prefix_list)
}
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass
index a507ad6..5000956 100644
--- a/meta/classes/rootfs_rpm.bbclass
+++ b/meta/classes/rootfs_rpm.bbclass
@@ -62,8 +62,16 @@ fakeroot rootfs_rpm_do_rootfs () {
# List must be prefered to least preferred order
INSTALL_PLATFORM_EXTRA_RPM=""
- for each_arch in ${MULTILIB_PACKAGE_ARCHS} ${PACKAGE_ARCHS}; do
- INSTALL_PLATFORM_EXTRA_RPM="$each_arch $INSTALL_PLATFORM_EXTRA_RPM"
+ for i in ${MULTILIB_PREFIX_LIST} ; do
+ old_IFS="$IFS"
+ IFS=":"
+ set $i
+ IFS="$old_IFS"
+ shift #remove mlib
+ while [ -n "$1" ]; do
+ INSTALL_PLATFORM_EXTRA_RPM="$INSTALL_PLATFORM_EXTRA_RPM $1"
+ shift
+ done
done
export INSTALL_PLATFORM_RPM
@@ -143,21 +151,12 @@ rpm_setup_smart_target_config() {
RPM_QUERY_CMD = '${RPM} --root $INSTALL_ROOTFS_RPM -D "_dbpath ${rpmlibdir}"'
list_installed_packages() {
- GET_LIST=$(${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{ARCH} %{PACKAGEORIGIN} %{Platform}\n]")
-
- # Use awk to find the multilib prefix and compare it
- # with the platform RPM thinks it is part of
- for prefix in `echo ${MULTILIB_PREFIX_LIST}`; do
- GET_LIST=$(echo "$GET_LIST" | awk -v prefix="$prefix" '$0 ~ prefix {printf("%s-%s\n", prefix, $0); } $0 !~ prefix {print $0}')
- done
-
- # print the info, need to different return counts
- if [ "$1" = "arch" ] ; then
- echo "$GET_LIST" | awk -v archs="${PACKAGE_ARCHS}" '{if(!index(archs, $2)) {gsub("_", "-", $2)} print $1, $2}'
- elif [ "$1" = "file" ] ; then
- echo "$GET_LIST" | awk '{print $1, $3}'
- else
- echo "$GET_LIST" | awk '{print $1}'
+ if [ "$1" = "arch" ]; then
+ ${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{ARCH}\n]" | translate_smart_to_oe arch | tee /tmp/arch_list
+ elif [ "$1" = "file" ]; then
+ ${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{ARCH} %{PACKAGEORIGIN}\n]" | translate_smart_to_oe | tee /tmp/file_list
+ else
+ ${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{ARCH}\n]" | translate_smart_to_oe | tee /tmp/default_list
fi
}
@@ -187,8 +186,11 @@ python () {
d.setVar('RPM_POSTPROCESS_COMMANDS', '')
# The following code should be kept in sync w/ the populate_sdk_rpm version.
- ml_package_archs = ""
- ml_prefix_list = ""
+
+ # package_arch order is reversed. This ensures the -best- match is listed first!
+ package_archs = d.getVar("PACKAGE_ARCHS", True) or ""
+ package_archs = ":".join(package_archs.split()[::-1])
+ ml_prefix_list = "%s:%s" % ('default', package_archs)
multilibs = d.getVar('MULTILIBS', True) or ""
for ext in multilibs.split():
eext = ext.split(':')
@@ -198,10 +200,7 @@ python () {
if default_tune:
localdata.setVar("DEFAULTTUNE", default_tune)
package_archs = localdata.getVar("PACKAGE_ARCHS", True) or ""
- package_archs = " ".join([i in "all noarch any".split() and i or eext[1]+"_"+i for i in package_archs.split()])
- ml_package_archs += " " + package_archs
- ml_prefix_list += " " + eext[1]
- #bb.note("ML_PACKAGE_ARCHS %s %s %s" % (eext[1], localdata.getVar("PACKAGE_ARCHS", True) or "(none)", overrides))
- d.setVar('MULTILIB_PACKAGE_ARCHS', ml_package_archs)
+ package_archs = ":".join([i in "all noarch any".split() and i or eext[1]+"_"+i for i in package_archs.split()][::-1])
+ ml_prefix_list += " %s:%s" % (eext[1], package_archs)
d.setVar('MULTILIB_PREFIX_LIST', ml_prefix_list)
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH v3 06/13] package_rpm.bbclass: Fix the way the RPM platform file is generated
2012-12-12 18:31 [PATCH v3 00/13] Smart package management integration Paul Eggleton
` (4 preceding siblings ...)
2012-12-12 18:31 ` [PATCH v3 05/13] package_rpm: Update the way the multilib package names are translated Paul Eggleton
@ 2012-12-12 18:31 ` Paul Eggleton
2012-12-12 18:31 ` [PATCH v3 07/13] package_rpm.bbclass: Add additional logging Paul Eggleton
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Paul Eggleton @ 2012-12-12 18:31 UTC (permalink / raw)
To: openembedded-core
From: Mark Hatle <mark.hatle@windriver.com>
When generating an SDK, we need to use either the SDK or TARGET version
of the OS. They are not interchangable!
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
meta/classes/package_rpm.bbclass | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 4f60daf..fdca2c3 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -262,16 +262,26 @@ package_install_internal_rpm () {
if [ "${INSTALL_COMPLEMENTARY_RPM}" != "1" ] ; then
# Setup base system configuration
mkdir -p ${target_rootfs}/etc/rpm/
- echo "${platform}${TARGET_VENDOR}-${TARGET_OS}" > ${target_rootfs}/etc/rpm/platform
+ if [ -n "${sdk_mode}" ]; then
+ platform_vendor="${SDK_VENDOR}"
+ platform_os="${SDK_OS}"
+ else
+ platform_vendor="${TARGET_VENDOR}"
+ platform_os="${TARGET_OS}"
+ fi
+
+ echo "${platform}${platform_vendor}-${platform_os}" > ${target_rootfs}/etc/rpm/platform
+
+
if [ ! -z "$platform_extra" ]; then
for pt in $platform_extra ; do
channel_priority=$(expr $channel_priority + 5)
case $pt in
noarch | any | all)
- os="`echo ${TARGET_OS} | sed "s,-.*,,"`.*"
+ os="`echo ${platform_os} | sed "s,-.*,,"`.*"
;;
*)
- os="${TARGET_OS}"
+ os="${platform_os}"
;;
esac
echo "$pt-.*-$os" >> ${target_rootfs}/etc/rpm/platform
--
1.7.10.4
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH v3 07/13] package_rpm.bbclass: Add additional logging
2012-12-12 18:31 [PATCH v3 00/13] Smart package management integration Paul Eggleton
` (5 preceding siblings ...)
2012-12-12 18:31 ` [PATCH v3 06/13] package_rpm.bbclass: Fix the way the RPM platform file is generated Paul Eggleton
@ 2012-12-12 18:31 ` Paul Eggleton
2012-12-12 18:31 ` [PATCH v3 08/13] package_rpm.bbclass: Add support for incremental installs Paul Eggleton
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Paul Eggleton @ 2012-12-12 18:31 UTC (permalink / raw)
To: openembedded-core
From: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
meta/classes/package_rpm.bbclass | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index fdca2c3..b80b939 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -261,6 +261,7 @@ package_install_internal_rpm () {
channel_priority=5
if [ "${INSTALL_COMPLEMENTARY_RPM}" != "1" ] ; then
# Setup base system configuration
+ echo "Note: configuring RPM platform settings"
mkdir -p ${target_rootfs}/etc/rpm/
if [ -n "${sdk_mode}" ]; then
platform_vendor="${SDK_VENDOR}"
@@ -289,6 +290,7 @@ package_install_internal_rpm () {
fi
# Tell RPM that the "/" directory exist and is available
+ echo "Note: configuring RPM system provides"
mkdir -p ${target_rootfs}/etc/rpm/sysinfo
echo "/" >${target_rootfs}/etc/rpm/sysinfo/Dirnames
@@ -300,6 +302,7 @@ package_install_internal_rpm () {
fi
# Configure RPM... we enforce these settings!
+ echo "Note: configuring RPM DB settings"
mkdir -p ${target_rootfs}${rpmlibdir}
mkdir -p ${target_rootfs}${rpmlibdir}/log
# After change the __db.* cache size, log file will not be generated automatically,
@@ -337,6 +340,7 @@ EOF
rpm --root $target_rootfs --dbpath /var/lib/rpm -qa > /dev/null
# Configure smart
+ echo "Note: configuring Smart settings"
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}
@@ -349,6 +353,7 @@ EOF
platform_extra_fixed=`echo "$platform_extra" | tr - _`
for arch in $platform_extra_fixed ; do
if [ -d ${DEPLOY_DIR_RPM}/$arch -a ! -e ${target_rootfs}/install/channel.$arch.stamp ] ; then
+ echo "Note: adding Smart channel $arch ($channel_priority)"
smart --data-dir=${target_rootfs}/var/lib/smart channel --add $arch type=rpm-md type=rpm-md baseurl=${DEPLOY_DIR_RPM}/$arch -y
smart --data-dir=${target_rootfs}/var/lib/smart channel --set $arch priority=$channel_priority
touch ${target_rootfs}/install/channel.$arch.stamp
@@ -386,15 +391,19 @@ if [ \$? -ne 0 ]; then
fi
EOF
+ echo "Note: configuring RPM cross-install scriptlet_wrapper"
chmod 0755 ${WORKDIR}/scriptlet_wrapper
smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-extra-macros._cross_scriptlet_wrapper=${WORKDIR}/scriptlet_wrapper
# Determine what to install
translate_oe_to_smart ${sdk_mode} ${package_to_install} ${package_linguas}
+ echo "Note: to be installed: ${pkgs_to_install}"
[ -n "$pkgs_to_install" ] && smart --data-dir=${target_rootfs}/var/lib/smart install -y ${pkgs_to_install}
if [ -n "${package_attemptonly}" ]; then
+ echo "Note: installing attempt only packages..."
+ echo "Note: see `dirname ${BB_LOGFILE}`/log.do_${task}_attemptonly.${PID}"
translate_oe_to_smart ${sdk_mode} --attemptonly $package_attemptonly
echo "Attempting $pkgs_to_install"
smart --data-dir=${target_rootfs}/var/lib/smart install -y $pkgs_to_install >> "`dirname ${BB_LOGFILE}`/log.do_${task}_attemptonly.${PID}" 2>&1 || true
--
1.7.10.4
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH v3 08/13] package_rpm.bbclass: Add support for incremental installs
2012-12-12 18:31 [PATCH v3 00/13] Smart package management integration Paul Eggleton
` (6 preceding siblings ...)
2012-12-12 18:31 ` [PATCH v3 07/13] package_rpm.bbclass: Add additional logging Paul Eggleton
@ 2012-12-12 18:31 ` Paul Eggleton
2012-12-12 18:31 ` [PATCH v3 09/13] package_rpm.bbclass: Add additional install error detection Paul Eggleton
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Paul Eggleton @ 2012-12-12 18:31 UTC (permalink / raw)
To: openembedded-core
From: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
meta/classes/package_rpm.bbclass | 48 +++++++++++++++++++++++++++++++++++++-
1 file changed, 47 insertions(+), 1 deletion(-)
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index b80b939..cb8e0f4 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -348,7 +348,8 @@ EOF
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
- smart --data-dir=${target_rootfs}/var/lib/smart channel --add rpmsys type=rpm-sys -y
+ # Delay this until later...
+ #smart --data-dir=${target_rootfs}/var/lib/smart channel --add rpmsys type=rpm-sys -y
platform_extra_fixed=`echo "$platform_extra" | tr - _`
for arch in $platform_extra_fixed ; do
@@ -398,6 +399,51 @@ EOF
# Determine what to install
translate_oe_to_smart ${sdk_mode} ${package_to_install} ${package_linguas}
+ # If incremental install, we need to determine what we've got,
+ # what we need to add, and what to remove...
+ if [ "${INC_RPM_IMAGE_GEN}" = "1" -a "${INSTALL_COMPLEMENTARY_RPM}" != "1" ]; then
+ # Dump the new solution
+ echo "Note: creating install solution for incremental install"
+ smart --data-dir=${target_rootfs}/var/lib/smart install -y --dump ${pkgs_to_install} 2> ${target_rootfs}/../solution.manifest
+ fi
+
+ if [ "${INSTALL_COMPLEMENTARY_RPM}" != "1" ]; then
+ echo "Note: adding Smart RPM DB channel"
+ smart --data-dir=${target_rootfs}/var/lib/smart channel --add rpmsys type=rpm-sys -y
+ fi
+
+ # If incremental install, we need to determine what we've got,
+ # what we need to add, and what to remove...
+ if [ "${INC_RPM_IMAGE_GEN}" = "1" -a "${INSTALL_COMPLEMENTARY_RPM}" != "1" ]; then
+ # First upgrade everything that was previously installed to the latest version
+ echo "Note: incremental update -- upgrade packages in place"
+ smart --data-dir=${target_rootfs}/var/lib/smart upgrade
+
+ # Dump what is already installed
+ echo "Note: dump installed packages for incremental update"
+ smart --data-dir=${target_rootfs}/var/lib/smart query --installed --output ${target_rootfs}/../installed.manifest
+
+ sort ${target_rootfs}/../installed.manifest > ${target_rootfs}/../installed.manifest.sorted
+ sort ${target_rootfs}/../solution.manifest > ${target_rootfs}/../solution.manifest.sorted
+
+ comm -1 -3 ${target_rootfs}/../solution.manifest.sorted ${target_rootfs}/../installed.manifest.sorted \
+ > ${target_rootfs}/../remove.list
+ comm -2 -3 ${target_rootfs}/../solution.manifest.sorted ${target_rootfs}/../installed.manifest.sorted \
+ > ${target_rootfs}/../install.list
+
+ pkgs_to_remove=`cat ${target_rootfs}/../remove.list | xargs echo`
+ pkgs_to_install=`cat ${target_rootfs}/../install.list | xargs echo`
+
+ echo "Note: to be removed: ${pkgs_to_remove}"
+
+ for pkg in ${pkgs_to_remove}; do
+ echo "Debug: What required: $pkg"
+ smart --data-dir=${target_rootfs}/var/lib/smart query $pkg --show-requiredby
+ done
+
+ [ -n "$pkgs_to_remove" ] && smart --data-dir=${target_rootfs}/var/lib/smart remove -y ${pkgs_to_remove}
+ fi
+
echo "Note: to be installed: ${pkgs_to_install}"
[ -n "$pkgs_to_install" ] && smart --data-dir=${target_rootfs}/var/lib/smart install -y ${pkgs_to_install}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH v3 09/13] package_rpm.bbclass: Add additional install error detection
2012-12-12 18:31 [PATCH v3 00/13] Smart package management integration Paul Eggleton
` (7 preceding siblings ...)
2012-12-12 18:31 ` [PATCH v3 08/13] package_rpm.bbclass: Add support for incremental installs Paul Eggleton
@ 2012-12-12 18:31 ` Paul Eggleton
2012-12-12 18:31 ` [PATCH v3 10/13] rpm/smart: Fix runtime-relocation issues w/ RPM and Smart Paul Eggleton
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Paul Eggleton @ 2012-12-12 18:31 UTC (permalink / raw)
To: openembedded-core
From: Mark Hatle <mark.hatle@windriver.com>
There is a condition where the package will fail to install, but smart does
not capture the error. Add the error string to the scan list.
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
meta/classes/package_rpm.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index cb8e0f4..7af1d6c 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -57,7 +57,7 @@ rpm_log_check() {
lf_path="$2"
lf_txt="`cat $lf_path`"
- for keyword_die in "Cannot find package" "exit 1" ERR Fail
+ for keyword_die in "unpacking of archive failed" "Cannot find package" "exit 1" ERR Fail
do
if (echo "$lf_txt" | grep -v log_check | grep "$keyword_die") >/dev/null 2>&1
then
--
1.7.10.4
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH v3 10/13] rpm/smart: Fix runtime-relocation issues w/ RPM and Smart
2012-12-12 18:31 [PATCH v3 00/13] Smart package management integration Paul Eggleton
` (8 preceding siblings ...)
2012-12-12 18:31 ` [PATCH v3 09/13] package_rpm.bbclass: Add additional install error detection Paul Eggleton
@ 2012-12-12 18:31 ` Paul Eggleton
2012-12-12 18:31 ` [PATCH v3 11/13] package_rpm.bbclass: Add a simply way to enable RPM debugging Paul Eggleton
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Paul Eggleton @ 2012-12-12 18:31 UTC (permalink / raw)
To: openembedded-core
From: Mark Hatle <mark.hatle@windriver.com>
Fix runtime-relocation issues with the RPM and Smart wrappers.
In addition the patches were necessary to fix related problems.
The changes to the includes three categories of issues:
*) Incorrect pathname evaluations
*) Incorrect evaluation of the /etc/rpm/platform file contents
*) Confusing vendor #define checks
Finally, a simple way to debug the platformScore was added as
that is necessary to debug how this works and into the smart system.
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
.../python/python-smartpm_1.4.1.bb | 17 +++-
.../rpm/rpm/rpm-debug-platform.patch | 65 +++++++++++++++
meta/recipes-devtools/rpm/rpm/rpm-platform.patch | 2 +-
meta/recipes-devtools/rpm/rpm/rpm-platform2.patch | 87 +++++++++++++++-----
meta/recipes-devtools/rpm/rpm_5.4.9.bb | 41 +++++----
5 files changed, 173 insertions(+), 39 deletions(-)
create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-debug-platform.patch
diff --git a/meta/recipes-devtools/python/python-smartpm_1.4.1.bb b/meta/recipes-devtools/python/python-smartpm_1.4.1.bb
index 53f232b..04f61f8 100644
--- a/meta/recipes-devtools/python/python-smartpm_1.4.1.bb
+++ b/meta/recipes-devtools/python/python-smartpm_1.4.1.bb
@@ -11,7 +11,7 @@ LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://LICENSE;md5=393a5ca445f6965873eca0259a17f833"
DEPENDS = "python rpm"
-PR = "r4"
+PR = "r5"
SRCNAME = "smart"
SRC_URI = "\
@@ -87,6 +87,21 @@ do_install_append() {
fi
}
+add_native_wrapper() {
+ create_wrapper ${D}/${bindir}/smart \
+ RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
+ RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+ RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
+}
+
+do_install_append_class-native() {
+ add_native_wrapper
+}
+
+do_install_append_class-nativesdk() {
+ add_native_wrapper
+}
+
PACKAGES = "${PN}-dev ${PN}-dbg ${PN}-doc smartpm \
${@base_contains('PACKAGECONFIG', 'rpm', '${PN}-backend-rpm', '', d)} \
${@base_contains('PACKAGECONFIG', 'qt4', '${PN}-interface-qt4', '', d)} \
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-debug-platform.patch b/meta/recipes-devtools/rpm/rpm/rpm-debug-platform.patch
new file mode 100644
index 0000000..25ebbdc
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-debug-platform.patch
@@ -0,0 +1,65 @@
+Debug the platform score generation...
+
+Index: rpm-5.4.9/lib/rpmrc.c
+===================================================================
+--- rpm-5.4.9.orig/lib/rpmrc.c
++++ rpm-5.4.9/lib/rpmrc.c
+@@ -465,6 +465,8 @@ static rpmRC rpmPlatform(const char * pl
+
+ rc = (rpmRC) rpmiobSlurp(platform, &iob);
+
++ fprintf(stderr, "D: rpmPlatform file %s\n", platform);
++
+ if (rc || iob == NULL) {
+ rc = RPMRC_FAIL;
+ goto exit;
+@@ -486,6 +488,7 @@ static rpmRC rpmPlatform(const char * pl
+ while (--t > p && xisspace(*t))
+ *t = '\0';
+ if (t > p) {
++ fprintf(stderr, "D: rpmPlatform mireAppend REGEX %s\n", p);
+ xx = mireAppend(RPMMIRE_REGEX, 0, p, NULL, &mi_re, &mi_nre);
+ }
+ continue;
+@@ -503,6 +506,11 @@ static rpmRC rpmPlatform(const char * pl
+ _gnu = rpmExpand("-", cvog->gnu, NULL);
+
+ addMacro(NULL, "_platform_gnu", NULL, (_gnu ? _gnu : ""), -1);
++ fprintf(stderr, "D: rpmPlatform addMacro %s-%s-%s(%s)\n",
++ rpmExpand("%{_platform_cpu}", NULL),
++ rpmExpand("%{_platform_vendor}", NULL),
++ rpmExpand("%{_platform_os}", NULL),
++ rpmExpand("%{_platform_gnu}", NULL));
+ #else
+ addMacro(NULL, "_host_cpu", NULL, cvog->cpu, -1);
+ addMacro(NULL, "_host_vendor", NULL, cvog->vendor, -1);
+@@ -510,6 +518,7 @@ static rpmRC rpmPlatform(const char * pl
+ #endif
+ }
+
++ fprintf(stderr, "D: rpmPlatform mireAppend STRCMP %s -- ", p);
+ #if defined(RPM_VENDOR_OPENPKG) /* explicit-platform */
+ /* do not use vendor and GNU attribution */
+ p = rpmExpand("%{_host_cpu}-%{_host_os}", NULL);
+@@ -518,6 +527,7 @@ static rpmRC rpmPlatform(const char * pl
+ (cvog && *cvog->gnu ? "-" : NULL),
+ (cvog ? cvog->gnu : NULL), NULL);
+ #endif
++ fprintf(stderr, "%s\n", p);
+ xx = mireAppend(RPMMIRE_STRCMP, 0, p, NULL, &mi_re, &mi_nre);
+ p = _free(p);
+
+@@ -686,9 +696,12 @@ int rpmPlatformScore(const char * platfo
+
+ if ((mire = (miRE) mi_re) != NULL)
+ for (i = 0; i < mi_nre; i++) {
+- if (mireRegexec(mire + i, platform, 0) >= 0)
++ if (mireRegexec(mire + i, platform, 0) >= 0) {
++ fprintf(stderr, "D: rpmPlatformScore %s (%d)\n", platform, i + 1);
+ return (i + 1);
++ }
+ }
++ fprintf(stderr, "D: rpmPlatformScore %s (%d)\n", platform, 0);
+ return 0;
+ }
+ /*@=onlytrans@*/
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-platform.patch b/meta/recipes-devtools/rpm/rpm/rpm-platform.patch
index 7b81857..9e167d8 100644
--- a/meta/recipes-devtools/rpm/rpm/rpm-platform.patch
+++ b/meta/recipes-devtools/rpm/rpm/rpm-platform.patch
@@ -40,7 +40,7 @@ diff -ur rpm-5.4.0.orig/lib/depends.c rpm-5.4.0/lib/depends.c
return rc;
}
-+#if defined(RPM_VENDOR_WINDRIVER)
++#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_POKY)
+#define _ETC_RPM_SYSINFO "%{_etcrpm}/sysinfo"
+#else
+#define _ETC_RPM_SYSINFO SYSCONFIGDIR "/sysinfo"
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-platform2.patch b/meta/recipes-devtools/rpm/rpm/rpm-platform2.patch
index 3d50e46..6683d8f 100644
--- a/meta/recipes-devtools/rpm/rpm/rpm-platform2.patch
+++ b/meta/recipes-devtools/rpm/rpm/rpm-platform2.patch
@@ -3,10 +3,13 @@ Fix up platform and related sysinfo file loading (part 2).
Upstream-Status: Pending
We need to ensure that we set the _gnu flag somehow. We do this by reading
-from the platform file, and setting a new platform_gnu and related vars.
+from the platform file, and setting a new _platform_gnu and related vars.
-We then check for the existance of these things and change the configure
-time defaults to the run-time values as necessary.
+The default values of _host_cpu, _host_vendor and _host_os are changed to
+reference either the automatically determined _target_... or _platform_...
+values. The macros file uses the configure time defaults in _platform_...
+versions have not been defined. This preserves existing behavior, but
+ensures reasonable defaults are always available.
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
@@ -14,17 +17,43 @@ Index: rpm-5.4.9/lib/rpmrc.c
===================================================================
--- rpm-5.4.9.orig/lib/rpmrc.c
+++ rpm-5.4.9/lib/rpmrc.c
-@@ -487,9 +487,10 @@ static rpmRC rpmPlatform(const char * pl
+@@ -328,10 +328,15 @@ static void setDefaults(void)
+ /*@modifies rpmGlobalMacroContext, internalState @*/
+ {
+
+-#if defined(RPM_VENDOR_WINDRIVER)
++#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_POKY)
+ addMacro(NULL, "_usrlibrpm", NULL, __usrlibrpm, RMIL_DEFAULT);
+ addMacro(NULL, "_etcrpm", NULL, __etcrpm, RMIL_DEFAULT);
+ addMacro(NULL, "_vendor", NULL, "%{?_host_vendor}%{!?_host_vendor:wrs}", RMIL_DEFAULT);
++
++ addMacro(NULL, "_host_cpu", NULL, "%{?_platform_cpu}%{!?_platform_cpu:%{?_target_cpu}}", RMIL_DEFAULT);
++ addMacro(NULL, "_host_vendor", NULL, "%{?_platform_vendor}%{!?_platform_cpu:%{?_target_vendor}}", RMIL_DEFAULT);
++ addMacro(NULL, "_host_os", NULL, "%{?_platform_os}%{!?_platform_os:%{?_target_os}}", RMIL_DEFAULT);
++ addMacro(NULL, "_host_gnu", NULL, "%{?_platform_gnu}%{!?_platform_gnu:%{?_gnu}}", RMIL_DEFAULT);
+ #endif
+
+ addMacro(NULL, "_usr", NULL, USRPREFIX, RMIL_DEFAULT);
+@@ -487,9 +492,22 @@ static rpmRC rpmPlatform(const char * pl
}
if (!parseCVOG(p, &cvog) && cvog != NULL) {
-- addMacro(NULL, "_host_cpu", NULL, cvog->cpu, -1);
-- addMacro(NULL, "_host_vendor", NULL, cvog->vendor, -1);
-- addMacro(NULL, "_host_os", NULL, cvog->os, -1);
++#if defined(RPM_VENDOR_POKY)
++ char * _gnu = NULL;
++
+ addMacro(NULL, "_platform_cpu", NULL, cvog->cpu, -1);
+ addMacro(NULL, "_platform_vendor", NULL, cvog->vendor, -1);
+ addMacro(NULL, "_platform_os", NULL, cvog->os, -1);
-+ addMacro(NULL, "_platform_gnu", NULL, cvog->gnu, -1);
++
++ if (cvog->gnu && cvog->gnu[0] != '\0')
++ _gnu = rpmExpand("-", cvog->gnu, NULL);
++
++ addMacro(NULL, "_platform_gnu", NULL, (_gnu ? _gnu : ""), -1);
++#else
+ addMacro(NULL, "_host_cpu", NULL, cvog->cpu, -1);
+ addMacro(NULL, "_host_vendor", NULL, cvog->vendor, -1);
+ addMacro(NULL, "_host_os", NULL, cvog->os, -1);
++#endif
}
#if defined(RPM_VENDOR_OPENPKG) /* explicit-platform */
@@ -32,25 +61,45 @@ Index: rpm-5.4.9/macros/macros.in
===================================================================
--- rpm-5.4.9.orig/macros/macros.in
+++ rpm-5.4.9/macros/macros.in
-@@ -873,7 +873,7 @@ $_arbitrary_tags_tests Foo:Bar
- %_build_arch @RPMCANONARCH@
- %_vendor @RPMCANONVENDOR@
+@@ -875,9 +875,9 @@ $_arbitrary_tags_tests Foo:Bar
%_os @RPMCANONOS@
--%_gnu @RPMCANONGNU@
-+%_gnu %{?_platform_gnu:-%{_platform_gnu}}%{!?_platform_gnu:@RPMCANONGNU@}
+ %_gnu @RPMCANONGNU@
+
+-%_host_platform %{_host_cpu}-%{_host_vendor}-%{_host_os}%{?_gnu}
+-%_build_platform %{_build_cpu}-%{_build_vendor}-%{_build_os}%{?_gnu}
+-%_target_platform %{_target_cpu}-%{_target_vendor}-%{_target_os}%{?_gnu}
++%_host_platform %{_host_cpu}-%{_host_vendor}-%{_host_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}}
++%_build_platform %{_build_cpu}-%{_build_vendor}-%{_build_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}}
++%_target_platform %{_target_cpu}-%{_target_vendor}-%{_target_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}}
- %_host_platform %{_host_cpu}-%{_host_vendor}-%{_host_os}%{?_gnu}
- %_build_platform %{_build_cpu}-%{_build_vendor}-%{_build_os}%{?_gnu}
-@@ -920,9 +920,9 @@ $_arbitrary_tags_tests Foo:Bar
+ #==============================================================================
+ # ---- configure macros.
+@@ -920,9 +920,10 @@ $_arbitrary_tags_tests Foo:Bar
%_build_os %{_host_os}
%_host @host@
%_host_alias @host_alias@%{nil}
-%_host_cpu @host_cpu@
-%_host_vendor @host_vendor@
-%_host_os @host_os@
-+%_host_cpu %{?_platform_cpu}%{!?_platform_cpu:@host_cpu@}
-+%_host_vendor %{?_platform_vendor}%{!?_platform_vendor:@host_vendor@}
-+%_host_os %{?_platform_os}%{!?_platform_os:@host_os@}
++%_host_cpu %{?_platform_cpu}%{!?_platform_cpu:%{_arch}}
++%_host_vendor %{?_platform_vendor}%{!?_platform_vendor:%{_vendor}}
++%_host_os %{?_platform_os}%{!?_platform_os:%{_os}}
++%_host_gnu %{?_platform_gnu}%{!?_platform_gnu:%{_gnu}}
%_target %{_host}
%_target_alias %{_host_alias}
%_target_cpu %{_host_cpu}
+Index: rpm-5.4.9/python/rpmmodule.c
+===================================================================
+--- rpm-5.4.9.orig/python/rpmmodule.c
++++ rpm-5.4.9/python/rpmmodule.c
+@@ -65,8 +65,8 @@ static PyObject * archScore(PyObject * s
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "s", kwlist, &arch))
+ return NULL;
+
+-#if defined(RPM_VENDOR_WINDRIVER)
+- platform = rpmExpand(arch, "-%{_host_vendor}", "-%{_host_os}%{?_gnu}", NULL);
++#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_POKY)
++ platform = rpmExpand(arch, "-%{_host_vendor}", "-%{_host_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}}", NULL);
+ #else
+ platform = rpmExpand(arch, "-", "%{_vendor}", "-", "%{_os}", NULL);
+ #endif
diff --git a/meta/recipes-devtools/rpm/rpm_5.4.9.bb b/meta/recipes-devtools/rpm/rpm_5.4.9.bb
index 7311d0e..be76f24 100644
--- a/meta/recipes-devtools/rpm/rpm_5.4.9.bb
+++ b/meta/recipes-devtools/rpm/rpm_5.4.9.bb
@@ -43,7 +43,7 @@ LICENSE = "LGPLv2.1"
LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1"
DEPENDS = "libpcre attr acl popt ossp-uuid file bison-native"
-PR = "r58"
+PR = "r59"
# rpm2cpio is a shell script, which is part of the rpm src.rpm. It is needed
# in order to extract the distribution SRPM into a format we can extract...
@@ -86,6 +86,11 @@ SRC_URI = "http://www.rpm5.org/files/rpm/rpm-5.4/rpm-5.4.9-0.20120508.src.rpm;ex
file://rpm-platform2.patch \
"
+# Uncomment the following line to enable platform score debugging
+# This is useful when identifying issues with Smart being unable
+# to process certain package feeds.
+#SRC_URI += "file://rpm-debug-platform.patch"
+
SRC_URI[md5sum] = "60d56ace884340c1b3fcac6a1d58e768"
SRC_URI[sha256sum] = "bac7cc5bd9d0e8262fdc0099349924608da8f680f5cb243751f696552239dde8"
@@ -150,7 +155,7 @@ PACKAGECONFIG[tcl] = "--with-tcl,--without-tcl,tcl,"
PACAKGECONFIG[augeas] = "--with-augeas,--without-augeas,augeas,"
EXTRA_OECONF += "--verbose \
- --sysconfdir=/etc \
+ --sysconfdir=${sysconfdir} \
--with-file \
--with-path-magic=%{_usrlibrpm}/../../share/misc/magic.mgc \
--with-syck=internal \
@@ -226,7 +231,7 @@ FILES_${PN}-dbg += "${libdir}/rpm/.debug \
FILES_${PN}-common = "${bindir}/rpm2cpio \
${bindir}/gendiff \
- /etc/rpm \
+ ${sysconfdir}/rpm \
/var/spool/repackage \
"
@@ -444,30 +449,30 @@ do_install_append() {
do_install_append_class-native() {
create_wrapper ${D}/${bindir}/rpm \
- RPM_USRLIBRPM=${STAGING_LIBDIR_NATIVE}/rpm \
- RPM_ETCRPM=${STAGING_ETCDIR_NATIVE}/rpm \
- RPM_LOCALEDIRRPM=${STAGING_DATADIR_NATIVE}/locale
+ RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
+ RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+ RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
create_wrapper ${D}/${bindir}/rpm2cpio \
- RPM_USRLIBRPM=${STAGING_LIBDIR_NATIVE}/rpm \
- RPM_ETCRPM=${STAGING_ETCDIR_NATIVE}/rpm \
- RPM_LOCALEDIRRPM=${STAGING_DATADIR_NATIVE}/locale
+ RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
+ RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+ RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
create_wrapper ${D}/${bindir}/rpmbuild \
- RPM_USRLIBRPM=${STAGING_LIBDIR_NATIVE}/rpm \
- RPM_ETCRPM=${STAGING_ETCDIR_NATIVE}/rpm \
- RPM_LOCALEDIRRPM=${STAGING_DATADIR_NATIVE}/locale
+ RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
+ RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+ RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
create_wrapper ${D}/${bindir}/rpmconstant \
- RPM_USRLIBRPM=${STAGING_LIBDIR_NATIVE}/rpm \
- RPM_ETCRPM=${STAGING_ETCDIR_NATIVE}/rpm \
- RPM_LOCALEDIRRPM=${STAGING_DATADIR_NATIVE}/locale
+ RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
+ RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+ RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
for rpm_binary in ${D}/${libdir}/rpm/bin/rpm*; do
create_wrapper $rpm_binary
- RPM_USRLIBRPM=${STAGING_LIBDIR_NATIVE}/rpm \
- RPM_ETCRPM=${STAGING_ETCDIR_NATIVE}/rpm \
- RPM_LOCALEDIRRPM=${STAGING_DATADIR_NATIVE}/locale
+ RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
+ RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+ RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
done
# Adjust popt macros to match...
--
1.7.10.4
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH v3 11/13] package_rpm.bbclass: Add a simply way to enable RPM debugging
2012-12-12 18:31 [PATCH v3 00/13] Smart package management integration Paul Eggleton
` (9 preceding siblings ...)
2012-12-12 18:31 ` [PATCH v3 10/13] rpm/smart: Fix runtime-relocation issues w/ RPM and Smart Paul Eggleton
@ 2012-12-12 18:31 ` Paul Eggleton
2012-12-12 18:31 ` [PATCH v3 12/13] coreutils_6.9: Update the older coreutils to no longer provide 'su' Paul Eggleton
2012-12-12 18:31 ` [PATCH v3 13/13] package_rpm: Workaround for 'all' arch multilib package naming Paul Eggleton
12 siblings, 0 replies; 14+ messages in thread
From: Paul Eggleton @ 2012-12-12 18:31 UTC (permalink / raw)
To: openembedded-core
From: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
meta/classes/package_rpm.bbclass | 3 +++
1 file changed, 3 insertions(+)
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 7af1d6c..6a0bb91 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -348,6 +348,9 @@ EOF
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
+ # Optional debugging
+ #smart --data-dir=${target_rootfs}/var/lib/smart config --set rpm-log-level=debug
+
# Delay this until later...
#smart --data-dir=${target_rootfs}/var/lib/smart channel --add rpmsys type=rpm-sys -y
--
1.7.10.4
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH v3 12/13] coreutils_6.9: Update the older coreutils to no longer provide 'su'
2012-12-12 18:31 [PATCH v3 00/13] Smart package management integration Paul Eggleton
` (10 preceding siblings ...)
2012-12-12 18:31 ` [PATCH v3 11/13] package_rpm.bbclass: Add a simply way to enable RPM debugging Paul Eggleton
@ 2012-12-12 18:31 ` Paul Eggleton
2012-12-12 18:31 ` [PATCH v3 13/13] package_rpm: Workaround for 'all' arch multilib package naming Paul Eggleton
12 siblings, 0 replies; 14+ messages in thread
From: Paul Eggleton @ 2012-12-12 18:31 UTC (permalink / raw)
To: openembedded-core
From: Mark Hatle <mark.hatle@windriver.com>
'su' was removed from newer versions of coreutils, and in OE-Core
we pick up 'su' from shadow instead. So simply remove the binary
from the install image to match expected behavior and avoid failures
due to conflicting 'su' binaries during do_rootfs when building
non-GPLv3 images.
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
meta/recipes-core/coreutils/coreutils_6.9.bb | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/meta/recipes-core/coreutils/coreutils_6.9.bb b/meta/recipes-core/coreutils/coreutils_6.9.bb
index 1b25320..0ad148b 100644
--- a/meta/recipes-core/coreutils/coreutils_6.9.bb
+++ b/meta/recipes-core/coreutils/coreutils_6.9.bb
@@ -8,7 +8,7 @@ BUGTRACKER = "http://debbugs.gnu.org/coreutils"
LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
file://src/ls.c;beginline=4;endline=16;md5=15ed60f67b1db5fedd5dbc37cf8a9543"
-PR = "r3"
+PR = "r4"
DEPENDS = "coreutils-native-${PV}"
DEPENDS_class-native = "gettext-native"
@@ -60,6 +60,10 @@ do_install() {
# in update-alternatives to fail, therefore use lbracket - the name used
# for the actual source file.
mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${BPN}
+
+ # Newer versions of binutils do not include su, to mimic this behavior
+ # we simply remove it.
+ rm -f ${D}${bindir}/su
}
inherit update-alternatives
--
1.7.10.4
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH v3 13/13] package_rpm: Workaround for 'all' arch multilib package naming
2012-12-12 18:31 [PATCH v3 00/13] Smart package management integration Paul Eggleton
` (11 preceding siblings ...)
2012-12-12 18:31 ` [PATCH v3 12/13] coreutils_6.9: Update the older coreutils to no longer provide 'su' Paul Eggleton
@ 2012-12-12 18:31 ` Paul Eggleton
12 siblings, 0 replies; 14+ messages in thread
From: Paul Eggleton @ 2012-12-12 18:31 UTC (permalink / raw)
To: openembedded-core
From: Mark Hatle <mark.hatle@windriver.com>
[YOCTO #3565]
All packages should not be multilib specific, however when the multilib
rules run, they automatically rename the 'all' target recipes. As such
there is no way to know if an 'all' package should or should not contain
the multilib prefix. We workaround this issue in the translate function
by checking to see if the runtime-reverse file exists or not.
The workaround should be removed once a proper solution to the architectural
issue is in place.
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
meta/classes/package_rpm.bbclass | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 6a0bb91..a00b702 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -80,6 +80,7 @@ translate_smart_to_oe() {
# Dump installed packages
while read pkg arch other ; do
+ found=0
if [ -z "$pkg" ]; then
continue
fi
@@ -101,10 +102,19 @@ translate_smart_to_oe() {
else
new_pkg="$mlib-$pkg"
fi
- break
+ # Workaround for bug 3565
+ # Simply look to see if we know of a package with that name, if not try again!
+ filename=`ls ${TMPDIR}/pkgdata/*/runtime-reverse/$new_pkg 2>/dev/null | head -n 1`
+ if [ -n "$filename" ] ; then
+ found=1
+ break
+ fi
+ # 'real' code
+ # found=1
+ # break
fi
done
- if [ "$arch" = "$cmp_arch" -o "$fixed_arch" = "$cmp_arch" ]; then
+ if [ "$found" = "1" ] && [ "$arch" = "$cmp_arch" -o "$fixed_arch" = "$cmp_arch" ]; then
break
fi
done
--
1.7.10.4
^ permalink raw reply related [flat|nested] 14+ messages in thread