SourceFiles.org - Use the Source, Luke
Home | Register | News | Forums | Guide | MyLinks | Bookmark

Related Sites

Latest News
  General News
  Reviews
  Press Releases
  Software
  Hardware
  Security
  Tutorials
  Off Topic


Back to files

README for LFS-Build 0.2.0

I'm glad that you read this document, not many people do.

Here's some other files that you might find interesting as well: CHANGELOG - version history of LFS-Build TODO - Features on the "todo" list to implement INSTALL - Instructions on how to install LFS-Build.

The rest of this document will focus on how to use LFS-Build, what it can do, and what it can't do.

Current capabilities

I've changed the Freshmeat listing for LFS-Build to be "Alpha", since that's about where LFS-Build is. There's still some problems with the book that I haven't notified the maintainers of, but if you work around those, it should compile Chapter 6 (the second stage) fine. Currently LFS-Build will compile Chapter 5 without any problems.

How to use

In version 0.2.0, a rudimentary CLI (Command Line Interface) has been added. Although the eventual interface will be NCurses based, I wanted to get something in that is at least semi-easy to use (and somewhat scriptable!) so that you don't have to recompile the code for each chapter you wish to process.

Here's the available options:

--chapter       - This specifies which chapters you want to build scripts for.
                  You can specify one or multiple chapters, for example:
                  5,7,10-15 will process chapters 5, 7, and chapters 10
                  through 15.          
--lfs-book      - This is the location of the LinuxFromScratch XML directory.
--build-dir     - The directory to store the decompressed source code in.
                  I recommend that you set this directory to an easily
                  "disposable" directory, so that if you need to rebuild
                  things, that a simple "rm -rf" will do the job.
--src-dir       - The directory containing the LFS source files and patches

--make-script - The name that you want to give to your output script. --run-script - Use LFS-Build to process a script that you have already

                  created
--help          - Displays online help

Running the program

To create a script:
su - lfs (or whatever user you set up, as per Chapter 4) mkdir -p <build directory> (I use and recommend "/mnt/lfs/static/build" for Chapter 5) lfsbuild --chapter=<chapter> --lfs-book=<path to LFS book> --build-dir=<build directory> --src-dir=<source dir> --make-script=<script name>

Example: ./lfsbuild --chapter=5 --lfs-book=LFS-BOOK-4.0-XML --build-dir=/mnt/lfs/static/build --src-dir=/mnt/lfs/lfs/src --make-script=chapter5.txt

To run a script:
lfsbuild --run-script=chapter5.txt

The scripts themselves

There will be a file in the current directory called "chapter5.txt", which will contain the actual commands that get run. In the future, I will put in a feature that lets you open up some editor (i.e. vim) to edit the file before it is parsed. You'll know that things went very well, if it takes a while (depending on the power of your machine), and see lots of packages being built. Also, all of Chapter 5 will be built and if you look in /mnt/lfs/static, you should see the directories, and executables in /mnt/lfs/static/bin.

I suppose that it is possible to get Chapter 6 to complete if you modify the source code to not run the scripts right away, but edit first. I have not tested this configuration yet, as there are some errors in the XML entities in the LinuxFromScratch book, that I need to address with the authors. Thus far, if I remember correctly, there will be problems with these packages: MAKEDEV - Maybe not a problem, but the tar command will bomb out with an error (because MAKEDEV isn't tar'd) flex - It seems that I didn't do a good enough job with the XML parsing yet. netkit-base - Problem with the entities in the book, the "directory name" entity references an entity that does not exist.

There may be others, but these can be fixed by hand-editing the script file. Also, packages that have multiple build options will not be properly done either (i.e. those that have FHS compliance), and these may never be fixed (because the parser is brain-dead, more on that in a bit).

A Note on Packages with Patches

For now, you'll have to start off with the patches decompressed (via bunzip2), and also have symlinks, or the files properly set up, so that the patch command can find them. I plan on fixing this at some point as well.

Why the parser is so Brain-Dead

The parser is pretty brain-dead. All it really does is go through the XML files, strip out XML tags, expand XML/HTML metacharacters and entities, and put anything inbetween a "<screen><userinput>" and a "</screen></userinput>" in the output script. It also adds in the "tar" and "cd" commands. I thought about using libxml2 at first, but decided that writing my own little brain-dead parser would be easier (and thus far, it seems to have been).

Thanks for your interest in LFS-Build.

-- Joe
lfsbuild@vulturesnest.net


Other Sites

Discussion Groups
  Beginners
  Distributions
  Networking / Security
  Software
  PDAs

About | FAQ | Privacy | Awards | Contact
Comments to the webmaster are welcome.
Copyright 2006 Sourcefiles.org All rights reserved.