From nobody Tue Aug 10 12:47:03 2021 X-Original-To: freebsd-pkg@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1E1031751CE3 for ; Tue, 10 Aug 2021 12:47:18 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4GkXlk3XjFz4YXh; Tue, 10 Aug 2021 12:47:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: (Authenticated sender: andriy.gapon@uabsd.com) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 15421C0003; Tue, 10 Aug 2021 12:47:05 +0000 (UTC) To: freebsd-pkg@FreeBSD.org From: Andriy Gapon Subject: pkg installation into non-default location Message-ID: <8b76441a-e52f-9321-bb9c-65b75e9e8908@FreeBSD.org> Date: Tue, 10 Aug 2021 15:47:03 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.12.0 List-Id: Binary package management and package tools discussion List-Archive: https://lists.freebsd.org/archives/freebsd-pkg List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-pkg@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4GkXlk3XjFz4YXh X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:29169, ipnet:217.70.176.0/20, country:FR]; local_wl_from(0.00)[FreeBSD.org] X-ThisMailContainsUnwantedMimeParts: N I noticed at least three way of installing a package under "alternative root". One of them is very straightforward, but for two other I am not sure about details. I guess, I can get them all from the source code, but maybe someone would be kind to give me a summary. So, the obvious way is to use pkg with -c or -j option. In this case pkg just chroot-s or jexec-s before doing anything. So, conceptually everything is like the normal operation, but in the chroot or the jail. Then, there is -r option: -r ⟨root directory⟩, --rootdir ⟨root directory⟩ pkg will install all packages within the specified ⟨root directory⟩. It's not entirely clear what that means and when that can be useful. In other words, why this option exists if we already have -c and -j. Finally, pkg add has (deprecated) --relocate option: --relocate location Annotates the package as having been relocated to location, which is an alternate system root. This is an experimental feature and intended for cross-architecture package management. There is no corresponding single letter option. (DEPRECATED) Again, not completely clear how this works. E.g., can the same package be pkg-add-ed multiple times with different --relocate locations (or without the option) ? How would pkg -r /some/path add differ from pkg add --relocate /some/path ? Asking for a friend who encountered all three variants within a certain (closed source) image building system :-) Thank you! -- Andriy Gapon