mkjail -- create a full-system prison environment
mkjail [-c dir] [-d devs] [-s sets] pkg_dir jail_dir mkjail [-d devs] jail_dir
pkg_dir Absolute URI of packages. May be any schema supported by ftp(1) . This is the base root of the package directory hierarchy.
jail_dir Prison root. Sets are unpacked into this directory with the permissions preserved from the archive.
The mkjail script requires superuser permissions in order to operate, as it calls mknod(1) and other superuser tools.
This script can also be site-configured by also specifying site and/or sitelocal with the -s flag. This will cause siteXY.tgz and/or siteXYbasename.tgz to be extracted, where basename is the jail directory's path name (e.g., foo for /jails/foo).
If the /install.site script is specified in the jail directory, then it will be automatically executed in a chroot of the jail directory.
If pkg_dir isn't specified, mkjail assumes that it's being called after an initial installation. This changes the argument behaviour: the -d flag, to create devices, will clear the device directory beforehand. If -d isn't specified, the install.site script is (re-)executed and mkjail exits.
Fetching from an OpenBSD ftp site without a back-up cache:
# mkjail ftp://site/pub/OpenBSD /jails/openbsd
The same, but from an http site:
# mkjail http://site/pub/OpenBSD /jails/openbsd
Fetching from a remote host and caching locally:
# mkjail -c /tmp/nbsd ftp://site/pub/OpenBSD /jails/netbsd
Re-using the cache directory and adding httpd(8) support:
# mkjail -d http file://tmp/nbsd /jails/netbsd-2
The mkjail utility returns 0 on success, 1 on failure.
sysjail(3) , sjls(1) , sysjail(1) , jls(1)
The mkjail tool is a complete re-write of sysjail 1.0.4.
The mkjail script was written by Kristaps Dzonsons for the bsd.lv project.