]> code.ossystems Code Review - openembedded-core.git/commitdiff
rpm: Fix rpm database files capacity issue.
authorMei Lei <lei.mei@intel.com>
Wed, 28 Dec 2011 03:22:17 +0000 (11:22 +0800)
committerSaul Wold <sgw@linux.intel.com>
Tue, 3 Jan 2012 04:26:25 +0000 (20:26 -0800)
Tune the __db* size in DB_CONFIG.
This will reduce the __db* size from 62MB to 26MB in qemu.

[YOCTO #1769]

Signed-off-by: Mei Lei <lei.mei@intel.com>
meta/classes/rootfs_rpm.bbclass
meta/recipes-devtools/rpm/rpm/rpm-db-reduce.patch [new file with mode: 0644]
meta/recipes-devtools/rpm/rpm_5.4.0.bb

index 30f3783e3c6d0501207596fc9d36a79dd2efe02a..999b8a6c8648aae339dc3774b9f71f8be1863daf 100644 (file)
@@ -61,6 +61,9 @@ fakeroot rootfs_rpm_do_rootfs () {
 
        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            .
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-db-reduce.patch b/meta/recipes-devtools/rpm/rpm/rpm-db-reduce.patch
new file mode 100644 (file)
index 0000000..e063e86
--- /dev/null
@@ -0,0 +1,19 @@
+Upstream-Status: Inappropriate [configuration]
+
+Change cache size to reduce the usage of disk space from 62MB to 26MB. 
+
+Signed-off-by: Mei Lei <lei.mei@intel.com>
+
+diff --git a/rpmdb/DB_CONFIG.in b/rpmdb/DB_CONFIG.in
+index e0b4689..b64e3a9 100644
+--- a/rpmdb/DB_CONFIG.in
++++ b/rpmdb/DB_CONFIG.in
+@@ -29,7 +29,7 @@ set_thread_count     64
+ # ================ Memory Pool
+ #XXX initializing dbenv with set_cachesize has unimplemented prerequsites
+-#set_cachesize                0 1048576 0 
++set_cachesize         0 1048576 0 
+ set_mp_mmapsize               268435456
+ # ================ Locking
index 122d3a922a7c53c3ffca853d0f2e1a7028395230..aae59eca5ca02133678248073d47d37f5f17ede0 100644 (file)
@@ -45,12 +45,13 @@ LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1"
 DEPENDS = "bzip2 zlib db openssl elfutils expat libpcre attr acl popt ${extrarpmdeps}"
 extrarpmdeps = "python perl"
 extrarpmdeps_virtclass-native = "file-native"
-PR = "r27"
+PR = "r28"
 
 # 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...
 SRC_URI = "http://www.rpm5.org/files/rpm/rpm-5.4/rpm-5.4.0-0.20101229.src.rpm;extract=rpm-5.4.0.tar.gz \
           file://rpm-log-auto-rm.patch \
+          file://rpm-db-reduce.patch \
           file://perfile_rpmdeps.sh \
           file://rpm-autogen.patch \
           file://rpm-libsql-fix.patch \