Using portupgrade inside jails with readonly ports mounted

The ports are mounted with mount_nullfs.

M=”/sbin/mount_nullfs -o rdonly /jailsata/PORTS/ports ”
$M /afs1/JAIL/Somejail1/usr/ports

In all jails there is a /etc/make.conf with in it
# jail
WRKDIRPREFIX = /var/tmp
PORTS_INDEX = /var/tmp/INDEX
DISTDIR = /var/tmp/distfiles
This make the ports work inside the jail with the ports collection mounted readonly.

Edit /usr/local/etc/pkgtools.conf
Use this setting;

module PkgConfig
ENV[’PORTSDIR’] ||= ‘/usr/ports’
ENV[’PORTS_INDEX’] ||= ENV[’PORTS_DBDIR’] + ‘/INDEX’
ENV[’PORTS_DBDIR’] ||= ‘/var/ports/db’
ENV[’PKG_DBDIR’] ||= ‘/var/db/pkg’
# a lot lower in the file!
#ENV[’PACKAGES’] ||= ENV[’PORTSDIR’] + ‘/packages’
#ENV[’PKG_PATH’] ||= ENV[’PACKAGES’] + ‘/All’
ENV[’PKG_BACKUP_DIR’] ||= ENV[’PKG_PATH’]

And make the dir with mkdir -p /var/ports/db

Leave a Reply