lfsbuilder, and automated LFS build system
Hui Zhou, 3 Mar 2004.

Original announcement

I assume you all familiar with lfs, for those are not, you may
interested in checkout www.linuxfromscratch.org.

I imported my `lfsbuilder' into the cvs repository. If you have a
spare partition lying around, you may have a try. I am lucky to have a
fast machine, it builds for 3hours. .

Basic feature of lfsbuilder is very much like nALFS. Differences are
following. It is writen in perl (I use C because the code-test circle
in perl is faster); It forks to switch user and chroot, once in ch5
and once in chapter 6; It creates a central log for tracking building
progress, which mean if it failed in the middle, the next time it will
start from there (one also can manipulate this log to do testing); It
tries to shift the dumb work to the program as much as possible. 

Currently, the profile ---`profiles/lfs.g' is only 430 lines, the i
nALFS profiles are using 111 files! Imagin what a difference in
browsing and editing the profile(s). If you already have all the
packages in a local directory, one can cut another 100 or so lines off
the profile. Collecting the up-to-date urls are tedious, to automating
this task by lfsbuilder is listed high in my to-do list. The profile
can be split into multiple file named after package names. But most
profiles will be just a few lines.

Both the profile and the status log uses OGDL, thus is requires
OGDL::Parser and OGDL::Graph. lfsbuilder installs LFS::Builder (I
imagin more people will put more LFS::modules to facilitate these
tasks in the future, like grab commands and dependency from the book).

For quick feather glancing, read profiles/lfs.g (the profile),
examples/builder.log (the status tracking log), and examples/lfs.log
(the stdout log).

If you have a spare partition, I encourage you to have a try (do it
overnight :)). 

The installation doesn't install profiles (not at this stage).
Move the profiles directory to your home directory or any place you desire.

Edit profiles/lfs.g to match your configuration. Minimally, you need set logs_dir,
packages_dir, build_dir, profiles_dir, LFS, and LFSUSER

Before lfs installation, prepare the partition, mkfs, and mount it to $LFS, and
make sure the LFSUSER exists

To automatically install base lfs, run :
        lfsbuilder -p /To/Path/profiles/lfs.g lfs

The command output is suppressed. You can pass the option -t ttyname to let the
lfsbuilder output the command output(both stdout and stderr) to ttyname(or a file).

It forks in ch5 and ch6. In ch5, it switches to user LFSUSER; in ch6, it chroot to $LFS.
So it should be relative safe to experiment with. 

Oh, I almost forgot. I put a few necessary configuration file in profiles, and they
are used in the lfs profile. Adjust to your needs. It also uses a kernel.config file
for compiling the kernel, which most likely doesn't suit you. 

Happy building!

-Hui





build.htm