2006-04-06 21:35:22 +02:00
|
|
|
$Id$
|
2005-11-01 13:33:46 +01:00
|
|
|
|
2006-04-06 21:35:22 +02:00
|
|
|
1. INTRODUCTION::
|
2005-11-01 13:33:46 +01:00
|
|
|
|
2006-04-09 12:38:40 +02:00
|
|
|
This collection of scripts, known as jhalfs, strives to create
|
2006-04-06 21:35:22 +02:00
|
|
|
accurate makefiles from the Linux From Scratch book series XML files.
|
2006-10-06 21:49:45 +02:00
|
|
|
This software is an evolution of the original "jhalfs-0.2" code developed
|
|
|
|
by Jeremy Huntwork.
|
2005-11-01 13:33:46 +01:00
|
|
|
|
2006-04-06 21:35:22 +02:00
|
|
|
The usage of this script assumes you have read and are familiar with
|
2006-10-06 21:49:45 +02:00
|
|
|
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
|
|
|
|
|
2006-04-06 21:35:22 +02:00
|
|
|
NOTES::
|
|
|
|
*. The resulting Makefile takes considerable time to run to completion.
|
|
|
|
Lay in a supply of caffeine beverages.
|
2005-11-01 13:33:46 +01:00
|
|
|
|
2006-04-06 21:35:22 +02:00
|
|
|
*. It is recommended that you temporarily unpack your linux kernel,
|
2006-05-14 05:41:26 +02:00
|
|
|
run <make menuconfig>, configure the kernel as per the book and save
|
2017-03-19 22:08:18 +01:00
|
|
|
the resulting .config file.
|
2006-04-06 21:35:22 +02:00
|
|
|
|
2017-03-20 16:31:30 +01:00
|
|
|
*. Read carefully this file and the other README.* files before using
|
|
|
|
this tool.
|
2006-12-15 11:53:10 +01:00
|
|
|
|
2006-08-24 22:38:22 +02:00
|
|
|
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
|
2017-03-19 22:08:18 +01:00
|
|
|
- be able to trace build failures and to find what is causing them
|
2006-08-24 22:38:22 +02:00
|
|
|
(user error, package bug, {c,h,b}LFS command bug, or jhalfs code bug)
|
|
|
|
|
2006-09-11 21:51:24 +02:00
|
|
|
If you do not have the above skills, please don't use this tool.
|
2006-08-24 22:38:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
3. INSTALLATION::
|
2006-09-11 21:51:24 +02:00
|
|
|
|
2017-03-19 22:08:18 +01:00
|
|
|
No installation is required. You should just run <make> in this directory.
|
2006-04-06 21:35:22 +02:00
|
|
|
|
2006-10-06 21:49:45 +02:00
|
|
|
4. CONFIGURATION::
|
2006-04-06 21:35:22 +02:00
|
|
|
|
2017-03-19 22:08:18 +01:00
|
|
|
Configuration is done through a menu based interface. See the section
|
|
|
|
RUNNING, for details.
|
2006-08-11 20:02:51 +02:00
|
|
|
|
2006-08-24 22:38:22 +02:00
|
|
|
5. RUNNING::
|
2006-07-13 22:25:46 +02:00
|
|
|
|
2006-09-11 21:51:24 +02:00
|
|
|
The command <make> will launch a menu based configuration program. You will
|
2006-10-06 21:49:45 +02:00
|
|
|
recognize the layout from building the kernel or uClibc/BusyBox. The
|
|
|
|
underlying menu code was borrowed from BusyBox and slightly modified for
|
2006-09-11 21:51:24 +02:00
|
|
|
our use.
|
2006-07-13 22:25:46 +02:00
|
|
|
|
2007-03-03 14:09:34 +01:00
|
|
|
Help on parameter function is available from the on-line help. Please
|
2017-03-19 22:08:18 +01:00
|
|
|
make use of that feature: it may contain additional information not
|
|
|
|
duplicated in this file.
|
|
|
|
|
|
|
|
You should first choose which book and flavour you want to build. Note
|
|
|
|
that when you choose the BLFS book, the tool will just install the BLFS
|
|
|
|
tool to your system. You'll have to run that installed tool to build
|
|
|
|
packages in BLFS. See README.BLFS to know how. If you choose any other
|
|
|
|
book, you'll have to configure the settings and the build parameters
|
|
|
|
from the menu. Note that you may choose to install the blfs tools onto
|
|
|
|
the newly built system (see below). It is not the same thing as choosing
|
|
|
|
the BLFS book in the menu, which will install the blfs tools on the
|
|
|
|
currently running system.
|
|
|
|
|
|
|
|
|
|
|
|
Once you have set the parameters and saved the configuration, the script
|
|
|
|
is launched. Its aim is to extract instructions from the selected book
|
|
|
|
to generate scripts, and to generate a Makefile, which allows running
|
|
|
|
the scripts in the right order. The script verifies first that the host
|
|
|
|
can run it and build the xLFS system, then validates the configuration
|
|
|
|
and lists the parameters. At this point, you may choose to quit or to
|
|
|
|
continue with the listed parameters. The script will then proceed to
|
|
|
|
generate the Makefile and the build scripts, optionally download
|
|
|
|
packages, and eventually verify the host prerequisite. If you have
|
|
|
|
selected "Run the makefile", the command make is launched in the
|
|
|
|
adequate directory, and the build begins. If not, you'll have to run
|
|
|
|
"make" manually, for example: "make -C /mnt/build_dir/jhalfs", if you
|
|
|
|
have used the default parameters (see the layout under $BUILDDIR in the
|
|
|
|
Q&A below).
|
2006-10-06 21:49:45 +02:00
|
|
|
|
2013-11-01 15:22:17 +01:00
|
|
|
IMPORTANT::
|
2006-10-06 21:49:45 +02:00
|
|
|
You must be logged as a normal user with sudo privileges to run
|
2013-11-01 15:22:17 +01:00
|
|
|
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
|
2006-06-21 01:43:07 +02:00
|
|
|
|
2006-10-06 21:49:45 +02:00
|
|
|
NOTE::
|
|
|
|
If you run the jhalfs script directly the only function you can select
|
|
|
|
is to display the version number running <./jhalfs -v>
|
2006-06-21 01:43:07 +02:00
|
|
|
|
2006-10-07 12:55:10 +02:00
|
|
|
6. BLFS_TOOL SUPPORT::
|
2006-07-13 22:25:46 +02:00
|
|
|
|
2017-03-19 22:08:18 +01:00
|
|
|
For books that support it (only LFS for jhalfs version 2.4),
|
2017-03-01 12:01:27 +01:00
|
|
|
there is an option to install an automated framework for building BLFS
|
2017-03-19 22:08:18 +01:00
|
|
|
packages. It is called blfs-tool. When you tick `BOOK Settings/Add
|
2013-10-29 16:42:03 +01:00
|
|
|
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
|
2017-03-01 12:01:27 +01:00
|
|
|
end of the jhalfs run, before the custom tools. The instructions for
|
|
|
|
building the dependencies are taken from the BLFS book.
|
2013-10-29 16:42:03 +01:00
|
|
|
|
2017-03-19 22:08:18 +01:00
|
|
|
(TODO: blfs-tools have not been tested with current (version 3.0) of CLFS,
|
|
|
|
and certainly need some adaptation to run)
|
2007-07-06 02:59:01 +02:00
|
|
|
WARNING:: If you add blfs-tool support on a CLFS Sysroot build
|
2013-10-29 16:42:03 +01:00
|
|
|
you MUST edit the scripts to fix the installation paths.
|
2006-12-11 19:21:16 +01:00
|
|
|
|
2006-10-07 12:55:10 +02:00
|
|
|
After booting the new xLFS system some steps are needed to finish
|
2013-10-29 16:42:03 +01:00
|
|
|
the installation of the automated tools:
|
2006-10-07 12:55:10 +02:00
|
|
|
|
2006-10-07 16:28:12 +02:00
|
|
|
- A user account must be created. You must be logged on that user
|
2013-10-29 16:42:03 +01:00
|
|
|
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.
|
2006-10-07 12:55:10 +02:00
|
|
|
|
2006-10-07 16:28:12 +02:00
|
|
|
- Move /blfs-root to that user's home and change ownership of the
|
|
|
|
directory and files to the user.
|
2006-10-07 12:55:10 +02:00
|
|
|
|
2006-10-07 16:28:12 +02:00
|
|
|
- Give the user read and write privileges over the $TRACKING_DIR
|
2006-10-07 12:55:10 +02:00
|
|
|
directory and the files that it contains.
|
|
|
|
|
2013-10-29 16:42:03 +01:00
|
|
|
- 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.
|
2007-07-28 19:12:00 +02:00
|
|
|
|
2013-10-29 16:42:03 +01:00
|
|
|
- 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.
|
2006-10-07 12:55:10 +02:00
|
|
|
|
|
|
|
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,
|
2013-10-29 16:42:03 +01:00
|
|
|
but not supported.
|
2006-10-07 12:55:10 +02:00
|
|
|
|
2013-10-29 16:42:03 +01:00
|
|
|
To know how to use blfs-tool, see README.BLFS.
|
2006-10-07 12:55:10 +02:00
|
|
|
|
|
|
|
7. LAYOUT::
|
2006-04-06 21:35:22 +02:00
|
|
|
|
2006-10-06 21:49:45 +02:00
|
|
|
/BLFS (see README.BLFS)
|
|
|
|
|
|
|
|
/CLFS/master.sh
|
|
|
|
/clfs.xsl
|
2006-05-27 10:30:58 +02:00
|
|
|
|
2006-10-06 21:49:45 +02:00
|
|
|
/CLFS2/master.sh
|
|
|
|
/clfs2.xsl
|
2006-07-23 16:44:13 +02:00
|
|
|
|
2006-11-11 18:21:38 +01:00
|
|
|
/CLFS3/master.sh
|
|
|
|
/clfs3.xsl
|
|
|
|
|
2006-10-06 21:49:45 +02:00
|
|
|
/HLFS/master.sh
|
|
|
|
/hlfs.xsl
|
2006-05-05 00:23:22 +02:00
|
|
|
|
2006-10-06 21:49:45 +02:00
|
|
|
/LFS/master.sh
|
|
|
|
/lfs.xsl
|
2006-05-05 00:23:22 +02:00
|
|
|
|
2006-10-06 21:49:45 +02:00
|
|
|
/common/common_functions
|
2006-05-05 00:23:22 +02:00
|
|
|
/makefile_functions
|
2006-10-06 21:49:45 +02:00
|
|
|
/packages.xsl
|
|
|
|
/urls.xsl
|
|
|
|
/create-sbu_du-report.sh
|
|
|
|
/progress_bar.sh
|
|
|
|
/blfs-tool-deps/9xx-*
|
2006-11-11 20:06:46 +01:00
|
|
|
/libs/func_*
|
2006-05-05 00:23:22 +02:00
|
|
|
|
2007-03-03 12:58:40 +01:00
|
|
|
/custom/template
|
|
|
|
/config/
|
|
|
|
/examples/*
|
|
|
|
/examples_CLFS-E/*
|
2006-05-05 00:23:22 +02:00
|
|
|
|
2006-10-06 21:49:45 +02:00
|
|
|
/extras/do_copy_files
|
2006-05-05 00:23:22 +02:00
|
|
|
/do_ica_prep
|
|
|
|
/do_ica_work
|
|
|
|
/farce
|
|
|
|
/filelist
|
|
|
|
|
2006-10-06 21:49:45 +02:00
|
|
|
/optimize/opt_config
|
|
|
|
/opt_override
|
|
|
|
/optimize_functions
|
|
|
|
/opt_config.d/noOpt
|
|
|
|
/noSymbols
|
|
|
|
/O3pipe
|
|
|
|
/O3pipe_march
|
|
|
|
/defOpt_fPIC
|
|
|
|
|
|
|
|
/menu/*
|
|
|
|
|
2006-09-11 21:51:24 +02:00
|
|
|
README
|
2006-10-06 21:49:45 +02:00
|
|
|
README.BLFS
|
2007-03-03 12:58:40 +01:00
|
|
|
README.CLFS
|
2006-10-06 21:49:45 +02:00
|
|
|
README.HLFS
|
2007-03-03 12:58:40 +01:00
|
|
|
README.CUSTOM
|
2006-10-06 21:49:45 +02:00
|
|
|
TODO
|
|
|
|
LICENSE
|
2006-05-27 10:30:58 +02:00
|
|
|
|
2006-10-06 21:49:45 +02:00
|
|
|
Config.in
|
|
|
|
Makefile
|
|
|
|
jhalfs
|
|
|
|
blfs-tool
|
2006-05-27 10:30:58 +02:00
|
|
|
|
2006-10-07 12:55:10 +02:00
|
|
|
8. FAQ::
|
2006-07-16 22:53:37 +02:00
|
|
|
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).
|
2006-08-08 19:26:40 +02:00
|
|
|
|
2006-05-14 05:41:26 +02:00
|
|
|
Q. "It doesn't work!"
|
2006-09-11 21:51:24 +02:00
|
|
|
A. Yes it does, try >> make
|
2006-10-06 21:49:45 +02:00
|
|
|
Remember you must have 'sudo' privileges.
|
2006-07-13 22:25:46 +02:00
|
|
|
|
2006-07-03 19:42:30 +02:00
|
|
|
Q. "It still doesn't work"
|
2006-10-06 21:49:45 +02:00
|
|
|
A. jhalfs was designed to work against the development versions of the LFS
|
2006-07-03 19:42:30 +02:00
|
|
|
series of books. Consequently changes in a book(s) sometimes breaks older
|
|
|
|
versions of jhalfs. Before you start pulling out your hair download the
|
2006-07-13 22:25:46 +02:00
|
|
|
latest version of jhalfs to see if that solves your problem.
|
2006-05-27 10:30:58 +02:00
|
|
|
|
2006-05-14 05:41:26 +02:00
|
|
|
Q. "How do I specify the build location?"
|
2017-03-01 12:01:27 +01:00
|
|
|
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.
|
2006-05-27 10:30:58 +02:00
|
|
|
|
2006-05-03 03:42:16 +02:00
|
|
|
The layout below $BUILDDIR is as follows.
|
|
|
|
$BUILDDIR/
|
2006-10-06 21:49:45 +02:00
|
|
|
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)
|
2006-05-27 10:30:58 +02:00
|
|
|
|
2006-05-14 05:41:26 +02:00
|
|
|
Q. "What is the function of the SRC_ARCHIVE variable?"
|
2006-10-06 21:49:45 +02:00
|
|
|
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.
|
2006-04-09 12:38:40 +02:00
|
|
|
If the files are not found in SRC_ARCHIVE _and_ you have write priv to
|
2006-04-07 15:26:24 +02:00
|
|
|
the directory any downloaded files will be mirrored there.
|
2006-05-27 10:30:58 +02:00
|
|
|
|
2006-05-14 05:41:26 +02:00
|
|
|
Q. "How do I set the SRC_ARCHIVE location?"
|
2006-05-03 03:42:16 +02:00
|
|
|
A. The best way to set the value of SRC_ARCHIVE is
|
2006-10-06 21:49:45 +02:00
|
|
|
|
2006-05-03 03:42:16 +02:00
|
|
|
export SRC_ARCHIVE=/wherever/you/store/downloaded/packages
|
2006-10-06 21:49:45 +02:00
|
|
|
|
|
|
|
or you can set the full path in the proper menu entry.
|
2006-05-27 10:30:58 +02:00
|
|
|
|
2006-05-14 05:41:26 +02:00
|
|
|
Q. "Why have 2 copies of the files?"
|
2006-04-09 12:38:40 +02:00
|
|
|
A. The package files must be visible during the chroot phase and this is a
|
2017-03-01 12:01:27 +01:00
|
|
|
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 those
|
2006-10-06 21:49:45 +02:00
|
|
|
build steps.
|
|
|
|
|
|
|
|
These variables are adjustable also when invoking make:
|
2006-04-06 21:35:22 +02:00
|
|
|
|
2006-09-11 21:51:24 +02:00
|
|
|
$BUILDDIR make LUSER=myaccount LGROUP=mygroup
|
2006-08-08 19:26:40 +02:00
|
|
|
|
2006-10-06 21:49:45 +02:00
|
|
|
The only changes to your account will be the creation of a NEW .bashrc
|
|
|
|
after saving your original to .bashrc.XXX
|
|
|
|
|
2017-03-19 22:08:18 +01:00
|
|
|
Q. "When I try to build CLFS the Makefile fails at mid-point"
|
2017-03-01 12:01:27 +01:00
|
|
|
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.
|
2006-07-13 22:25:46 +02:00
|
|
|
As an extreme example: You can build a sparc target on a x86 platform but
|
2006-10-06 21:49:45 +02:00
|
|
|
only the temptools phase. You must select the 'boot' method and not the
|
2006-09-11 21:51:24 +02:00
|
|
|
'chroot.' You must transfer the toolchain to a sparc platform, reboot the
|
|
|
|
sparc box and continue the build.
|
2006-07-24 14:29:45 +02:00
|
|
|
Of all the LFS series of books Cross-LFS requires the greatest
|
2006-06-29 03:47:35 +02:00
|
|
|
understanding of host/target hardware combination. Please read the book
|
2017-03-01 12:01:27 +01:00
|
|
|
carefully and don't skip the easy parts (there are none...)
|
2006-07-13 22:25:46 +02:00
|
|
|
|
2007-03-18 11:14:04 +01:00
|
|
|
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.
|
|
|
|
|
2006-04-06 21:35:22 +02:00
|
|
|
Authors:
|
|
|
|
George Boudreau
|
|
|
|
Manuel Canales Esparcia
|
2017-03-01 12:01:27 +01:00
|
|
|
Pierre Labastie
|