From nobody Tue Aug 10 13:57:14 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 8897F1755E5F for ; Tue, 10 Aug 2021 13:57:17 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mail.blih.net [212.83.155.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GkZJY1RlNz4dnm; Tue, 10 Aug 2021 13:57:16 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1628603835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HXBayAtdFXLAwlah/qhC9UnZim91RKdB8Dm3tm61Bjk=; b=gK0kE9xKaOOGPKpgyc4JHp4ba5Ste7Xb6qJZ3OC20tl6qxMwDBwbNg6z/peXQmjExzFv9n 042V5tv1rcFgLkXeDFhK5opoRRaY9flDJHTGEo/+ypUzX8J9Ycu4gU2B6Q5gjfSM+mfvPm oXv+g+CIQbt+AjGur9x1jCnGPUqZM/Q= Received: from skull.home.blih.net (lfbn-idf2-1-644-4.w86-247.abo.wanadoo.fr [86.247.100.4]) by mx.blih.net (OpenSMTPD) with ESMTPSA id 2e418dc3 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 10 Aug 2021 13:57:15 +0000 (UTC) Date: Tue, 10 Aug 2021 15:57:14 +0200 From: Emmanuel Vadot To: Andriy Gapon Cc: freebsd-pkg@FreeBSD.org Subject: Re: pkg installation into non-default location Message-Id: <20210810155714.8b87aa83d4dccde70ec85dd9@bidouilliste.com> In-Reply-To: <8b76441a-e52f-9321-bb9c-65b75e9e8908@FreeBSD.org> References: <8b76441a-e52f-9321-bb9c-65b75e9e8908@FreeBSD.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.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=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4GkZJY1RlNz4dnm X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Tue, 10 Aug 2021 15:47:03 +0300 Andriy Gapon wrote: >=20 > 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. >=20 > 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. >=20 > 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. Having -r is useful for different things : - We use that for the tests so every test installation/delete is done under a specified dir. - It's also useful when creating image for a different arch than the native one. - It's also useful for pkgbase to bootstrap a system/jail/whatever as at first you will not have something to chroot/jail on. >=20 > Finally, pkg add has (deprecated) --relocate option: > --relocate location > Annotates the package as having been relocated to locatio= n, > which is an alternate system root. This is an experiment= al > feature and intended for cross-architecture package > management. There is no corresponding single letter opti= on. > (DEPRECATED) >=20 > 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= ? >=20 > Asking for a friend who encountered all three variants within a certain > (closed source) image building system :-) >=20 > Thank you! > --=20 > Andriy Gapon >=20 --=20 Emmanuel Vadot