Add a small update to the FreeBSD pkg post

This commit is contained in:
R Tyler Croy 2021-02-15 12:51:55 -08:00
parent 1150419e2a
commit b091565026
No known key found for this signature in database
GPG Key ID: E5C92681BEF6CEA2
2 changed files with 28 additions and 8 deletions

View File

@ -58,11 +58,6 @@ defaults:
values:
layout: "post"
collections:
microblog:
output: true
permalink: /microblog/:year/:month/:slug/
kramdown:
input: GFM
syntax_highlighter: rouge

View File

@ -17,6 +17,9 @@ isolation between them. This approach has a pretty notable problem at first
glance: if you need to install software from remote sources in the jail, how do
you keep it "offline"?
**2021-02-14 update** with more tips [below](#update)
_Note: if you're already familiar with how great FreeBSD jails are, you can skip [ahead](#pkg)_
Without trying to start a flamewar, I think FreeBSD jails are basically what
@ -123,6 +126,28 @@ setting up and managing my heavily isolated vnet-based jails *much* easier!
---
<a name="update"></a>
**2021-02-14 update:** Here's a tip passed along from a reader:
> you might be interested in a tip for your jail post.
>
> pkg -o ABI=... \
> --chroot /path/to/jail \
> --config /some/package/repo/FreeBSD.conf \
> install -y ...
>
> where ABI could be FreeBSD:14:aarch64 (FreeBSD current on armv8/aarch64) or a more prosaic FreeBSD:12:amd64 (amd64 architecture, FreeBSD 12).
>
> the config file is similar to `/etc/pkg/FreeBSD.conf` and is acquired by `pkg(8)` before dropping into the chroot.
>
> NB I usually need to mount_devfs inside the jail before & after pkg, as it now requires /dev/null - see [#1763](https://github.com/freebsd/pkg/issues/1763)
>
> This allows us to install packages into a directory that is not for the same FreeBSD version (and possibly even architecture!), such as a FreeBSD 13.0 armv8 nfs mount, running on a FreeBSD 14.0-current amd64 server.
>
> There's also pkg --rootdir ... which is similar to chroot, but IIRC handles pre/post/user/group scripts differently.
---
In the future I hope to write more about the home lab FreeBSD set up that I
have been working on over the past couple weeks. FreeBSD 12.x is by far the
most exciting FreeBSD release I have used since the transition to full SMP in