* [PATCH 6/8 v6] rootfs_rpm.bbclass: Update database configuration file
2012-06-05 22:04 [PATCH 0/8 v6] Uprev RPM to 5.4.9 Mark Hatle
@ 2012-06-05 22:04 ` Mark Hatle
2012-06-05 22:04 ` [PATCH 8/8 v6] package_rpm: Verify that the package manifests are not empty Mark Hatle
1 sibling, 0 replies; 3+ messages in thread
From: Mark Hatle @ 2012-06-05 22:04 UTC (permalink / raw)
To: openembedded-core
Move the creation of the database configuration files to just before we
perform the install actions. This ensures they will exist even in SDK or
other non-target filesystem images.
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
meta/classes/package_rpm.bbclass | 32 ++++++++++++++++++++++++++++++++
meta/classes/rootfs_rpm.bbclass | 31 -------------------------------
2 files changed, 32 insertions(+), 31 deletions(-)
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 097fa12..b84c044 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -454,6 +454,38 @@ EOF
chmod 0755 ${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
+
+# ================ 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
+
# 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
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass
index 703fa15..d227e61 100644
--- a/meta/classes/rootfs_rpm.bbclass
+++ b/meta/classes/rootfs_rpm.bbclass
@@ -59,37 +59,6 @@ fakeroot rootfs_rpm_do_rootfs () {
# Setup base system configuration
mkdir -p ${INSTALL_ROOTFS_RPM}/etc/rpm/
- mkdir -p ${INSTALL_ROOTFS_RPM}${rpmlibdir}
- mkdir -p ${INSTALL_ROOTFS_RPM}${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 ${INSTALL_ROOTFS_RPM}${rpmlibdir}/log/log.0000000001
- cat > ${INSTALL_ROOTFS_RPM}${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
-
-# ================ 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
-
# List must be prefered to least preferred order
INSTALL_PLATFORM_EXTRA_RPM=""
for each_arch in ${MULTILIB_PACKAGE_ARCHS} ${PACKAGE_ARCHS}; do
--
1.7.3.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH 8/8 v6] package_rpm: Verify that the package manifests are not empty
2012-06-05 22:04 [PATCH 0/8 v6] Uprev RPM to 5.4.9 Mark Hatle
2012-06-05 22:04 ` [PATCH 6/8 v6] rootfs_rpm.bbclass: Update database configuration file Mark Hatle
@ 2012-06-05 22:04 ` Mark Hatle
1 sibling, 0 replies; 3+ messages in thread
From: Mark Hatle @ 2012-06-05 22:04 UTC (permalink / raw)
To: openembedded-core
An empty manifest will cause a failure condition. We ensure that any install
actions occur only with a manifest larger then size 0. Also ensure that padding
is added to the end of the manifest, instead of the beginning to enable this
size check. (Padding is required for very small manifest files..)
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
meta/classes/package_rpm.bbclass | 59 ++++++++++++++++++++++----------------
1 files changed, 34 insertions(+), 25 deletions(-)
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index b84c044..bb9aa1a 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -182,6 +182,7 @@ rpm_update_pkg () {
# been run by now, so don't have to run them(preun, postun, etc.) when
# erase the pkg
if [ -s ${target_rootfs}/install/remove.manifest ]; then
+ echo "# Removal manifest padding...." >> ${target_rootfs}/install/remove.manifest
rpm_common_comand --noscripts --nodeps \
-e `cat ${target_rootfs}/install/remove.manifest`
fi
@@ -249,7 +250,7 @@ package_install_internal_rpm () {
# Setup manifest of packages to install...
mkdir -p ${target_rootfs}/install
- echo "# Install manifest" > ${target_rootfs}/install/install.manifest
+ rm -f ${target_rootfs}/install/install.manifest
# Uclibc builds don't provide this stuff...
if [ x${TARGET_OS} = "xlinux" ] || [ x${TARGET_OS} = "xlinux-gnueabi" ] ; then
@@ -309,12 +310,15 @@ package_install_internal_rpm () {
# 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" \
- -D "_dbpath ${target_rootfs}/install" -D "`cat ${confbase}-base_archs.macro`" \
- -D "__dbi_txn create nofsync" \
- -U --justdb --noscripts --notriggers --noparentdirs --nolinktos --ignoresize \
- ${target_rootfs}/install/install.manifest
+ 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" \
+ -D "_dbpath ${target_rootfs}/install" -D "`cat ${confbase}-base_archs.macro`" \
+ -D "__dbi_txn create nofsync" \
+ -U --justdb --noscripts --notriggers --noparentdirs --nolinktos --ignoresize \
+ ${target_rootfs}/install/install.manifest
+ fi
if [ ! -z "${package_attemptonly}" ]; then
echo "Adding attempt only packages..."
@@ -407,8 +411,9 @@ package_install_internal_rpm () {
touch ${target_rootfs}/install/install_multilib_solution.manifest
- if [ -e "${target_rootfs}/install/install_multilib.manifest" ]; then
+ 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!
@@ -493,33 +498,37 @@ EOF
if [ "${INC_RPM_IMAGE_GEN}" = "1" -a -f "$pre_btmanifest" ]; then
echo "Skipping pre install due to exisitng image"
else
- echo "# Initial Install manifest" > ${target_rootfs}/install/initial_install.manifest
+ 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
- # Generate an install solution by doing a --justdb install, then recreate it with
- # an actual package install!
- mkdir -p ${target_rootfs}/initial
+ if [ -s ${target_rootfs}/install/initial_install.manifest ]; then
+ echo "# Initial Install manifest padding..." >> ${target_rootfs}/install/initial_install.manifest
- ${RPM} --predefine "_rpmds_sysinfo_path ${target_rootfs}/etc/rpm/sysinfo" \
- --predefine "_rpmrc_platform_path ${target_rootfs}/etc/rpm/platform" \
- -D "_dbpath ${target_rootfs}/initial" -D "`cat ${confbase}.macro`" \
- -D "__dbi_txn create nofsync" \
- -U --justdb --noscripts --notriggers --noparentdirs --nolinktos --ignoresize \
- ${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} -D "_dbpath ${target_rootfs}/initial" -qa --qf "%{packageorigin}\n" \
- -D "__dbi_txn create nofsync private" \
- > ${target_rootfs}/install/initial_solution.manifest
+ ${RPM} --predefine "_rpmds_sysinfo_path ${target_rootfs}/etc/rpm/sysinfo" \
+ --predefine "_rpmrc_platform_path ${target_rootfs}/etc/rpm/platform" \
+ -D "_dbpath ${target_rootfs}/initial" -D "`cat ${confbase}.macro`" \
+ -D "__dbi_txn create nofsync" \
+ -U --justdb --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" \
+ > ${target_rootfs}/install/initial_solution.manifest
- rpm_update_pkg ${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
+ 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
+ rm -rf ${target_rootfs}/initial
+ fi
fi
echo "Installing main solution manifest (${target_rootfs}/install/total_solution.manifest)"
--
1.7.3.4
^ permalink raw reply related [flat|nested] 3+ messages in thread