aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/rootfs_rpm.bbclass
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2012-11-29 15:43:16 +0000
committerSaul Wold <sgw@linux.intel.com>2012-12-14 15:17:18 -0800
commita726ae7c032fac1aa49ce34180fa2ed2dcaf87d3 (patch)
treefc8ff87e8fd1c323d1b99f516226b8ee4c794b67 /meta/classes/rootfs_rpm.bbclass
parent9efa0aa914cae9e13d90ddf99b482ccf0936573c (diff)
downloadopenembedded-core-contrib-a726ae7c032fac1aa49ce34180fa2ed2dcaf87d3.tar.gz
classes/*_rpm: integrate Smart into RPM filesystem construction
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> Signed-off-by: Saul Wold <sgw@linux.intel.com>
Diffstat (limited to 'meta/classes/rootfs_rpm.bbclass')
-rw-r--r--meta/classes/rootfs_rpm.bbclass34
1 files changed, 18 insertions, 16 deletions
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass
index 2bb1b087400..d0b0d5793f2 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]")