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
2014-01-01 09:49:25 +00:00
BLFS Merge trunk r3767-3773 2014-01-01 09:49:25 +00:00
CLFS Merge trunk 3745:3750 2013-11-06 21:56:23 +00:00
CLFS2 Fix various issues when building CLFS. 2012-02-09 22:58:45 +00:00
CLFS3 Patch: force locale when checking version requirements 2007-12-14 20:30:09 +00:00
common Merge trunk r3767-3773 2014-01-01 09:49:25 +00:00
custom Forgot one Id property in custom 2012-03-03 20:18:50 +00:00
extras Merged ICA/farce support from experimental branch. 2006-04-29 14:44:29 +00:00
HLFS Dump build time using Bash $SECONDS internal variable instead of using date calls + Perl-based calculations. 2007-08-17 16:24:47 +00:00
LFS merge trunk r3766 2013-12-22 16:59:31 +00:00
menu Changes slightly the code in menu directory so that "conf" 2012-02-10 09:39:11 +00:00
optimize Merge trunk r3762 to r3765 2013-12-16 14:23:20 +00:00
pkgmngt Fix svn properties on some files 2012-02-19 10:54:17 +00:00
Config.in Merge trunk r3750-3760 2013-11-17 22:20:07 +00:00
FUNCTION_LIST Correct typos in FUNCTION_LIST 2012-03-20 13:37:52 +00:00
install-blfs-tools.sh Merge trunk r3767-3773 2014-01-01 09:49:25 +00:00
jhalfs Merge trunk r3762 to r3765 2013-12-16 14:23:20 +00:00
LICENSE Added jhalfs script 2005-09-11 21:03:26 +00:00
Makefile Merge trunk r3692 2013-04-04 20:09:42 +00:00
README merging trunk r3743 r3744 2013-11-01 14:25:30 +00:00
README.BLFS Change again the root commands, so that all control characters are escaped 2012-04-09 10:17:30 +00:00
README.CLFS Updated README.CLFS 2007-07-26 17:29:50 +00:00
README.CUSTOM Spell run on README files. 2007-03-03 13:09:34 +00:00
README.HLFS Updated README.HLFS 2007-07-26 17:33:07 +00:00
README.PACKAGE_MANAGEMENT Some cleanup 2013-11-07 10:30:33 +00:00
TODO Merge trunk r3750-3760 2013-11-17 22:20:07 +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 developed
  by Jeremy Huntwork.

     The usage of this script assumes you have read and are familiar with
  the book(s) and, therefore, the configuration variables found in menuconfig
  interface will have meaning to you.

  The list of supported books can be found at
  http://wiki.linuxfromscratch.org/alfs/wiki/SupportedBooks

  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.

  *.  Read carefully this file and the other README.* files before start
  using the tool.

2. PREREQUISITES::

     To use this tool you MUST:

     - have experience building {c,h,b}LFS packages
     - know how to edit and write shell scripts
     - know how a Makefile works
     - be able to trace build failures and to find what is causing it
       (user error, package bug, {c,h,b}LFS command bug, or jhalfs code bug)

     If you do not have the above skills, please don't use this tool.


3. INSTALLATION::

     No installation is required. System-wide installation is not allowed.

4. CONFIGURATION::

     We have installed the familiar menu based configuration tool driven by
     GNU make. see the section RUNNING, for details

5. RUNNING::

     The command <make> will launch a menu based configuration program. You will
     recognize the layout from building the kernel or uClibc/BusyBox. The
     underlying menu code was borrowed from BusyBox and slightly modified for
     our use.

     Help on parameter function is available from the on-line help. Please
     make use of that feature for additional information not in this file.

     Once you have set the parameters you wish and have saved your work the
     jhalfs script is launch. The script verify first that the host can run
     it and build the xLFS system, then validate the configuration and present
     you with your selections which you may accept or reject.

     If you accepted the displayed settings jhalfs will proceed to create the
     Makefile, optionally download packages.

     IMPORTANT::
         You must be logged as a normal user with sudo privileges to run
         the Makefile. Furthermore, you are supposed to have enough privilege
         to become any user. If you are not bothered about security issues,
         the entry for the user "jhalfs_user" in /etc/sudoers could be
         jhalfs_user ALL=(ALL) NOPASSWD:ALL

     NOTE::
         If you run the jhalfs script directly the only function you can select
         is to display the version number running <./jhalfs -v>

