Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Mar 2016 11:15:59 +0000
From:      Matthew Seaman <matthew@FreeBSD.org>
To:        freebsd-ports@freebsd.org
Subject:   Re: pkg: fetching binary packages to a local dumpdir for a different ABI
Message-ID:  <56E2A8EF.8000705@freebsd.org>
In-Reply-To: <56E2973C.8070703@quip.cz>
References:  <20160311104226.35a9e17d@freyja.zeit4.iv.bundesimmobilien.de> <56E2973C.8070703@quip.cz>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--gMSi12dJTH2MrgGuWPwXJUjuW7SoMGlSa
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 03/11/16 10:00, Miroslav Lachman wrote:
> O. Hartmann wrote on 03/11/2016 10:42:
>=20
> [...]
>=20
>> 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?
>=20
> It is freebsd:10:x86:64. You can look at http://pkg.freebsd.org/
> The full URL is http://pkg.freebsd.org/freebsd:10:x86:64/

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/ld-elf.so.1, 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

https://github.com/freebsd/pkg/blob/master/libpkg/pkg_elf.c#L691

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

	Cheers,

	Matthew





--gMSi12dJTH2MrgGuWPwXJUjuW7SoMGlSa
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIcBAEBCgAGBQJW4qj1AAoJEABRPxDgqeTnqO4QAJHjT+NjIBqG8COL4QDZ9g7W
JcP87zietfyHy8KXJbfBrmcSGjmXhxxsXy8Y9CDZxrBS8lRqySvl7GV2tvqwldeX
NtOS6vWdxzvglLLIBey4oJBwnFtQTA8X6nqhDCt5VQTK6UacEQp/7A6+uH+0TgYH
P26uP3lvrr5UvASpJQbAx2YF2Qv1vnO+PXn80aArNjS2EUhctHxEmAPS/V1HUcDm
Ktaz43e9/MfYZEaHow0n2fZyBb/DUkyFoZY3CovoL3ISS8pl/7HluhPcB9Vry03Z
BzY3+4WqB526loumVm0rbDtV/9lMRN1Z0ODghBGl84WZIwJWiCs+AwUwwKDG95l5
H4sW8Dv+UUzrqW6SOgjWn0QCOMxgYGXUd1OuyZyqsuEBsCc6WuHzoRsyyksEbGhG
onC8wNoYbq2m/LsRe09reZ8oQ85B9SddbjyJXvJmUCb4SfRyNWRs3si73wgOfC7A
AEP3T817Bqw7hWgqRZcJVYoSFr1BG1lu4rOGB3Z7WT9XUP5PWW0D9KPagqlNHEWA
FzbbgK/j+H0cTCFESo9/khB45ucFqVQHaj6A4pACcjWbWRDpCSOmDPJFl5X7e2kB
dkBOOLz87fLKJVgbIguaqn4KSZNgDvC0TQgya7dzKfr70q+GwZuU5Njvt4nKt/yq
PUdb1Ua6J0+qcPjTgfiX
=4uXc
-----END PGP SIGNATURE-----

--gMSi12dJTH2MrgGuWPwXJUjuW7SoMGlSa--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?56E2A8EF.8000705>