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-04-09 12:38:40 +02:00
|
|
|
This software is an evolution of the original "jhalfs-0.2" code.
|
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
|
|
|
|
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.
|
2005-11-01 13:33:46 +01:00
|
|
|
|
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
|
2006-04-06 21:35:22 +02:00
|
|
|
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.
|
2006-04-09 12:38:40 +02:00
|
|
|
|
2006-06-22 21:55:36 +02:00
|
|
|
IMPORTANT:
|
|
|
|
If you use the switch -M (automatically run the generated makefile) you
|
|
|
|
must be 'root' or you can run the scripts using 'sudo'
|
2006-07-13 22:25:46 +02:00
|
|
|
i.e. sudo ./lfs -G -M
|
|
|
|
|
2006-06-22 21:55:36 +02:00
|
|
|
If you want to run make manually you can only do so if you are 'root' or
|
2006-07-13 22:25:46 +02:00
|
|
|
via 'sudo'
|
2006-06-22 21:55:36 +02:00
|
|
|
i.e (from within the jhalfs directory) sudo make
|
|
|
|
|
2006-05-27 10:30:58 +02:00
|
|
|
The term <symlink> refers to the 1 of 3 package symlinks, lfs,hlfs,clfs.
|
2006-04-06 21:35:22 +02:00
|
|
|
Replace <symlink> with your choice of packages; i.e.: ./lfs
|
|
|
|
|
2006-05-05 00:23:22 +02:00
|
|
|
./<symlink> eg: ./lfs or ./hlfs
|
2006-04-06 21:35:22 +02:00
|
|
|
Create a makefile based on the settings found in the config files.
|
|
|
|
You must enter the build partition/jhalfs directory and manually run <make>
|
|
|
|
|
2006-05-05 00:23:22 +02:00
|
|
|
./<symlink> -G eg: ./lfs -G
|
2006-04-06 21:35:22 +02:00
|
|
|
Download the packages and patches necessary to build <symlink>
|
|
|
|
|
2006-05-05 00:23:22 +02:00
|
|
|
./<symlink> -G -M eg: ./lfs -G -M
|
2006-04-06 21:35:22 +02:00
|
|
|
Download the packages, create and automatically run the Makefile
|
|
|
|
|
2006-05-05 00:23:22 +02:00
|
|
|
./<symlink> --help eg: ./lfs --help
|
|
|
|
will give you a context sensitive list of command line switches.
|
2006-04-06 21:35:22 +02:00
|
|
|
|
2006-06-21 01:43:07 +02:00
|
|
|
>>>> an expanded example
|
2006-07-13 22:25:46 +02:00
|
|
|
|
2006-06-21 01:43:07 +02:00
|
|
|
export SRC_ARCHIVE=/mnt/SourceFiles
|
2006-07-13 22:25:46 +02:00
|
|
|
|
2006-06-21 01:43:07 +02:00
|
|
|
./lfs -D /mnt/partition4 \
|
|
|
|
-K ~/jhalfs_configs/linux-2.6.16.19-LFS.config \
|
|
|
|
-F ~/jhalfs-configs/fstab-sda3 \
|
2006-07-13 22:25:46 +02:00
|
|
|
-G -T 0 -M
|
2006-06-21 01:43:07 +02:00
|
|
|
|
|
|
|
explanation:::
|
2006-07-13 22:25:46 +02:00
|
|
|
|
2006-06-21 01:43:07 +02:00
|
|
|
export SRC_ARCHIVE=/mnt/SourceFiles
|
2006-07-13 22:25:46 +02:00
|
|
|
# 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
|
2006-06-21 01:43:07 +02:00
|
|
|
necessary version and store it here for later use. DO NOT set this to
|
2006-07-24 14:29:45 +02:00
|
|
|
$BUILDDIR/sources. If you do not set this variable to a valid directory
|
2006-07-13 22:25:46 +02:00
|
|
|
ALL package tarballs will be downloaded from the 'net.
|
2006-06-21 01:43:07 +02:00
|
|
|
|
2006-07-13 22:25:46 +02:00
|
|
|
-D /mnt/partition4
|
2006-06-21 01:43:07 +02:00
|
|
|
# where everything takes place. ..NOTE it must already exist and be mounted
|
2006-07-13 22:25:46 +02:00
|
|
|
|
2006-06-21 01:43:07 +02:00
|
|
|
-K ~/jhalfs_configs/linux-2.6.16.19-LFS.config
|
2006-07-13 22:25:46 +02:00
|
|
|
# If you want to automatically build a the kernel you MUST supply a valid
|
2006-06-21 01:43:07 +02:00
|
|
|
kernel configuration file. The file you supply will be copied and renamed.
|
|
|
|
|
2006-07-13 22:25:46 +02:00
|
|
|
-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
|
2006-06-21 01:43:07 +02:00
|
|
|
wish to do a build or whenever you update the book.
|
2006-07-13 22:25:46 +02:00
|
|
|
|
2006-06-21 01:43:07 +02:00
|
|
|
-T 0 # don't run any testsuites
|
2006-07-13 22:25:46 +02:00
|
|
|
|
2006-06-21 01:43:07 +02:00
|
|
|
-M # automatically run make against Makefile once jhalfs finishes its work.
|
|
|
|
|
2006-07-13 22:25:46 +02:00
|
|
|
|
2006-04-06 21:35:22 +02:00
|
|
|
5. LAYOUT::
|
|
|
|
|
2006-05-05 00:23:22 +02:00
|
|
|
/CLFS/config
|
|
|
|
/master.sh
|
|
|
|
/xxxx.xsl
|
2006-05-27 10:30:58 +02:00
|
|
|
|
2006-07-23 16:44:13 +02:00
|
|
|
/CLFS2/config
|
|
|
|
/master.sh
|
|
|
|
/xxxx.xsl
|
|
|
|
|
2006-05-05 00:23:22 +02:00
|
|
|
/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
|
2006-05-27 10:30:58 +02:00
|
|
|
|
2006-05-05 00:23:22 +02:00
|
|
|
./clfs ---|
|
2006-07-23 16:44:13 +02:00
|
|
|
./clfs2 ---|
|
2006-05-27 10:30:58 +02:00
|
|
|
./hlfs ---|+---> master.sh
|
|
|
|
./lfs ---|
|
|
|
|
|
|
|
|
|
2006-04-06 21:35:22 +02:00
|
|
|
6. 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-05-05 00:23:22 +02:00
|
|
|
A. Yes it does, try ./lfs --help
|
2006-08-08 19:26:40 +02:00
|
|
|
Remember you must either be 'root' to run this script or 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"
|
|
|
|
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
|
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?"
|
2006-07-24 14:29:45 +02:00
|
|
|
A. The original LFS document worked against the well known location /mnt/lfs.
|
2006-05-03 03:42:16 +02:00
|
|
|
This script automates the build of all of the LFS series of books and uses
|
2006-07-24 14:29:45 +02:00
|
|
|
a generic location $BUILDDIR with a default value of /mnt/build_dir.
|
2006-05-03 03:42:16 +02:00
|
|
|
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/
|
|
|
|
jhalfs (makefile,cmd scripts,logs..etc)
|
2006-05-05 00:23:22 +02:00
|
|
|
sources (where packages reside)
|
2006-05-27 10:30:58 +02:00
|
|
|
tools (temporary bootstrap system)
|
2006-05-05 00:23:22 +02:00
|
|
|
cross-tools (temporary CLFS only)
|
2006-05-03 03:42:16 +02:00
|
|
|
...
|
|
|
|
FHS dir structure
|
|
|
|
...
|
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-04-07 15:26:24 +02:00
|
|
|
A. When then symlinked master.sh runs it creates a local copy of the
|
2006-04-09 12:38:40 +02:00
|
|
|
necessary packages in BUILDDIR/sources by downloading the files. If
|
|
|
|
the variable SRC_ARCHIVE is defined the software will first look in
|
2006-04-07 15:26:24 +02:00
|
|
|
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
|
|
|
|
export SRC_ARCHIVE=/wherever/you/store/downloaded/packages
|
|
|
|
OR
|
2006-07-24 14:29:45 +02:00
|
|
|
you can change the setting in common/config.
|
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
|
2006-04-06 21:35:22 +02:00
|
|
|
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.
|
|
|
|
|
2006-08-08 19:26:40 +02:00
|
|
|
Q. "What is the function of LUSER and LGROUP? There is no cmd line switch"
|
|
|
|
A. If you are running jhalfs from a low or non-priveledged account you may not
|
|
|
|
have the priv to create/delete accounts. These variables are adjustable
|
|
|
|
when invoking make.
|
|
|
|
make LUSER=myaccount LGROUP=mygroup
|
|
|
|
Then only changes to your account will be the creation of a NEW .bashrc after
|
|
|
|
saving your original to .bashrc.XXX
|
|
|
|
|
2006-06-29 03:47:35 +02:00
|
|
|
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
|
2006-07-13 22:25:46 +02:00
|
|
|
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
|
2006-06-29 03:47:35 +02:00
|
|
|
only the temptools phase. You must run ./clfs using the 'boot' method and
|
2006-07-13 22:25:46 +02:00
|
|
|
not the 'chroot.' You must transfer the toolchain to a sparc platform, reboot
|
2006-06-29 03:47:35 +02:00
|
|
|
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
|
|
|
|
carefully and don't skip the easy parts (there are none..)
|
2006-07-13 22:25:46 +02:00
|
|
|
|
2006-04-06 21:35:22 +02:00
|
|
|
Authors:
|
|
|
|
George Boudreau
|
|
|
|
Manuel Canales Esparcia
|
|
|
|
Jeremy Huntwork
|