diff --git a/src/share/poudriere/common.sh b/src/share/poudriere/common.sh index 3ab3a2ec43..6fa88515e9 100755 --- a/src/share/poudriere/common.sh +++ b/src/share/poudriere/common.sh @@ -1711,7 +1711,7 @@ get_data_dir() { # Explicitly set properties for values diverging from top dataset zfs create -p -o atime=off \ -o compression=on \ - -o mountpoint=${BASEFS} \ + -o mountpoint="$(remove_altroot ${BASEFS})" \ ${ZPOOL}${ZROOTFS} zfs create ${ZPOOL}${ZROOTFS}/jails zfs create ${ZPOOL}${ZROOTFS}/ports diff --git a/src/share/poudriere/include/fs.sh b/src/share/poudriere/include/fs.sh index 0cc745e6bf..8b4b753d27 100644 --- a/src/share/poudriere/include/fs.sh +++ b/src/share/poudriere/include/fs.sh @@ -23,6 +23,16 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. +remove_altroot() { + [ $# -ne 1 ] && eargs remove_altroot mountpoint + local mountpoint altroot + mountpoint="$1" + altroot= + [ -n "${NO_ZFS}" ] || altroot=$(zpool get -Ho value altroot "${ZPOOL}") + + echo "${mountpoint}" | sed "s,^${altroot},," +} + createfs() { [ $# -ne 3 ] && eargs createfs name mnt fs local name mnt fs @@ -37,7 +47,7 @@ createfs() { if ! zfs create -p \ -o compression=on \ -o atime=off \ - -o mountpoint=${mnt} ${fs}; then + -o mountpoint="$(remove_altroot ${mnt})" ${fs}; then echo " fail" err 1 "Failed to create FS ${fs}" fi @@ -294,7 +304,7 @@ clonefs() { zfs_to=${fs}/${name} fi - zfs clone -o mountpoint=${mnt} \ + zfs clone -o mountpoint="$(remove_altroot ${mnt})" \ -o sync=disabled \ -o atime=off \ -o compression=off \