I downloaded the file package (version 5.18) from

For some reasons, I needed to build this 'file' package from sources.
So on an x86 Linux machine, I built it from sources.
(Linux 2.6.18-238.5.1.el5 #1 SMP Mon Feb 21 05:52:39 EST 2011 x86_64 x86_64 x86_64 GNU/Linux)

I built the 'file' package and installed it in a private directory,

In the installation directory,
$ ls -l
drwxr-xr-x 2 user users 4096 Jun 11 14:13 bin
drwxr-xr-x 2 user users 4096 Jun 11 14:11 include
drwxr-xr-x 2 user users 4096 Jun 11 14:11 lib
drwxr-xr-x 4 user users 4096 Jun 11 08:04 share

$ ls -l share
total 8
drwxr-xr-x 6 user users 4096 Jun 11 08:04 man
drwxr-xr-x 2 user users 4096 Jun 11 14:11 misc

$ ls -l share/misc/
total 2792
-rw-r--r-- 1 user users 2847784 Jun 11 14:11 magic.mgc

The above line shows the magic number database stored in a file magic.mgc
Now to use this our own compiled 'file' command I do the following.

export MAGIC=/home/user/install/file-5.18_native/share/misc

But now, if I use the file command, I get following errors and warnings.

/home/user/install/file-5.18_native/share/misc/magic.mgc, 6: Warning: offset Firmware v' invalid /home/user/install/file-5.18_native/share/misc/magic.mgc, 6: Warning: typeFirmware v' invalid
file: could not find any valid magic files!

Could someone please clarify what could be wrong in the build process.
The libmagic sources are present in the 'file' package itself.

Thank you,

Recommended Answers

All 2 Replies

It sounds like you are compiling something that has to talk directly to hardware, hence the firmware indication. Are you sure you have the appropriate hardware for this tool? Also, what is it supposed to do?

what distro are you using? have you install the development tools packages? (if you are on fedora/redhat/centos)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.