Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Aug 2021 15:57:14 +0200
From:      Emmanuel Vadot <manu@bidouilliste.com>
To:        Andriy Gapon <avg@FreeBSD.org>
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>

index | next in thread | previous in thread | raw e-mail

On Tue, 10 Aug 2021 15:47:03 +0300
Andriy Gapon <avg@FreeBSD.org> wrote:

> 
> 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.

 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.

> 
> 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
> 


-- 
Emmanuel Vadot <manu@bidouilliste.com> <manu@freebsd.org>


help

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