BSDStore
менеджмент и репозиторий FreeBSD клеток

Attention! I apologize, but it is automatic machine translation of the text. You can improve it if will send to me more correct version of the text or fix html pages via GITHUB repository.

Building and upgrading bases


commands:

% cbsd csup
% cbsd buildworld
% cbsd installworld
remark: by the "world" will be meant as the catalog containing full copy/hierarchy of FreeBSD OS files.

For creation of a new jails (or the start jails which world is mounted in RO required), the copy of base is necessary. Below steps for getting the initial FreeBSD sources from SVN repository of the project (http://svn.freebsd.org), its compilation and installation in the separate directory which will act as base are described. These actions can be demanded, if you don't want to use already builded version available on resources ftp://ftp.freebsd.org and http://bsdstore.ru (for example security reason. It is untrusted resource), which can be received via cbsd repo command. Also, building by hands it is possible to get not only releases, but also intermediate branches variants.

buuilding or updating consists of three steps:

1) Receiving or updating of the initial FreeBSD source code through cbsd csup:

Receiving or updating of an source code for that FreeBSD version at which in the moment works the current node:

% cbsd csup
Receiving or updating of an source code for the concrete FreeBSD version, for example, for 9.2:

% cbsd csup ver=9.2
Receiving or updating of source code for STABLE (for example, for RELENG_9):

% cbsd csup ver=9 stable=1
These commands, at existence of source code in SVN, will fill catalogs $workdir/src/src_$ver

2) Compilation of source code via cbsd buildworld:

The result received from a step 1, can be used for world compilation. World compilation, at existence $workdir/src/src_$ver dir for current node version:

% cbsd buildworld
Thus, objective files, at existence from the last build, won't be cleaned (make clean). If in the repeated builds there was a unsuccess, it is meaningful to force to clean old system .o-files with clean params:

% cbsd buildworld clean=1
By default, multiline assembly, where number of jobs equally to number of cores (sysctl -n hw.ncpu). The num ofr parallel jobs is regulated through the maxjobs parameter, for example, for build in one job:

% cbsd buildworld maxjobs=1
At compilation, the personal src.conf(5) can be used , in which it is possible to specify standard KNOBS-y. The src.conf file should placed in the catalog $workdir/etc/ and have name src-basename.conf, where basename - any name of configuration. For example, in default cbsd installation there are files /usr/jails/etc/src-lite.conf and /usr/jails/etc/src-pxe.conf. For world build with certain src.conf, it is necessary to specify basename parameter:
% cbsd buildworld basename=lite
The next operation over building result (installworld), also should contain basename= parameter, as the result of building will be placed in $workdir/basejail/base_$basename_$arch_$ver directory, where $basename - is name of configuartion.

Other params of buildworld:

  • ver - to specify the concrete version of source code
  • arch - build for concrete architecture
  • stable - build for RELENG_X branch

3) world installation via cbsd installworld:

The result received from a step 2, it is possible to use for installation of the new world in ${workdir}/basejail/base_* directory, from where it will be already mounted in the RO mode, or to be formed a new jails. For install of files for the current version of system:
% cbsd installworld
Installation of files for version 9.2 builded with src.conf named as lite:
% cbsd installworld basename=lite ver=9.2
other params for installworld:

  • arch - install for concrete architecture
  • stable - install for RELENG_X branch

    When you have the world in ${workdir}/basejail,you can go to the jail creation.