Automated Linux From Scratch for MahiroOS
This repository has been archived on 2024-10-17. You can view files and clone it, but cannot push or open issues or pull requests.
Find a file
Manuel Canales Esparcia 120bcdd4a9 Updated TODO files.
2006-07-16 10:43:03 +00:00
BLFS Updated TODO files. 2006-07-16 10:43:03 +00:00
CLFS Avoiding hardcoded supported books versions. 2006-07-16 10:06:03 +00:00
common Avoiding hardcoded supported books versions. 2006-07-16 10:06:03 +00:00
contrib Updated paco patch from upstream. 2006-07-13 19:45:35 +00:00
extras Merged ICA/farce support from experimental branch. 2006-04-29 14:44:29 +00:00
HLFS Avoiding hardcoded supported books versions. 2006-07-16 10:06:03 +00:00
LFS Avoiding hardcoded supported books versions. 2006-07-16 10:06:03 +00:00
optimize Merged optimize code from experimental branch. 2006-05-11 20:21:14 +00:00
blfs Added a dummy blfs script. 2006-05-18 18:41:43 +00:00
clfs Merged experimental branch to trunk. 2006-04-06 19:35:22 +00:00
hlfs Merged experimental branch to trunk. 2006-04-06 19:35:22 +00:00
lfs Merged experimental branch to trunk. 2006-04-06 19:35:22 +00:00
LICENSE Added jhalfs script 2005-09-11 21:03:26 +00:00
master.sh Avoiding hardcoded supported books versions. 2006-07-16 10:06:03 +00:00
README Typo fix and trailing spaces clean-up. 2006-07-13 20:25:46 +00:00
README.PACO Updated paco patch from upstream. 2006-07-13 19:45:35 +00:00
TODO Updated TODO files. 2006-07-16 10:43:03 +00:00

$Id$

1. INTRODUCTION::

     This collection of scripts, known as jhalfs, strives to create
  accurate makefiles from the Linux From Scratch book series XML files.
  This software is an evolution of the original "jhalfs-0.2" code.

     The usage of this script assumes you have read and are familiar with
  the book(s) and, therefore, the configuration variables found in config
  files will have meaning to you. There are a number of command line switches
  which, if used, will override the config file settings.

  NOTES::
  *.  The resulting Makefile takes considerable time to run to completion.
  Lay in a supply of caffeine beverages.

  *.  It is recommended that you temporarily unpack your linux kernel,
  run <make menuconfig>, configure the kernel as per the book and save
  the resulting .config file. This suggestion also applies to the
  configuration of the uClibc package when building a HLFS system using
  uClibc rather than glibc.

2. INSTALLATION::
     No installation is required. System-wide installation is not allowed
  for now.

3. CONFIGURATION FILES::
     Each book in the LFS series has its own set of configurable parameters
  as well as the common parameters file.

4. RUNNING::
     The script master.sh cannot be invoked directly but only via the
  supplied symlinks. After editing the config file for the project you wish
  to build, run the script.

     IMPORTANT:
       If you use the switch -M (automatically run the generated makefile) you
       must be 'root' or you can run the scripts using 'sudo'
        i.e.  sudo ./lfs -G -M

       If you want to run make manually you can only do so if you are 'root' or
       via 'sudo'
        i.e  (from within the jhalfs directory) sudo make

     The term <symlink> refers to the 1 of 3 package symlinks, lfs,hlfs,clfs.
     Replace <symlink> with your choice of packages; i.e.: ./lfs

     ./<symlink>		eg: ./lfs or ./hlfs
     Create a makefile based on the settings found in the config files.
     You must enter the build partition/jhalfs directory and manually run <make>

     ./<symlink> -G		eg: ./lfs -G
     Download the packages and patches necessary to build <symlink>

     ./<symlink> -G -M		eg: ./lfs -G -M
     Download the packages, create and automatically run the Makefile

     ./<symlink> --help		eg: ./lfs --help
     will give you a context sensitive list of command line switches.

   >>>> an expanded example

   export SRC_ARCHIVE=/mnt/SourceFiles

   ./lfs -D /mnt/partition4 \
         -K ~/jhalfs_configs/linux-2.6.16.19-LFS.config \
	 -F ~/jhalfs-configs/fstab-sda3 \
	 -G -T 0 -M

   explanation:::

   export SRC_ARCHIVE=/mnt/SourceFiles
      # This points to a local archive of existing packages. If the version in
        the archive is incorrect jhalfs will access the net and download the
	necessary version and store it here for later use. DO NOT set this to
	$BUILDDIR/sources. If you do not set this variable to a valide directory
	ALL package tarballs will be downloaded from the 'net.

   -D /mnt/partition4
      # where everything takes place.  ..NOTE it must already exist and be mounted

   -K ~/jhalfs_configs/linux-2.6.16.19-LFS.config
      # If you want to automatically build a the kernel you MUST supply a valid
        kernel configuration file. The file you supply will be copied and renamed.

   -F ~/jhalfs-configs/fstab-sda3
      # If you have a fstab file you wish to use it will be copied and renamed

   -G   # Retrieve the package files. You MUST enable this flag at least once if you
          wish to do a build or whenever you update the book.

   -T 0 # don't run any testsuites

   -M   # automatically run make against Makefile once jhalfs finishes its work.


