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
8 changes: 3 additions & 5 deletions src/etc/poudriere.d/hooks/jail.sh.sample
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@
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
if [ "$status" = "mount" ] && [ -d ${POUDRIERED}/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
/bin/mkdir "${mntpath}/local-patches"
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"
/sbin/mount -t nullfs -o ro ${POUDRIERED}/local-patches "${mntpath}/local-patches"
fi

exit 0