简体   繁体   中英

Change ownership in cpio archive without root

I need to add files to an initramfs file(I own the file as this is for some other device), however I do not have root permissions on my development machine. The usual way would be to unpack the initramfs, add files, change owner to root and pack again. I can not do this, as changing owner on this machine would require root permissions. If I do not change owner the system might behave weird(and it is just not a clean setup).

I can not do this on the target system as it is an embedded system, which only has read only access to the initramfs file.

Is there any way to change the permissions during or after packing the cpio archive?

Use fakeroot to deal with permissions during extraction and compression. it is developed to provide root environment without actually being root.

girishp@~/incoming$ /usr/bin/fakeroot /bin/bash
root@~/incoming$

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM