Tar/gzip Commands: Busybox vs. GNU (error: Invalid magic)

Isaac Dunham ibid.ag at gmail.com
Thu Mar 19 23:23:25 UTC 2015


On Thu, Mar 19, 2015 at 07:34:18PM +0000, Chen, Simon (N-DCR SYSTEM 
HOUSE) wrote:
> Hi,
> 
> I am working on an embedded OS called YOCTO, which apparently 
> includes BusyBox into its build. YOCTO is currently running on a target 
> board, and I am trying to integrate an AMD Radeon E8860 GPU into it. 
> This requires installation of a driver called "fglrx", otherwise also 
> known as AMD Catalyst. The driver installer (which is a .run) uses 
> BusyBox "gzip -cd" and "tar" commands to extract an undisclosed 
> internal file, which returned the error message "Invalid magic." This 
> does not happen when I try running the driver installer on a desktop 
> UBUNTU OS, which uses GNU. I was wondering what the key differences 
> between GNU's and Busybox's extraction functions were, and what I could 
> do to fix this error.

0) You may do better asking in a Yocto forum/list than here.
Wherever you ask, tell the versions of Busybox, Yocto, and fglrx
involved.

1) A ".run" file is a self extracting archive, of similar sort to what
shar makes; however, it is unlikely that you could extract it with
unshar. You might be able to edit it (use a copy, not the original.)

2) "Invalid magic" means that gzip is getting non-gzip data, or tar
is getting a compressed archive, or some such thing.
I've seen this happen when gzip gets passed a filename not ending with
".gz", and the output goes to tar; if a name ending in ".tgz" is used
as a temporary file, busybox gzip may act like "cat" and send still-
compressed data to stdout.
I do not remember which version of Busybox this affected off the top
of my head, but it was relatively recent (I think it has been solved
though).
The workaround I used was to redirect stdin to read from the file:
- gzip -dc FILE
+ gzip -dc < FILE

3) While I don't remember what it is, I know that fglrx has an option
that will create archives raher than installing the driver.
This may be your best bet.

> Thanks,
> Simon Chen

HTH,
Isaac Dunham


More information about the busybox mailing list