Tiny Core Linux

Tiny Core Base => TCB Bugs => Topic started by: vitex on January 01, 2010, 03:39:44 PM

Title: Busybox cpio does not implement "passthrough" mode correctly (See Update)
Post by: vitex on January 01, 2010, 03:39:44 PM

UPDATE:

I seem to have stumbled upon an implementation difference between the GNU and Busybox versions of cpio.  They seem to behave the same if given file names that do not begin with "/".  For example,


Code: [Select]
( cd / ; echo etc/hostname | cpio -p -d /tmp/test )

works with both versions while
 
Code: [Select]
( cd / ; echo /etc/hostname | cpio -p -d /tmp/test )

works with GNU cpio but not Busybox cpio.


The following script was executed after booting the Micro Core 2.7 ISO:

Code: [Select]
tce-load -w -i cpio.tcz
echo
ls -l /bin/cpio
for program in /usr/local/bin/cpio /bin/cpio ; do
   echo
   echo === $program ===
   rm -fR /tmp/test
   echo /etc/hostname | $program -p -d /tmp/test
   ls -lR /tmp/test/etc
 done

GNU cpio (/usr/local/bin/cpio) copies /etc/hostname to /tmp/test/etc/hostname as expected, but Busybox cpio (/bin/cpio) does not:

Code: [Select]
lrwxrwxrwx    1 root     root            7 Jan  1 22:54 /bin/cpio -> busybox

=== /usr/local/bin/cpio ===
1 block
/tmp/test/etc:
-rw-r--r--    1 tc       staff           4 Jan  1 23:21 hostname

=== /bin/cpio ===
cpio: /etc/hostname not created: newer or same age file exists
1 blocks
ls: /tmp/test/etc: No such file or directory
Title: Re: Busybox cpio does not implement "passthrough" mode correctly
Post by: ^thehatsrule^ on January 02, 2010, 01:03:45 PM
Is this used in TC's base?

Try the latest busybox version.  If it still occurs, report it upstream to their developers.
Title: Re: Busybox cpio does not implement "passthrough" mode correctly
Post by: vitex on January 02, 2010, 05:01:34 PM
I built the latest version of busybox and encountered the same behavior, so it is not a TC problem.
Title: Re: Busybox cpio does not implement "passthrough" mode correctly
Post by: Frank on January 03, 2010, 01:18:47 AM
If we are talking about "busybox-1.14.3.tgz" as available on http://distro.ibiblio.org/pub/linux/distributions/tinycorelinux/2.x/release/src/ , then it is a switched-off configuration option.

See the ".config" file from August 25 inside the .tgz archive. It has the following entries for cpio:

CONFIG_CPIO=y
CONFIG_FEATURE_CPIO_O=y
# CONFIG_FEATURE_CPIO_P is not set

The third line determines "Support for passthrough mode," and it is disabled.
Title: Re: Busybox cpio does not implement "passthrough" mode correctly (See Update)
Post by: vitex on January 03, 2010, 06:36:48 AM
See the original message for a clarification.
Title: Re: Busybox cpio does not implement "passthrough" mode correctly (See Update)
Post by: ^thehatsrule^ on January 03, 2010, 07:45:08 PM
vitex: might be still worth mentioning to the busybox devs if you haven't yet

Frank: a newer config might need to be uploaded
Title: Re: Busybox cpio does not implement "passthrough" mode correctly (See Update)
Post by: roberts on January 03, 2010, 09:39:04 PM
I have uploaded the config used by busybox-1.14.3 for Core.
http://distro.ibiblio.org/pub/linux/distributions/tinycorelinux/2.x/release/src/busybox-1.14.3-config
Passthru was enabled for our build.