Not exactly sure how to do this but found this:-hYes, you can use the mount type nullfs in /etc/fstab.jail. Before you have to create the directory in the jail because it does not exist by default.
/var/cache/pkg /jails/myjail/var/cache/pkg nullfs ro 0 0
/var/cache/pkg /usr/jails/fox/var/cache/pkg nullfs rw,late 0 0
Is this defined in /etc/fstab or /etc/fstab.myjail ?hSorry, I should have provided my example already.
The late parameter is related to mount parameter "-a", "-l" and "-L" for mounting after boot. May be is is ok not to use the late option. With the option "rw" instead of "ro" packages downloaded by pkg within the jail appear in the common repository /var/cache/pkg. With the option "ro" it should not be possible to store downloaded packages in case pkg is called from the jail. I have not tested that but I think so.Code:/var/cache/pkg /usr/jails/fox/var/cache/pkg nullfs rw,late 0 0
I have never tried that. There is also the question why and what to do with the compilation result.Just following on from this principle, can I create a 'build' jail where the jail accesses /usr/src/ on the host without needing such a directory in the jail?
You can even mount it read-only as the build(7) process won't write anything to /usr/src/. Intermediate files and compiled results are stored in /usr/obj/ (or wherever MAKEOBJDIRPREFIX is pointing to).Just following on from this principle, can I create a 'build' jail where the jail accesses /usr/src/ on the host without needing such a directory in the jail?