pkg: fetching binary packages to a local dumpdir for a different ABI

Matthew Seaman matthew at
Fri Mar 11 11:16:17 UTC 2016

On 03/11/16 10:00, Miroslav Lachman wrote:
> O. Hartmann wrote on 03/11/2016 10:42:
> [...]
>> The ABI is also unclear. Some documents say it is freebsd:10:x86:64
>> (which
>> looks more the Intel/Linux dominated terminology) and also this one is
>> considered correct: FreeBSD:10:amd64 (looks more FreeBSD'ish). It is
>> said that
>> the variable ABI is derived from "sh" - how?
> It is freebsd:10:x86:64. You can look at
> The full URL is

Actually, ${ABI} *used* to be freebsd:10:x86:64.  It changed to
FreeBSD:10:amd64 quite some time and numerous releases of pkg(8) ago now.

The ABI is usually determined by examining the binary of /bin/sh --
chosen because /bin/sh is likely to be present even on the most cut-down
jail.   It works vaguely similarly to the way file(1) does:

% file /bin/sh
/bin/sh: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD),
dynamically linked, interpreter /libexec/, for FreeBSD 10.2
(1002509), stripped

although there's no common code history between file(1) and pkg(8).  If
you feel like reading some C code, look at

-- the functions pkg_get_myarch_elfparse() and pkg_get_myarch() at line
964 are what does the job.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the freebsd-ports mailing list