0

The rpm package which i created takes long time to install. It contains only database file of Berkely db format and size 2.2GB.

Below is my RPM spec

#AutoReq: no
AutoReqProv: no
%define PYTHON /usr/bin/python
%define RPM_BUILD_DIR %{_topdir}/BUILD
%define RPM_BUILD_ROOT %{_topdir}/tmp
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')

%define _source_payload w0.gzdio
%define _binary_payload w0.gzdio

#
Summary:   Prefixcat db package
Name:      prefixcat
Version:   %{VERSION}
Release:   %{RELEASE}
Source:    %{_sourcedir}
BuildRoot: %{_tmppath}/%{name}
License:   internal-only
Distribution: WR Linux
Vendor:    XXX xxx
Packager: XXX xx<xxx@xxx.com>
Group:     Test/Applications
#BuildArch: x86_64

%description
Prefixcat db

#%prep

#%build

%install
mkdir -p %{buildroot}/data/db/wbrs/factory/db
cp -r %{_sourcedir}/data/db/wbrs/factory/db/prefixcat_db %{buildroot}/data/db/wbrs/factory/db

%clean
%{__rm} -rf %{buildroot}

%pre

%post
echo "Prefixcat DB installed successfully in /data folder"


%files
%defattr(-,admin,root,-)
/data

%changelog
* Tue Aug 01 2017 Sudharsan C <xxx@xxx.com>
- Create prefixcat db as a seperate rpm

rpm ivh prefixcat-1.1.100.x86_64.rpm, takes almost 15mins to install.

Also the above command causes this error

error: unpacking of archive failed on file /data/db/wbrs/factory/db/prefixcat_db;59818e12: cpio: read failed - Bad file descriptor

Any help on how to compress the size and install faster?

Fyi:- i am building this rpm on CentOS7 and installing on windriver 8. RPM version is same across both OS.

Darshan
  • 94
  • 1
  • 8
  • I am more worried about the rpm install error than the time it takes to install, root@xxx:~# rpm -ivh /home/prefixcat-10.1.1-102.x86_64.rpm Preparing... ########################################### [100%] 1:prefixcat ########################################### [100%] error: unpacking of archive failed on file /data/db/wbrs/factory/db/prefixcat_db;59819882: cpio: read failed - Bad file descriptor – Darshan Aug 02 '17 at 09:22
  • EBADF is misleading: it happens to be what is in errno when the error occurs. You are almost certainly running over the limit (if 2.2Gb of files) that can be put into the cpio payload and rpm package. Split the data into additional sub-packages (likely using file manifests). Add a "task package" that Requires: each of the sub-packages if you want to install the entire set of files using a depsolver. – Jeff Johnson Aug 07 '17 at 04:22
  • Hi, i am aware of splitting the file and stitching the file back as %post which works. But we in read in rpm documentation (http://rpm.org/devel_doc/large_files.html) and https://www.google.co.in/search?q=rpm+bug+with+bigger+files&rlz=1C1CHBD_enIN734IN734&oq=rpm+bug+with+bigger+files&aqs=chrome..69i57.8321j0j4&sourceid=chrome&ie=UTF-8 that support upto 4GB is available in newer rpm versions. – Darshan Aug 08 '17 at 05:35

1 Answers1

1

If the target architecture is 32-bit you might be running into a 2GB file size limit. What is the target architecture and root filesystem type?

EDIT: Since you are using a 64-bit kernel a 2GB limit is far less likely.

Have you verified (with sha256sum or similar) that the .rpm file on the remote system matches the file on your development system?

madscientist159
  • 550
  • 4
  • 12
  • Target architecture: 64bit, Output of #uname -a //Linux xxx-4.1.21-WR8.0.0.10_standard #1 SMP PREEMPT Fri Jul 21 23:50:45 IST 2017 x86_64 x86_64 x86_64 GNU/Linux – Darshan Aug 02 '17 at 09:12
  • SHA is same across both location. I dont think its the problem – Darshan Aug 03 '17 at 13:17