Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A hook for mounting an extra-patches directory into the jail #928

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
20 changes: 20 additions & 0 deletions src/etc/poudriere.d/hooks/jail.sh.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/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" ] && [ -d /usr/local/etc/poudriere.d/local-patches ]; 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
dlangille marked this conversation as resolved.
Show resolved Hide resolved

# mount our patches to that location
/sbin/mount -t nullfs -o ro /usr/local/etc/poudriere.d/local-patches "${mntpath}/local-patches"
dlangille marked this conversation as resolved.
Show resolved Hide resolved
fi

exit 0