Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Mar 2023 16:04:22 -0800
From:      Mel Pilgrim <list_freebsd@bluerosetech.com>
To:        Dan Langille <dan@langille.org>
Cc:        ports@freebsd.org, questions@freebsd.org
Subject:   Re: How do I determine the ABI string used by pkg?
Message-ID:  <e21a76b6-8f91-754e-d655-9f469ecc28f1@bluerosetech.com>
In-Reply-To: <257260d9-1812-3ce5-5d9a-907e2b1ec13e@langille.org>
References:  <32d2e376-3f89-0588-316d-801d4cbf0b44@bluerosetech.com> <20230306075622.xfzs33fmflc2vmtb@aniel.nours.eu> <257260d9-1812-3ce5-5d9a-907e2b1ec13e@langille.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2023-03-07 9:09, Dan Langille wrote:
> Baptiste Daroussin wrote on 3/6/23 2:56 AM:
>> On Wed, Mar 01, 2023 at 11:50:13PM -0800, Mel Pilgrim wrote:
>>> I need to determine the ABI string pkg uses on a given system, and need to
>>> do so when there are no pkgs installed.
>> pkg config ABI
>> pkg config ALTABI
> 
> When run in a freshly-created jail:
> 
> [r730-01 dvl ~] % sudo jexec empty_tester
> root@:/ # pkg config ABI
> FreeBSD:13:amd64
> root@:/ # pkg config ALTABI
> freebsd:13:x86:64
> root@:/ #
> 
> Mel: I think this is what you wanted to get?

Your freshly-created jail has pkg installed.  `pkg config ABI` only 
works if pkg has been bootstrapped.

Getting the ABI string with just the /usr/sbin/pkg stub available is 
another thing entirely, even though that stub program necessarily has 
the code to determine the ABI string.  I ended up writing a small 
program that replicates the ELF-divining logic in pkg and prints the 
value of ABI.

IMO the stub should have the `pkg config ABI` functionality added to it, 
but I'm probably alone in thinking that would be useful.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?e21a76b6-8f91-754e-d655-9f469ecc28f1>