summaryrefslogtreecommitdiff
path: root/meta/classes/rootfs_rpm.bbclass
diff options
context:
space:
mode:
authorLianhao Lu <lianhao.lu@intel.com>2011-01-30 14:07:50 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-01 23:59:37 +0000
commit382075a9c2a5877d198a217161558da6ad2d5f89 (patch)
tree33b53b274eb1c921721f71cf87904e24851c7627 /meta/classes/rootfs_rpm.bbclass
parentb94f9ccd05a339a5e3e8ec4c7bd8c727ca575871 (diff)
downloadopenembedded-core-382075a9c2a5877d198a217161558da6ad2d5f89.tar.gz
openembedded-core-382075a9c2a5877d198a217161558da6ad2d5f89.tar.bz2
openembedded-core-382075a9c2a5877d198a217161558da6ad2d5f89.tar.xz
openembedded-core-382075a9c2a5877d198a217161558da6ad2d5f89.zip
rootfs_rpm/package_rpm.bbclass: Move func from rootfs_rpm to package_rpm
package_deb.bbclass: 1. Modified package_update_index_rpm() and package_generate_rpm_conf() to generate sperate depsolver db and rpm configuration, for target packages and host packages respectively. 2. Added new function package_install_internal_rpm() to install a list deb packages to a specified root directory, with the specified package architecutre information. 3. Added new function resolve_package_rpm() to resolve package names to filepaths. rootfs_deb.bbclass: Used the above new functions to install the rootfs. [sgw: merged changes for createrepo] Signed-off-by: Lianhao Lu <lianhao.lu@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
Diffstat (limited to 'meta/classes/rootfs_rpm.bbclass')
-rw-r--r--meta/classes/rootfs_rpm.bbclass145
1 files changed, 14 insertions, 131 deletions
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass
index 26aaa1f8c..d9a9c7d8a 100644
--- a/meta/classes/rootfs_rpm.bbclass
+++ b/meta/classes/rootfs_rpm.bbclass
@@ -37,7 +37,7 @@ RPM="rpm ${RPMOPTS}"
do_rootfs[lockfiles] += "${DEPLOY_DIR_RPM}/rpm.lock"
fakeroot rootfs_rpm_do_rootfs () {
- set +x
+ #set +x
${RPM_PREPROCESS_COMMANDS}
@@ -46,123 +46,18 @@ fakeroot rootfs_rpm_do_rootfs () {
# Setup base system configuration
mkdir -p ${IMAGE_ROOTFS}/etc/rpm/
- # Default arch is the top..
- echo "${TARGET_ARCH}-unknown-linux" >${IMAGE_ROOTFS}/etc/rpm/platform
- # Add the rest in sort order..
- for each in ${PACKAGE_ARCHS} ; do
- echo "$each""-unknown-linux" >>${IMAGE_ROOTFS}/etc/rpm/platform
- done
-
- # Tell RPM that the "/" directory exist and is available
- mkdir -p ${IMAGE_ROOTFS}/etc/rpm/sysinfo
- echo "/" >${IMAGE_ROOTFS}/etc/rpm/sysinfo/Dirnames
-
- # Setup manifest of packages to install...
- mkdir -p ${IMAGE_ROOTFS}/install
- echo "# Install manifest" > ${IMAGE_ROOTFS}/install/install.manifest
-
- # Uclibc builds don't provide this stuff...
- if [ x${TARGET_OS} = "xlinux" ] || [ x${TARGET_OS} = "xlinux-gnueabi" ] ; then
- if [ ! -z "${LINGUAS_INSTALL}" ]; then
- for pkg in ${LINGUAS_INSTALL}; do
- echo "Processing $pkg..."
- pkg_name=$(resolve_package $pkg)
- if [ -z "$pkg_name" ]; then
- echo "Unable to find package $pkg!"
- exit 1
- fi
- echo $pkg_name >> ${IMAGE_ROOTFS}/install/install.manifest
- done
- fi
- fi
+ #install pacakges
+ export INSTALL_ROOTFS_RPM="${IMAGE_ROOTFS}"
+ export INSTALL_PLATFORM_RPM="${TARGET_ARCH}"
+ export INSTALL_PLATFORM_EXTRA_RPM="${PACKAGE_ARCHS}"
+ export INSTALL_CONFBASE_RPM="${RPMCONF_TARGET_BASE}"
+ export INSTALL_PACKAGES_NORMAL_RPM="${PACKAGE_INSTALL}"
+ export INSTALL_PACKAGES_ATTEMPTONLY_RPM="${PACKAGE_INSTALL_ATTEMPTONLY}"
+ export INSTALL_PACKAGES_LINGUAS_RPM="${LINGUAS_INSTALL}"
+ export INSTALL_PROVIDENAME_RPM=""
+ export INSTALL_TASK_RPM="populate_sdk"
- if [ ! -z "${PACKAGE_INSTALL}" ]; then
- for pkg in ${PACKAGE_INSTALL} ; do
- echo "Processing $pkg..."
- pkg_name=$(resolve_package $pkg)
- if [ -z "$pkg_name" ]; then
- echo "Unable to find package $pkg!"
- exit 1
- fi
- echo $pkg_name >> ${IMAGE_ROOTFS}/install/install.manifest
- done
- fi
-
- # Generate an install solution by doing a --justdb install, then recreate it with
- # an actual package install!
- ${RPM} -D "_dbpath ${IMAGE_ROOTFS}/install" -D "`cat ${DEPLOY_DIR_RPM}/solvedb.macro`" \
- -D "__dbi_txn create nofsync" \
- -U --justdb --noscripts --notriggers --noparentdirs --nolinktos --ignoresize \
- ${IMAGE_ROOTFS}/install/install.manifest
-
- if [ ! -z "${PACKAGE_INSTALL_ATTEMPTONLY}" ]; then
- echo "Adding attempt only packages..."
- for pkg in ${PACKAGE_INSTALL_ATTEMPTONLY} ; do
- echo "Processing $pkg..."
- pkg_name=$(resolve_package $pkg)
- if [ -z "$pkg_name" ]; then
- echo "Unable to find package $pkg!"
- exit 1
- fi
- echo "Attempting $pkg_name..." >> "${WORKDIR}/temp/log.do_rootfs_attemptonly.${PID}"
- ${RPM} -D "_dbpath ${IMAGE_ROOTFS}/install" -D "`cat ${DEPLOY_DIR_RPM}/solvedb.macro`" \
- -D "__dbi_txn create nofsync private" \
- -U --justdb --noscripts --notriggers --noparentdirs --nolinktos --ignoresize \
- $pkg_name >> "${WORKDIR}/temp/log.do_rootfs_attemptonly.${PID}" || true
- done
- fi
-
-#### Note: 'Recommends' is an arbitrary tag that means _SUGGESTS_ in Poky..
- # 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 > ${IMAGE_ROOTFS}/install/recommend.list
- while [ $loop -eq 1 ]; do
- # Dump the full set of recommends...
- ${RPM} -D "_dbpath ${IMAGE_ROOTFS}/install" -D "`cat ${DEPLOY_DIR_RPM}/solvedb.macro`" \
- -D "__dbi_txn create nofsync private" \
- -qa --qf "[%{RECOMMENDS}\n]" | sort -u > ${IMAGE_ROOTFS}/install/recommend
- # Did we add more to the list?
- grep -v -x -F -f ${IMAGE_ROOTFS}/install/recommend.list ${IMAGE_ROOTFS}/install/recommend > ${IMAGE_ROOTFS}/install/recommend.new || true
- # We don't want to loop unless there is a change to the list!
- loop=0
- cat ${IMAGE_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..."
- pkg_name=$(resolve_package $pkg)
- if [ -z "$pkg_name" ]; then
- echo "Unable to find package $pkg." >> "${WORKDIR}/temp/log.do_rootfs_recommend.${PID}"
- continue
- fi
- echo "Attempting $pkg_name..." >> "${WORKDIR}/temp/log.do_rootfs_recommend.${PID}"
- ${RPM} -D "_dbpath ${IMAGE_ROOTFS}/install" -D "`cat ${DEPLOY_DIR_RPM}/solvedb.macro`" \
- -D "__dbi_txn create nofsync private" \
- -U --justdb --noscripts --notriggers --noparentdirs --nolinktos --ignoresize \
- $pkg_name >> "${WORKDIR}/temp/log.do_rootfs_recommend.${PID}" 2>&1 || true
- done
- cat ${IMAGE_ROOTFS}/install/recommend.list ${IMAGE_ROOTFS}/install/recommend.new | sort -u > ${IMAGE_ROOTFS}/install/recommend.new.list
- mv ${IMAGE_ROOTFS}/install/recommend.new.list ${IMAGE_ROOTFS}/install/recommend.list
- rm ${IMAGE_ROOTFS}/install/recommend ${IMAGE_ROOTFS}/install/recommend.new
- done
- fi
-
- # Now that we have a solution, pull out a list of what to install...
- echo "Manifest: ${IMAGE_ROOTFS}/install/install.manifest"
- ${RPM} -D "_dbpath ${IMAGE_ROOTFS}/install" -qa --yaml \
- -D "__dbi_txn create nofsync private" \
- | grep -i 'Packageorigin' | cut -d : -f 2 > ${IMAGE_ROOTFS}/install/install_solution.manifest
-
- # Attempt install
- ${RPM} --root ${IMAGE_ROOTFS} -D "_dbpath ${rpmlibdir}" \
- --noscripts --notriggers --noparentdirs --nolinktos \
- -D "__dbi_txn create nofsync private" \
- -Uhv ${IMAGE_ROOTFS}/install/install_solution.manifest
+ package_install_internal_rpm
export D=${IMAGE_ROOTFS}
export OFFLINE_ROOT=${IMAGE_ROOTFS}
@@ -227,7 +122,7 @@ EOF
# Workaround so the parser knows we need the resolve_package function!
if false ; then
- resolve_package foo || true
+ resolve_package_rpm foo ${RPMCONF_TARGET_BASE}.conf || true
fi
}
@@ -236,18 +131,6 @@ remove_packaging_data_files() {
rm -rf ${IMAGE_ROOTFS}${opkglibdir}
}
-# Resolve package names to filepaths
-resolve_package() {
- pkg="$1"
- pkg_name=""
- for solve in `cat ${DEPLOY_DIR_RPM}/solvedb.conf`; do
- pkg_name=$(${RPM} -D "_dbpath $solve" -D "__dbi_txn create nofsync" -q --yaml $pkg | grep -i 'Packageorigin' | cut -d : -f 2)
- if [ -n "$pkg_name" ]; then
- break;
- fi
- done
- echo $pkg_name
-}
install_all_locales() {
PACKAGES_TO_INSTALL=""
@@ -263,7 +146,7 @@ install_all_locales() {
# but this should be good enough for the few users of this function...
for pkg in $INSTALLED_PACKAGES; do
for lang in ${IMAGE_LOCALES}; do
- pkg_name=$(resolve_package $pkg-locale-$lang)
+ pkg_name=$(resolve_package_rpm $pkg-locale-$lang ${RPMCONF_TARGET_BASE}.conf)
if [ -n "$pkg_name" ]; then
${RPM} --root ${IMAGE_ROOTFS} -D "_dbpath ${rpmlibdir}" \
-D "__dbi_txn create nofsync private" \