Introduction
Since all Vesta build steps take place in an encapsulated file system, the basic files needed to perform builds such as compiler binaries and shared libraries must be checked into Vesta as sources. Our general approach to this has been to create a set of OS component or just component packages, each of which provides a partial root filesystem.
See std_env/OsComponentSpec for a definition of what makes an OS component.
pkg2vesta
Most modern operating systems use some sort of component packaging system. For example, many Linux systems use either the the RedHat package manager or the Debian package manager. If possible, it's probably easiest to use the OS component packaging systems granularity.
With a little scripting, the process of importing these OS components can usually be automated. For this purpose, we've developed a Perl script called pkg2vesta.pl which can import RPMs, Debian packages, and Tru64 subsets into Vesta packages. You can find it in this package (which is available for replication from pub.vestasys.org):
It has embedded documentation which you can read by invoking it with either the --help or --man command-line flags.
% pkg2vesta.pl --help Usage: pkg2vesta.pl [--test] [--verbose] [--vhost <hostname>] [--rsh <command>] [--alias <name>] [--preinstall <command string>] [--postinstall <command string>] [--package-root /vesta/example.com/...] [--package-pattern <pattern>] <package> [<package2> ...] Options: ... % pkg2vesta.pl --man PKG2VESTA(1) User Contributed Perl Documentation PKG2VESTA(1) NAME pkg2vesta.pl - Import an OS component package (e.g. a Debian package archive or RPM) into a Vesta package which provides its files for use in building an encapsulated filesystem for tool invocations. SYNOPSIS pkg2vesta.pl [--test] [--verbose] [--vhost <hostname>] [--rsh <command>] [--alias <name>] [--preinstall <command string>] [--postinstall <command string>] [--package-root /vesta/example.com/...] [--package-pattern <pattern>] <package> [<package2> ...] DESCRIPTION ...
You will need to either use the --package-root flag or set [pkg2vesta.pl]package-root in your vesta.cfg file.
Usually you provide an un-installed package file (a .rpm or .deb file).
You may also be able to supply an installed package name and use the --from-installed flag to copy the installed files from the operating system. Note that this may not get you a pristine copy of the files in the package, as they could have been modified after installation. Also note that this option isn't implemented for all packaging systems.
If necessary, pkg2vesta.pl will:
- Create a directory hierarchy based on the OS, CPU type, and vendor
- Create a package for the specific component
- Create a branch for the version of the component
- Check out the branch
If it's already checked out, pkg2vesta.pl will re-populate the existing working directory
You may want to use the --test option first to see what pkg2vesta.pl will do.
Example
Here's how /vesta/vestasys.org/platforms/linux/debian/i386/components/gcc-3.3/1:3.3.5-13/1 was imported:
pkg2vesta.pl --package-root /vesta/vestasys.org gcc-3.3_3.3.5-13_i386.deb
(Of course the file gcc-3.3_3.3.5-13_i386.deb was present in the directory when that command was run.)
Other Methods
You can of course create a component package any way you like. As long as they follow std_env/OsComponentSpec, ./build_root and other parts of std_env will be able to use them.
Other Packaging Formats
Some people use tools that are packaged in some other way than the systems that pkg2vesta.pl supports. You should consider extending pkg2vesta.pl, or if that's not feasible for some reason writing your own script to automate the process.