[BusyBox] Unarchive applets; new code overview

Glenn McGrath,,, bug1 at optushome.com.au
Sun Jun 10 08:08:44 UTC 2001


Laurence Anderson wrote:

>Havn't looked at you patch yet, but I was thinking a while back that there 
>was a bit of code duplication, when I was writing a small cpio applet. I've 
>attached it - it should be quite easy to convert to work with your patch, 
>and the argument passing made a lot cleaner. It does its work in one pass.
>
Cool, i will check it out.

>
>On the subject of passes, you can only really have one, as pipes don't 
>allow seeking, and as people do something like [gzip -dc | tar xvf -] lots 
>and even the unrpm script in busybox uses pipes to cpio.
>
I discovered that problem when i modified gunzip, to do a second pass i 
close the pipes and reopen them from the start, then loop calling 
getchar() to seek forwards

>
>I think we do need a cpio applet (only really extract) as we have rpm2cpio 
>in busybox, but no cpio! My applet is only 3.3k - with your patch it will 
>probably be less. However most of the code should be in libbb, as a future 
>RPM applet may need to call it to extract the cpio archive. The untar 
>applet is a good idea, but can't you copy in the code from tar.c to support 
>creating archives?
>

It would be good to handle creating archives (ar, tar, cpio) in a 
consistent way as well, but i think for busybox's purposes creating 
archives would be used a lot less than extracting archives, so i havent 
placed a very high priority on it.


Glenn






More information about the busybox mailing list