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
18 changes: 18 additions & 0 deletions src/etc/poudriere.d/hooks/jail.sh.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/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 ${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
/bin/mkdir -p "${mntpath}/local-patches"

# mount our patches to that location
/sbin/mount -t nullfs -o ro ${POUDRIERED}/local-patches "${mntpath}/local-patches"
fi

exit 0