Bug 857763

Summary: libguestfs 'file-architecture' returns 'ARM' for arm binaries
Product: [Community] Virtualization Tools Reporter: Richard W.M. Jones <rjones>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: NEW --- QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecified   
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Richard W.M. Jones 2012-09-16 22:16:21 UTC
Description of problem:

><fs> inspect-get-arch /dev/sda2
ARM
><fs> file-architecture /bin/ls
ARM
><fs> file /bin/ls
ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=0x1404ac2b8b93ea1fe0d5f8b065dd9c9c5550c581, stripped

Probably should be something like 'armhfp', 'arm5' etc?

Version-Release number of selected component (if applicable):

libguestfs 1.19.40

Comment 1 Maros Zatko 2015-02-20 17:34:02 UTC
Seems like we need to patch file utility. Elf file can contain a tag describing CPU architecture (TAG_CPU_name, TAG_CPU_raw_name) and/or needed extension. Howewer, these usually aren't part of ELF file since they are optional.
There is other field called Flags and its meaning is architecture specific, for 32bit ARM it contains EABI version and endianness info, so it doesn't seem to give us info we'd like to have.