Open dlangille opened 10 months ago
That seems to have worked, despite an issue raised here: https://github.com/mkjail/mkjail/issues/47
So far, the steps are:
sudo mkjail create -j freshports2 -v 14.0-RELEASE
freshports
jails: sudo git clone https://git.FreeBSD.org/ports.git /jails/freshports2/usr/ports
cd /usr/local/libexec/freshports/Jail
[16:36 dev-ingress01 dan /usr/local/libexec/freshports/Jail] % sudo ./copy-scripts-into-jail.sh /jails/freshports2/
This entry is required in scripts/config.sh:
FRESHPORTS_JAIL_BASE_DIR="/jails/freshports2/"
This entry is required in /usr/local/etc/freshports/config.pm
$FreshPorts::Config::JailBaseDir = ${JAILBASE}
Except, that is not the required value, since we are going to swap jails.
vars.sh
[16:40 dev-ingress01 dan /usr/local/libexec/freshports/Jail] % diff -ruN /jails/freshports/vars.sh /jails/freshports2/vars.sh.sample
[16:40 dev-ingress01 dan /usr/local/libexec/freshports/Jail] % sudo cp -ip /jails/freshports/vars.sh /jails/freshports2/
No diff, so just a straight copy.
[16:56 dev-ingress01 dan ~/modules] % date
Sun Dec 24 16:56:14 UTC 2023
[16:56 dev-ingress01 dan ~/modules] % sudo service freshports stop
Stopping freshports.
Waiting for PIDS: 7005.
[16:56 dev-ingress01 dan ~/modules] % sudo service jail stop
Stopping jails: freshports.
[16:56 dev-ingress01 dan ~/modules] % sudo zfs rename data02/freshports/jailed/dev-ingress01/jails/freshports data02/freshports/jailed/dev-ingress01/jails/freshports.old
[16:56 dev-ingress01 dan ~/modules] % sudo zfs rename data02/freshports/jailed/dev-ingress01/jails/freshports2 data02/freshports/jailed/dev-ingress01/jails/freshports
[16:57 dev-ingress01 dan ~/modules] % sudo service jail start
Starting jails: freshports.
[16:58 dev-ingress01 dan ~/modules] % zfs list NAME USED AVAIL REFER MOUNTPOINT data02 923G 798G 96K none data02/freshports 488G 798G 88K none data02/freshports/jailed 422G 798G 96K none data02/freshports/jailed/dev-ingress01 140G 798G 96K none data02/freshports/jailed/dev-ingress01/jails 138G 798G 112K /jails data02/freshports/jailed/dev-ingress01/jails/freshports 2.58G 798G 2.58G /jails/freshports data02/freshports/jailed/dev-ingress01/jails/freshports.old 136G 798G 135G /jails/freshports.old data02/freshports/jailed/dev-ingress01/mkjail 1.32G 798G 445M /var/db/mkjail data02/freshports/jailed/dev-ingress01/mkjail/14.0-RELEASE 904M 798G 904M /var/db/mkjail/14.0-RELEASE [16:59 dev-ingress01 dan ~/modules] %
Now the new jail is in place.
[16:59 dev-ingress01 dan ~/modules] % file /jails/*/bin/sh /jails/freshports.old/bin/sh: ELF 64-bit LSB pie executable, x86-64, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 13.2, FreeBSD-style, stripped /jails/freshports/bin/sh: ELF 64-bit LSB pie executable, x86-64, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 14.0 (1400097), FreeBSD-style, stripped
Then start the services back up:
[19:25 test-ingress01 dan /usr/local/libexec/freshports/Jail] % sudo service jail start Starting jails: freshports. [19:26 test-ingress01 dan /usr/local/libexec/freshports/Jail] % sudo service freshports start Starting freshports.
Ahh, I just remembered https://github.com/FreshPorts/host-init
Witness:
Instead of upgrading those jails, it might be easier to just redeploy them.
Do I already have a script for that?
Jails contain
mkjail
I found this in command history:
sudo mkjail create -j freshports2 -v 13.2-RELEASE