WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Busybox cpio does not implement "passthrough" mode correctly (See Update)  (Read 5142 times)

Offline vitex

  • Full Member
  • ***
  • Posts: 113

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
« Last Edit: January 03, 2010, 09:31:19 AM by vitex »

Offline ^thehatsrule^

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 1726
Re: Busybox cpio does not implement "passthrough" mode correctly
« Reply #1 on: January 02, 2010, 04: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.

Offline vitex

  • Full Member
  • ***
  • Posts: 113
Re: Busybox cpio does not implement "passthrough" mode correctly
« Reply #2 on: January 02, 2010, 08:01:34 PM »
I built the latest version of busybox and encountered the same behavior, so it is not a TC problem.

Frank

  • Guest
Re: Busybox cpio does not implement "passthrough" mode correctly
« Reply #3 on: January 03, 2010, 04: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.

Offline vitex

  • Full Member
  • ***
  • Posts: 113
See the original message for a clarification.

Offline ^thehatsrule^

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 1726
vitex: might be still worth mentioning to the busybox devs if you haven't yet

Frank: a newer config might need to be uploaded

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
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.
10+ Years Contributing to Linux Open Source Projects.