Verwaltung von virtuellen Maschinen und Jails für FreeBSD

Achtung! Der deutschsprachige Inhalt ist wegen fehlenden Betreuerinnen und Betreuern veraltet. Verwenden Sie bitte die englischsprachige Version!

Attention! Current pages describe CBSD version 13.0.x. If you are using an older version, please update first.

Attention! I apologize for the automatic translation of this text. You can improve it by sending me a more correct version of the text or fix html pages via GITHUB repository.

Building and upgrading bases

General information

Commands:

			% cbsd srcup
			% cbsd buildworld
			% cbsd installworld
			% cbsd world
		

remark: "base" refers to a catalog containing a full copy/hierarchy of FreeBSD OS files.

For the creation of new jails (or starting jails which require a RO mounted base), a copy of base is necessary. Described below are the steps needed to get the initial FreeBSD sources from the project's SVN repository (http://svn.freebsd.org), its compilation and installation in a separate directory which will act as base. These actions are necessary, if you don't want to use pre compiled versions available on ftp://ftp.freebsd.org or http://bsdstore.ru, which can be retrieved with the cbsd repo command. Also, by manually building becomes possible to not only get releases, but also individual branches.

building or updating consists of the following three steps:

  • Receiving or updating of the initial FreeBSD source code through cbsd srcup: Receiving or updating of an source code for that FreeBSD version at which in the moment works the current node:
    					% cbsd srcup
    				
    Receiving or updating of an source code for the concrete FreeBSD version, for example, for 10.1:
    					% cbsd srcup ver=10.1
    				
    Receiving or updating of source code for STABLE (for example, for RELENG_10):
    					% cbsd srcup ver=10 stable=1
    				
    These commands, at existence of source code in SVN, will fill catalogs $workdir/src/src_$ver
  • Compilation of source code via cbsd buildworld: The result received from a step 1, can be used for base 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 file /usr/jails/etc/src-lite.conf. For base 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
  • Base installation via cbsd installworld: The result received from a step 2, it is possible to use for installation of the new base 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 10.1 builded with src.conf named as lite:
    					% cbsd installworld basename=lite ver=10.1
    				
    other params for installworld:
    • arch — install for concrete architecture
    • stable — install for RELENG_X branch

cbsd world command is sequence for cbsd buildworld && cbsd installworld

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