Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Aug 2020 17:28:26 +0100
From:      Matthew Seaman <matthew@FreeBSD.org>
To:        freebsd-questions@freebsd.org
Subject:   Re: Jail question: packages with relative symlinks
Message-ID:  <2eb62151-38b5-5e63-43a1-5cac1967b681@FreeBSD.org>
In-Reply-To: <7c3ad6a6-5ff1-5816-dc23-83d80590baac@kicp.uchicago.edu>
References:  <f3636f36-b6ce-3e8a-878a-bf8d5f75144d@kicp.uchicago.edu> <24d244da-43e4-9a5e-e940-3f183bc5a50e@holgerdanske.com> <9127e9ca-c6be-d007-bd82-fdf7c5508242@kicp.uchicago.edu> <7c3ad6a6-5ff1-5816-dc23-83d80590baac@kicp.uchicago.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--KQf1JI2RnRDUndD5xrh7q9RfdoYquY9Hm
Content-Type: multipart/mixed; boundary="lCZZwj0gdB2sOrXURdEhItQ1CvJl5jcLS"

--lCZZwj0gdB2sOrXURdEhItQ1CvJl5jcLS
Content-Type: text/plain; charset=utf-8
Content-Language: en-GB
Content-Transfer-Encoding: quoted-printable

On 25/08/2020 22:30, Valeri Galtsev wrote:
> I probably didn't explain things detailed enough.
>=20
> my jail has its root in:
>=20
> /jail/[jailname]
>=20
> so all what is inside jail on host filesystem is visible as:
>=20
> /jail/[jailname]/s/etc
> /jail/[jailname]/etc --> s/etc
> /jail/[jailname]/usr
> /jail/[jailname]/s/usr-local
> /jail/[jailname]/usr/local --> ../s/usr-local
> ...
>=20
> the
>=20
> /jail/[jailname]
>=20
> is base system mounted read-only (with symlinks etc pointing to s/etc,
> and others which point to a single place
>=20
> /jail/[jailname]/s
>=20
> which is mounted read-write, and this is the only place inside jail
> which=C2=A0 is read-write. This is the wonderful idea which inside jail=
 makes
> base system read-only. And it is convenient, as you maintain only one
> base system (of given version) for all jails. And as you correctly said=
,
> chroot is used (in addition to other things), so inside jail what on
> host is /jail/[jailname]/ is plainly /
>=20
> I hope, this provides enough detail to un-confuse things (and the need
> of symlinks when one sets up jails "by the book", meaning FreeBSD Handb=
ook)
>=20
> Valeri

There's a '--relocate' flag to pkg-add(8) which almost does what you
want.  The idea is that it allows you to prepend an arbitrary path to
the location where the package is installed.  In your case, that would
mean running

 pkg add --relocate /jail/[jailname]  some-package

However I'm not sure how well that works for installing the same package
in several different jails, or in your jail and in the host system --
you might need to play games with using several different $PKG_DBDIR setu=
ps.

Also, it only works with pkg-add(8), not pkg-install(8) or
pkg-upgrade(8).  It is an experimental feature intended for use in
cross-installing packages for a small appliance by mounting its drive
onto a larger and more capable machine.

	Cheers,

	Matthew

=09


--lCZZwj0gdB2sOrXURdEhItQ1CvJl5jcLS--

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

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

iQKTBAEBCgB9FiEEGfFU7L8RLlBUTj8wAFE/EOCp5OcFAl9GjapfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDE5
RjE1NEVDQkYxMTJFNTA1NDRFM0YzMDAwNTEzRjEwRTBBOUU0RTcACgkQAFE/EOCp
5Of0JQ//awsGX3Bti13wriz2HISh0mXtf8Vz0NztAQ5dpqamU8FAb0faCxFQkGGd
KKWq89i42kp7jDf+ctvmwu7si14N/eqkq3axt6isFDGgfyb+AgWEUmY7lsJKcExQ
iiHuGDvHJ6Uio2LRRVN31wKfKgfXvsBilArXGF8DQ7EnfSKpCoxAA0yU+bA7R/jN
YTB8p3lDPYXv8n9I7uAlQBkeyjcGkiM/owXdWSnK6xK3/FgrzBTXg4AkQnWircMt
eZfj+GTx3YPpY5SgNyJjcFo0SvXeVjEOVqKW84CUo7vPXK7rxCDSB0G2GQilmjIS
iU2/8QM/aXKbmGiJOb8amWZ/r5qra+gEF6bBeiBq/v74uR3UYO0Lc5x+mUvYLY9z
tFvEai+z7moOQqMcle263ABWcASYPXLRYiM5DssVqDn/yEzzilGKKAUaC1lPm72I
aFJRilwLIlpo8DW91bSOqTl6r93Lp2QbfklFne8HUSohR34M3fgxO9oVNUYZOooH
BoVkyvt3qkmC/pjpu9J6w8mzPTC+LpopJ7kz5fPXu+V9u+8/hHg2pOXvQ0xnDwyc
DVaEEzyhtSUZnnPR88BdUKJAGkurJeMvyqYSaghIlSIrHtq4plwQfJk4S8r3JZSH
plzfsSC5TQWZH7yZj58XJ0AH5C+XePAt3a9fSDegUOBTiTYOwG8=
=VlUK
-----END PGP SIGNATURE-----

--KQf1JI2RnRDUndD5xrh7q9RfdoYquY9Hm--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2eb62151-38b5-5e63-43a1-5cac1967b681>