6. BLFS_TOOL SUPPORT::

     For books that support it (TODO: which ones?), there is an option
     to install an automated framework for building BLFS packages. Let
     us call it blfs-tool for now. When you tick `BOOK Settings/Add
     blfs-tool support' in jhalfs configuration menu, the tools are
     installed in $BLFS_ROOT (default /blfs_root) on the xLFS system,
     and a few dependencies (which you may select) are built at the
     end of the jhalfs run, before the custom tools. As of March 8, 2012,
     works only with LFS. The instructions for building the dependencies
     are taken from the BLFS book.

     (TODO: is this relevant to present CLFS?)
     WARNING:: If you add blfs-tool support on a CLFS Sysroot build
               you MUST edit the scripts to fix the installation paths.

     After booting the new xLFS system some steps are needed to finish
     the installation of the automated tools:

       - A user account must be created. You must be logged on that user
         account to use blfs-tool. This is not strictly necessary,
         since the packages can be built as root, too, but it is
         never a good idea to build packages as root.

       - Move /blfs-root to that user's home and change ownership of the
         directory and files to the user.

       - Give the user read and write privileges over the $TRACKING_DIR
         directory and the files that it contains.

       - Configure sudo, adding the needed privileges for the user. For
         newer sudo version, do not forget to add a line Defaults secure_path=
         containing /sbin and /usr/sbin (in /etc/sudoers), otherwise some
         executables are not found.

       - Although it is not strictly necessary, it is recommended to install
         the bash shell startup files (as per `3.After LFS Configuration
         Issues' of the BLFS book), as some instructions in BLFS rely on
         their being present.

     We assume that blfs-tool will be used on a running fresh xLFS system.
     To use it to build BLFS packages from the chroot jail is also possible,
     but not supported.

     To know how to use blfs-tool, see README.BLFS.

7. LAYOUT::

        /BLFS (see README.BLFS)

        /CLFS/master.sh
             /clfs.xsl

        /CLFS2/master.sh
              /clfs2.xsl

        /CLFS3/master.sh
              /clfs3.xsl

        /HLFS/master.sh
             /hlfs.xsl

        /LFS/master.sh
            /lfs.xsl

        /common/common_functions
               /makefile_functions
               /packages.xsl
               /urls.xsl
               /create-sbu_du-report.sh
               /progress_bar.sh
               /blfs-tool-deps/9xx-*
               /libs/func_*

        /custom/template
               /config/
               /examples/*
               /examples_CLFS-E/*

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

        /optimize/opt_config
                 /opt_override
                 /optimize_functions
                 /opt_config.d/noOpt
                              /noSymbols
                              /O3pipe
                              /O3pipe_march
                              /defOpt_fPIC

        /menu/*

        README
        README.BLFS
        README.CLFS
        README.HLFS
        README.CUSTOM
        TODO
        LICENSE

        Config.in
        Makefile
        jhalfs
        blfs-tool

8. FAQ::
    Q. "This 'help' file is very sparse"
    A. Yes, it is. This tool, jhalfs, is for those who understand the LFS books
       and wish to automate the build. 99% of any problems that arise can be
       solved by reading the book(s).

    Q. "It doesn't work!"
    A. Yes it does, try >> make
       Remember you must have 'sudo' privileges.

    Q. "It still doesn't work"
    A. jhalfs was designed to work against the development 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 known 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 of /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
                ...
            blfs_root   (files to use blfs-tool if selected to install it)

    Q. "What is the function of the SRC_ARCHIVE variable?"
    A. When jhalfs runs and packages download was selected, 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 set the full path in the proper menu entry.

    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
       boot build method where the final build may be done on a separate machine.

    Q. "What is the function of "User account" and "Group account" menu settings?"
    A. If you are running jhalfs from a low or non-privileged account you may not
       have the priv to create/delete the user needed to build temporary tools.
       These settings allow you to use your own user and group name to do that
       build steps.

       These variables are adjustable also when invoking make:

         $BUILDDIR make LUSER=myaccount LGROUP=mygroup

       The only changes to your account will be the creation of a NEW .bashrc
       after saving your original to .bashrc.XXX

    Q. "When I try to build 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 select 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 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..)

    Q. "How could I stop the build at a predefined chosen point?"
    A. Launch the Makefile manually passing the last numbered target to be build
       as the break point. For example:

          make BREAKPOINT=84-bash

       The build can be stopped also at the end of a top-level build phase by
       calling directly the appropriate mk_* target. For example:

          make mk_LUSER

       See the Makefile to know the proper target names for that book build.

Authors:
  George Boudreau
  Manuel Canales Esparcia