Skip to content

Instantly share code, notes, and snippets.

@dlangille dlangille/jail.sh
Last active Aug 12, 2019

Embed
What would you like to do?
Hook for nullfs mounting an extra patches directory in the master jail
#!/bin/sh
# /usr/local/etc/poudriere.d/hooks/jail.sh
status="$1"
# NOTE: mount is invoked before start: re https://github.com/freebsd/poudriere/wiki/hooks
if [ "$status" = "mount" ]; then
mntpath="$2"
# The local-patches directory is created only if it does not already exist.
# If it does not already exist, it means we are doing this on the master jail
if [ ! -d "${mntpath}/local-patches" ]; then
/bin/mkdir "${mntpath}/local-patches"
fi
# mount our patches to that location
/sbin/mount -t nullfs /usr/local/etc/poudriere.d/local-patches "${mntpath}/local-patches"
fi
exit 0
The jail.sh hook can be used on conjunction with an entry in
/usr/local/etc/poudriere.d/make.conf (or similar) such as this
.if ${.CURDIR:M*/net-mgmt/nagios}
EXTRA_PATCHES+= /local-patches/webserver/nagios.patch
.endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.