Archive for the 'Ports' Category

Using portupgrade inside jails with readonly ports mounted

Wednesday, May 30th, 2007

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

Using portsnap to update ports

Wednesday, May 30th, 2007

If you have freebsd 4.x or lower, you need to first install portsnap from ports.

If you have freebsd 5.x or above, portsnap comes with the base, so you don’t need to install it.

If you are using portsnap for the first type

type

portsnap fetch extract update

then after whenever you want to run portsnapt just issue the following command:

portsnap update.