Questions tagged [cpio]

cpio is a general file archiver utility and its associated file format.

28 questions
4
votes
2 answers

Extract RPM to directory other than current directory

I am needing to run: rpm2cpio mypackage.rpm | cpio -idmv However, I need the output to be in a different directory. Is there a more elegant solution than doing mv after performing the extraction?
Jens Petersen
  • 189
  • 2
  • 11
4
votes
1 answer

Copy a certain file from a CPIO file to a different directory

I am trying to copy a single file from a .cpio file, to a different directory rather than the tree inside it. I am trully sure it is possible, my teacher did it. I have tried this: # cpio -i -F backup.cpio sub1/sub2/example.php But that doesn't…
MoeSzislak
  • 137
  • 1
  • 4
  • 13
1
vote
1 answer

Is there any way in Linux to check if directory tree has changed?

I'm creating a QEMU startup script in which I compile a rootfs to cpio.gz each time I launch the env. This is fine for the moment, but when the rootfs gets bigger in size, it is going to be a problem. Is there any way to check if a given directory…
m.dorian
  • 489
  • 1
  • 6
  • 24
1
vote
1 answer

Extra bytes are padding in the generated file from CPIO

I have a list of files in a directory and I want to create one archive format file. I used CPIO to create the file as ls | cpio -ov -H crc > demo.cpio and I have a cpio structure like this struct cpio_newc_header { char c_magic[6]; …
goodman
  • 424
  • 8
  • 24
1
vote
1 answer

Python - Why Am I Seeing This Output?

So I'm getting into Python and I'm writing a script to: Download an RPM using urllib.urlretrieve. Extract the files using rpm2cpio and cpio. Do some stuff with the files. Clean up using shutil.rmtree. Functionally it's all good it does do all of…
Jay
  • 456
  • 4
  • 11
1
vote
0 answers

cpio decompression and compression from buildroot

I am successfully able to create and boot a little OS generated from buildroot on my embedded system. Buildroot generates a cpio. I decompress it (a working cpio, that boot with no problem )with cpio -iv < ../rootfs.cpio in a directory. After that…
JosephITA
  • 502
  • 2
  • 11
  • 21
1
vote
1 answer

File becomes directory after rpm extraction using rpm2cpio

I am extracting a rpm package on RHEL-6.4. I am using rpm2cpio command as below: rpm2cpio package-name.rpm | cpio -u -i -d ---quiet 2>&1 The above command runs in fakeroot v1.12.4 environment. (cpio (GNU cpio) 2.10) After execution of above command…
HuntM
  • 157
  • 1
  • 7
1
vote
1 answer

linux cpio to copy directory structure and file names?

I want to copy a directory structure from a remote machine to a local machine. I want the file names too but not the content of the file. Presently I did this in the remote machine: find . -type d -print | cpio -oO dirs.cpio then copied the…
Siddharth Trikha
  • 2,648
  • 8
  • 57
  • 101
0
votes
0 answers

Modify permissions of a file generated using CPIO extract

I have a CPIO package to be extracted. It has some set of files say x1,x2,....xN. While extracting, these files are being generated with 777 permission. But I want it to be generated with 755 permission. Is there a way where I can use pipe to modify…
Ilangeeran
  • 49
  • 5
0
votes
1 answer

Cannot extract kernel source xz from c7 elrepo kernel-lt-4.4.236-1.el7.elrepo.nosrc.rpm

Please let me know what I need to do to extract linux-4.4.236.tar.xz from the rpm My goal is to extract the kernel source and repackage it for use in out build process. We use the standard pattern for this but something funny is happening with some…
Peter Kahn
  • 12,364
  • 20
  • 77
  • 135
0
votes
1 answer

Big source file (bigger than 4 GB) in rpmbuild

While trying to generate an rpm using rpmbuild version 4.11.3 including a source file of 5.7 GB I get the following error message : error: create archive failed on file /path_and_name_of_file cpio: File too large for archive I found an old…
Kevin
  • 31
  • 1
  • 7
0
votes
1 answer

Extract RPM package cpio

i am getting and error while extract rpm package which is below. I run this command many times before but this time it shows me an error. I try to run this command on Oracle Linux 7. What should i do ? rpm2cpio…
Can
  • 39
  • 6
0
votes
1 answer

"cpio: premature end of archive" when using lsinitramfs

I am trying to unpack an initramfs image obtained from an embedded system, but I get errors like cpio: premature end of archive when using any utility for unpacking the file. I'll paste the file signature and some of the things I've tried down…
snek_case
  • 339
  • 2
  • 10
0
votes
1 answer

Find all subfolders and copy their contents

Currently I have the following code for copying all folders to a new location: find /var/CommuniGate/Accounts/ -name 'Archive.folder' | cpio -pdm archiv_mount/ It works fine, but only copies the Archive.folder. How can I also copy everything that…
user3742929
  • 360
  • 3
  • 17
0
votes
2 answers

How can I repack initramfs image on RHEL7?

On RHEL 7 the initramfs image file format changed. To unpack the image the skipcpio is needed. for example /usr/lib/dracut/skipcpio /boot/initramfs-3.10.0-957.el7.x86_64.img | gunzip -c | cpio -idmv I succeeded to unpack the image with the command…
Oded
  • 31
  • 6
1
2