The Sample Implementation is an important part of the LSB, both for
testing applications, and as a basis for a stand-alone build
environment that isn't reliant on lsbcc.
In recent years, building the old Linux From Scratch SI has become
progressively more difficult, as the LFS project has changed gears and
moved on from the tools we currently use. The 3.2 SI is severely
delayed because of these problems.
It was decided that the 4.0 SI should be based on an entirely new
toolset: the rPath's [http://www.rpath.com/] Conary
[http://wiki.rpath.com/wiki/Conary] and rMake
[http://wiki.rpath.com/wiki/rMake] frameworks. This will be an
entirely new way of building the SI, starting from scratch and porting
over little pieces of the old LFS SI as needed into the new framework.
Putting it short, Conary is an open source distributed software
management system for Linux distributions. Conary replaces existing
software package management solutions with features developed to
address some of the common problems in package management. Conary
features software installed and maintained from networked
repositories. With dependencies defined at the file level, Conary's
built-in dependency resolution brings in only the components needed
from other packages instead of entire packages.
rMake facilitates building (conary) packages consistently across
computers with dissimilar environments.
Some of the rMake strenghts include the following:
* Consistent Build Environment: rMake provides developers with
assurance about what software is installed in the build
environment used to develop packages and groups. Without this
assurance, a developer using local build environments may have
certain libraries, for example, installed on one build machine
and not on another, resulting in different builds from each.
* Build Against Specified Group: rMake can ensure that developers
are using the correct versions of a set of packages or
group. For example, rMake can help a developer wanting to build
specifically against version 1.0 of an appliance.
* Build and Test Binaries Before Committing Source: rMake lets
developers build and test a binary before committing the
source. This includes the option to build a set of binaries to
ensure they work together before committing any of them.
* Package Order Handling: rMake will build multiple packages in
the appropriate order according to their dependencies upon each
other.
--
SI structure
Given that the stated goal of the 4.x SI implementation is to have a
generic, scalable and abstract way of portably building the whole SI,
on any of the LSB target architectures:
* x86
* x86_64
* ppc
* ppc_64
* s390
* s390x
* IA64
we start by (cross) building from any of them, a bootstrap of our
desired toolchain, targeting the desired arches. This will get us the
LSBsi toolchain, plus conary (and its dependencies - basically python
stuff). All this is done thru rMake, with the workflow controlled via
a special kind of conary recipe - a group recipe.
At low level what is done is just building a cross-gcc and
cross-binutils targeting (building) host's architecture, and, after,
with them cross-build our custom glibc. From there cross-build
anything.
Once built, and commited, the resulting group, queried from the
command line will look like...
conary rq --context lsb4 --recurse 'group-LSBsi-bootstrap-stage' --all-flavors --labels
group-LSBsi-bootstrap-stage=conary.works@lsb:3.9.7/20081002-7-1[~bootstrap,cross,~group-LSBsi-stages.bootstrap is: x86(i486,i586,i686,sse,sse2) target: x86(~cmov,i486,i586,i686,~mmx,~sse,~sse2)]
MAKEDEV=conary.works@lsb:3.9.7/3.23-4-19[is: x86]
bash=conary.works@lsb:3.9.7/3.2.10-7-18[~bootstrap is: x86]
binutils=conary.works@lsb:3.9.7/2.17.50.0.6-16-1[~bootstrap,~!cross is: x86]
bzip2=conary.works@lsb:3.9.7/1.0.5-3-18[~bootstrap is: x86]
bzip2-extras=conary.works@lsb:3.9.7/1.0.5-3-18[~bootstrap is: x86]
conary=conary.works@lsb:3.9.7/2.0.23-1-3[~bootstrap is: x86]
conary-build=conary.works@lsb:3.9.7/2.0.23-1-3[~bootstrap is: x86]
conary-policy=conary.works@lsb:3.9.7/1.0.22-1-1[is: x86]
conary-repository=conary.works@lsb:3.9.7/2.0.23-1-3[~bootstrap is: x86]
coreutils=conary.works@lsb:3.9.7/6.9-7-17[~bootstrap is: x86]
cpio=conary.works@lsb:3.9.7/2.9-1-19[is: x86]
db=conary.works@lsb:3.9.7/4.6.21-1-18[~bootstrap is: x86]
debugedit=conary.works@lsb:3.9.7/4.4.1-10-19[is: x86]
dev=conary.works@lsb:3.9.7/3.23-4-19[is: x86]
diffutils=conary.works@lsb:3.9.7/2.8.7-4-19[is: x86]
distro-release=conary.works@lsb:3.9.7/3.9.7-2-19[~bootstrap]
elementtree=conary.works@lsb:3.9.7/1.2.6.20050316-11-17[is: x86]
elfutils=conary.works@lsb:3.9.7/0.127-2-19[is: x86]
file=conary.works@lsb:3.9.7/4.23-1-18[~bootstrap is: x86]
filesystem=conary.works@lsb:3.9.7/2.2.1-11-16[~bootstrap is: x86]
findutils=conary.works@lsb:3.9.7/4.3.6-1-18[~bootstrap is: x86]
gawk=conary.works@lsb:3.9.7/3.1.6-1-19[is: x86]
gcc=conary.works@lsb:3.9.7/4.1.2_20070115-12-1[~bootstrap,~!cross,~!gcc.core is: x86]
gcc-c++=conary.works@lsb:3.9.7/4.1.2_20070115-12-1[~bootstrap,~!cross,~!gcc.core is: x86]
glibc=conary.works@lsb:3.9.7/2.4-47-4[~bootstrap,~!cross is: x86(i486,i586,i686)]
glibc-utils=conary.works@lsb:3.9.7/2.4-47-4[~bootstrap,~!cross is: x86(i486,i586,i686)]
gmp=conary.works@lsb:3.9.7/4.2.1-4-18[~bootstrap is: x86(sse,sse2)]
grep=conary.works@lsb:3.9.7/2.5.1a-8-17[~bootstrap is: x86]
gzip=conary.works@lsb:3.9.7/1.3.12-4-18[~bootstrap is: x86]
idle=conary.works@lsb:3.9.7/2.4.4-43-4[~bootstrap is: x86]
info=conary.works@lsb:3.9.7/4.9-3-18[~bootstrap is: x86]
initscripts=conary.works@lsb:3.9.7/8.56.11-1-19[~bootstrap]
install-info=conary.works@lsb:3.9.7/4.9-3-18[~bootstrap is: x86]
libelf=conary.works@lsb:3.9.7/0.127-2-19[is: x86]
libelf-lgpl=conary.works@lsb:3.9.7/0.8.6-10-18[~bootstrap is: x86]
libgcc=conary.works@lsb:3.9.7/4.1.2_20070115-12-1[~bootstrap,~!cross,~!gcc.core is: x86]
libstdc++=conary.works@lsb:3.9.7/4.1.2_20070115-12-1[~bootstrap,~!cross,~!gcc.core is: x86]
libtermcap=conary.works@lsb:3.9.7/2.0.8-12-18[~bootstrap is: x86]
libtool=conary.works@lsb:3.9.7/1.5.24-4-4[is: x86]
libunwind=conary.works@lsb:3.9.7/0.9.5.si3.2.prebuilt-5-5[is: x86]
libxml2=conary.works@lsb:3.9.7/2.6.30-37-1[~bootstrap is: x86]
make=conary.works@lsb:3.9.7/3.81-3-19[is: x86]
mktemp=conary.works@lsb:3.9.7/1.5-26-18[~bootstrap is: x86]
net-tools=conary.works@lsb:3.9.7/1.60-13-19[is: x86]
nscd=conary.works@lsb:3.9.7/2.4-47-4[~bootstrap,~!cross is: x86(i486,i586,i686)]
openssl=conary.works@lsb:3.9.7/0.9.8g-8-6[~bootstrap is: x86(i486,i586,i686)]
patch=conary.works@lsb:3.9.7/2.5.9-2-19[is: x86]
pcre=conary.works@lsb:3.9.7/7.6-1-18[~bootstrap is: x86]
popt=conary.works@lsb:3.9.7/4.4.2-4-18[~bootstrap is: x86]
pycrypto=conary.works@lsb:3.9.7/2.0.1-20-8[~bootstrap is: x86]
python=conary.works@lsb:3.9.7/2.4.4-43-4[~bootstrap is: x86]
python-setuptools=conary.works@lsb:3.9.7/0.6c8-2-16[~bootstrap is: x86]
sed=conary.works@lsb:3.9.7/4.1.5-5-19[is: x86]
setup=conary.works@lsb:3.9.7/2.6.4-5-20
sgmlop=conary.works@lsb:3.9.7/1.1.1-12-18[~bootstrap is: x86]
sqlite=conary.works@lsb:3.9.7/3.5.4-4-18[~bootstrap is: x86]
tar=conary.works@lsb:3.9.7/1.20-2-19[is: x86]
texinfo=conary.works@lsb:3.9.7/4.9-3-18[~bootstrap is: x86]
unifdef=conary.works@lsb:3.9.7/1.171-2-19[is: x86]
userspace-kernel-headers=conary.works@lsb:3.9.7/2.6.22-6-6[~bootstrap is: x86(i486,i586,i686)]
zlib=conary.works@lsb:3.9.7/1.2.3-5-19[is: x86]
With a working bootstrap we can now start building the remaining
SI. If time wasn't an issue, the canonic way would be just throw
everything in a big group, let rMake find build order alone, build it
against bootstrap group described above, commit results, and rebuild
again against that just cooked group. Fact is, time is an
issue. basically that approach would end with a serialized build of
the SI, which - all architectures - summed - would take days. On the
other hand, today's CPUs are moving fast to multicore, multi-socket
and that approach would be sub optimal anyway, given rMake's hability
to parallelize job builds, assumming they don't contain build cycles
(dependency loops).
So, we splited the rebuild phases in two. First, we rebuild all the SI
contents which weren't already in the bootstrap phase, (assuring that
way no big massive build loops), and after that, and against the
resulting stuff, we rebuild the toolchain (again, with the assurance
of no massive build loops). We end, achieving equivalent results as
traditional ways, with good levels of paralellism and without cheating
(in the sense that rMake founds it all alone, without us having to
place custom hooks at package/group recipe level).
Right now, for beta1, we're shipping 'fat' tarballs, x86 and x86_64,
for now, with everything throwed in. In the future, we 'll ship
slimmer ones, with the different levels of capability attached to
different groups (server, gfx, etc), on top of a base set.
We expect the remaining architectures to be available in the next few
weeks. The whole SI will be able to be (cross-)built from any
supported platform, and targetting any supported platform.
This is a work in progress. Right now the information bellow relates
more to the actual build process, than to how actually take advantage
of the SI power. This will change as we' ll approach feature
completeness.
Bellow is a quick guide for 'navigating' inside the provided chroots.
(all commands are to be executed from inside the chroot)
conary q - gives all installed packages
conary q --flavors --labels - same as above plus package flavor and label.
conary q foo - returns info about package foo (if installed in system)
conary rq foo - returns info about tip package foo in the repository
conary rq foo --all-versions --all-flavors - returns all versions and flavors of foo in repository
to install locally, in current directory, a checkout of whole repo tree
LABEL=conary.works@lsb:3.9.7; for p in $(conary rq --install-label $LABEL | grep :source | sed 's/:.*//') ; do echo $p; cvc co $p=$LABEL; done