1. Обновляем коллекцию портов:
portsnap fetch extract update
2. Обновляем дерево исходных кодов:
cd /usr/src svn checkout svn://svn0.us-west.freebsd.org/base/releng/9.2 /usr/src svn up
3. Добавляем опции в /etc/make.conf:
# CLANG CC=clang CXX=clang++ CPP=clang-cpp # This setting to build world without -Werror: NO_WERROR= # This setting to build kernel without -Werror: WERROR= # Does not set schg bit on various system files, # useful for building Jails, has security implications. NO_FSCHG=
4. Собираем мир:
make buildworld
5. Редактируем конфиг ezjail.conf:
ee /usr/local/etc/ezjail.conf ezjail_jaildir=/usr/jails ezjail_jailtemplate=${ezjail_jaildir}/newjail ezjail_jailbase=${ezjail_jaildir}/basejail ezjail_sourcetree=/usr/src ezjail_archivedir="${ezjail_jaildir}/ezjail_archives" ezjail_uglyperlhack="YES" ezjail_mount_enable="YES" ezjail_devfs_enable="YES" ezjail_devfs_ruleset="devfsrules_jail" ezjail_procfs_enable="YES" ezjail_fdescfs_enable="YES" ezjail_use_zfs="YES" ezjail_jailzfs="tank/ezjail"
6. Создаем basejail в ezjail-admin:
ezjail-admin setup -i
7. Разворачиваем шаблоны для jail:
tar xzvf own.tar.gz --directory /usr/jails/flavours
8. Разворачиваем дерево портов в basejail:
ezjail-admin update -P
9. Создаем jail в ezjail предварительно зацепив IP алиасом:
ezjail-admin create -f own -c zfs pro-voip 10.10.10.10 /usr/jails/noc/. /usr/jails/noc/./usr /usr/jails/noc/./usr/local /usr/jails/noc/./usr/local/etc /usr/jails/noc/./usr/local/etc/ssmtp /usr/jails/noc/./usr/local/etc/ssmtp/ssmtp.conf /usr/jails/noc/./etc /usr/jails/noc/./etc/make.conf /usr/jails/noc/./etc/resolv.conf /usr/jails/noc/./etc/rc.conf /usr/jails/noc/./etc/localtime 8 blocks find: /usr/jails/noc/pkg/: No such file or directory
10. Запускаем джейлы:
/usr/local/etc/rc.d/ezjail start
jls JID IP Address Hostname Path 1 10.10.10.10 pro-voip /usr/jails/pro-voip