5. LAYOUT::

        /CLFS/config
             /master.sh
             /xxxx.xsl

        /HLFS/config
             /master.sh
             /xxxx.xsl

        /LFS/config
            / master.sh
            /xxxx.xsl

        /common/config
               /common_functions
               /makefile_functions
               /func_check_versions.sh
               /func_validate_configs.sh

        /contrib/jhalfs-paco.patch

	/extras/do_copy_files
               /do_ica_prep
               /do_ica_work
               /farce
               /filelist

         README
	 README.PACO
	 TODO

	 ./clfs  ---|
	 ./hlfs  ---|+---> master.sh
	 ./lfs   ---|


6. FAQ::
    Q. "It doesn't work!"
    A. Yes it does, try ./lfs --help

    Q. "It still doesn't work"
    A. jhalfs was designed to work against the developement versions of the LFS
       series of books. Consequently changes in a book(s) sometimes breaks older
       versions of jhalfs. Before you start pulling out your hair download the
       latest version of jhalfs to see if that solves your problem.

    Q. "How do I specify the build location?"
    A. The original LFS document worked against the well know location /mnt/lfs.
       This script automates the build of all of the LFS series of books and uses
       a generic location $BUILDDIR with a default value a /mnt/build_dir.
       You may change this value to suit your needs.

       The layout below $BUILDDIR is as follows.
       $BUILDDIR/
            jhalfs      (makefile,cmd scripts,logs..etc)
	    sources     (where packages reside)
	    tools       (temporary bootstrap system)
	    cross-tools (temporary CLFS only)
	        ...
	    FHS dir structure
	        ...

    Q. "What is the function of the SRC_ARCHIVE variable?"
    A. When then symlinked master.sh runs it creates a local copy of the
       necessary packages in BUILDDIR/sources by downloading the files. If
       the variable SRC_ARCHIVE is defined the software will first look in
       this location for the file and, if found, will copy it to BUILDDIR/sources.
       If the files are not found in SRC_ARCHIVE _and_ you have write priv to
       the directory any downloaded files will be mirrored there.

    Q. "How do I set the SRC_ARCHIVE location?"
    A. The best way to set the value of SRC_ARCHIVE is
       export SRC_ARCHIVE=/wherever/you/store/downloaded/packages
                       OR
       you can change the setting in .common/config.

    Q. "Why have 2 copies of the files?"
    A. The package files must be visible during the chroot phase and this is a
       simple and reliable method of doing so. This method also handles the CLFS
       build method where the final build may be done on a separate machine.

    Q. "When I try to build 'xxx' with clfs the makefile fails at the mid-point"
    A. There could be numerous reasons for the failure but the most likely reason
       is you are doing a cross-build using the 'chroot' method and the target is
       not compatible with the host.  If you choose to build using the chroot
       method a test is performed at the end of the temptools phase. If the test
       succeeds the build continues inside a chroot jail. However if the test fails
       it means the host and target are not compatible an you should use the
       'boot' method to create your target code.
       As an extreme example: You can build a sparc target on a x86 platform but
       only the temptools phase. You must run ./clfs using the 'boot' method and
       not the 'chroot.' You must transfer the toolchain to a sparc platform, reboot
       the sparc box and continue the build.
       Of all the LFS series of books the Cross-LFS requires the greatest
       understanding of host/target hardware combination. Please read the book
       carefully and don't skip the easy parts (there are none..)



Authors:
  George Boudreau
  Manuel Canales Esparcia
  Jeremy Huntwork