UNIX OE from scratch: No need to always install development tools and libs
Sunday Mar 27, 2005
You may recall that one of the early steps in my building-a-system-from-scratch project was to add 31 packages on top of the foundation layer. These packages contain things like development tools and libraries which are needed to enable the pkgsrc system to do it's thing -- auto-build open-source apps from source.
But do we always need to install these 31 packages? In a real-life scenario, we probably wouldn't be doing compiles on every system. Instead there would be two types of systems: a) some build machines (or maybe just one in a small deployment), and b) some production machines. The production machines would simply be "consumers" of the binary packages built by the build machine(s).
There are two common alternatives in this scenario.
Propagating binary packages
Although pkgsrc and portage (by gentoo.org) are often referred to as "from-source" distros, they have full support for binary package management as well (installing, updating, etc.).With pkgsrc, the tool for installing binary packges is called pkg_add, and it's used like this:
# pkg_add /path/to/package.tgzor
# pkg_add ftp://path/to/package_dir/package.tgz
So it's very easy to simply install the binaries on various systems, with the build system serving as the central repository.
(By the way, pkg_add knows how to automatically solve missing dependencies when installing/updating binary packges just like a pkgsrc build-system does for source packages)
Network Filesystem Mounting
Alternatively, if we don't want to propagate the contents of /usr/pkg to every box, there's always filesystem sharing technology. For example, we can set up the pkgsrc build-server to double as an NFS or Samba server, "export" the /usr/pkg filesystem, and mount it over the network on the other machines as needed.
Bottom Line...
So getting back to those 31 packages.As described above, in a pkgsrc-supported environment, there are usually systems that are "producers" (of pkgsrc builds) and others that are "consumers".
On the consumer systems, you don't need to install any of those 31 packages!
Next I'll take yet another look at the 31 packages, and explain how, even on "producer" systems, many of them aren't really required.
Email: Eric dot Boutilier at Sun dot com










