[csw-maintainers] Determining the architecture of a binary

Maciej (Matchek) Blizinski maciej at opencsw.org
Wed Jan 13 11:37:53 CET 2010


I'd like to write a new check, to make sure that the actual binaries
inside a package match the architecture declared in the pkginfo file.
Unfortunately, the file command's output is not as reliable as I'd
like it to.  For instance, on build8s, it can tell when a binary is
i386, but it doesn't say the same about an amd64 binary.

maciej at build8s [build8s]:~ > file
~maciej/src/opencsw/pkg/mysql5/branches/mysql-5.0.x/work/solaris8-i386/install-isa-i386/opt/csw/mysql5/bin/mysql
| cut -d: -f2
        ELF 32-bit LSB executable 80386 Version 1, dynamically linked, stripped
maciej at build8s [build8s]:~ > file
~maciej/src/opencsw/pkg/mysql5/branches/mysql-5.0.x/work/solaris8-i386/install-isa-amd64/opt/csw/mysql5/bin/amd64/mysql
| cut -d: -f2
        ELF 64-bit LSB executable Version 1, dynamically linked, stripped

We don't have our own, up-to-date file (or gfile), do we?

Is there a better way of determining binary's architecture? (/usr/ccs/bin/dump?)

Maciej



More information about the maintainers mailing list