0
votes

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<[email protected]>
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 <[email protected]>
- 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.

1
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
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
Hi, i am aware of splitting the file and stitching the file back as %post which works. But we in read in rpm documentation (rpm.org/devel_doc/large_files.html) and google.co.in/… that support upto 4GB is available in newer rpm versions. - Darshan

1 Answers

1
votes

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?