[877cc6a] | 1 | $Id$
|
---|
[4457252] | 2 |
|
---|
[877cc6a] | 3 | 1. INTRODUCTION::
|
---|
[4457252] | 4 |
|
---|
[73e5448] | 5 | This collection of scripts, known as jhalfs, strives to create
|
---|
[877cc6a] | 6 | accurate makefiles from the Linux From Scratch book series XML files.
|
---|
[73e5448] | 7 | This software is an evolution of the original "jhalfs-0.2" code.
|
---|
[4457252] | 8 |
|
---|
[877cc6a] | 9 | The usage of this script assumes you have read and are familiar with
|
---|
| 10 | the book(s) and, therefore, the configuration variables found in config
|
---|
| 11 | files will have meaning to you. There are a number of command line switches
|
---|
| 12 | which, if used, will override the config file settings.
|
---|
[4457252] | 13 |
|
---|
[877cc6a] | 14 | NOTES::
|
---|
| 15 | *. The resulting Makefile takes considerable time to run to completion.
|
---|
| 16 | Lay in a supply of caffeine beverages.
|
---|
[4457252] | 17 |
|
---|
[877cc6a] | 18 | *. It is recommended that you temporarily unpack your linux kernel,
|
---|
[e51d4db] | 19 | run <make menuconfig>, configure the kernel as per the book and save
|
---|
[877cc6a] | 20 | the resulting .config file. This suggestion also applies to the
|
---|
| 21 | configuration of the uClibc package when building a HLFS system using
|
---|
| 22 | uClibc rather than glibc.
|
---|
| 23 |
|
---|
| 24 | 2. INSTALLATION::
|
---|
| 25 | No installation is required. System-wide installation is not allowed
|
---|
| 26 | for now.
|
---|
| 27 |
|
---|
| 28 | 3. CONFIGURATION FILES::
|
---|
| 29 | Each book in the LFS series has its own set of configurable parameters
|
---|
| 30 | as well as the common parameters file.
|
---|
| 31 |
|
---|
| 32 | 4. RUNNING::
|
---|
| 33 | The script master.sh cannot be invoked directly but only via the
|
---|
| 34 | supplied symlinks. After editing the config file for the project you wish
|
---|
| 35 | to build, run the script.
|
---|
[73e5448] | 36 |
|
---|
[a03a4aa] | 37 | IMPORTANT:
|
---|
| 38 | If you use the switch -M (automatically run the generated makefile) you
|
---|
| 39 | must be 'root' or you can run the scripts using 'sudo'
|
---|
[7785f91] | 40 | i.e. sudo ./lfs -G -M
|
---|
| 41 |
|
---|
[a03a4aa] | 42 | If you want to run make manually you can only do so if you are 'root' or
|
---|
[7785f91] | 43 | via 'sudo'
|
---|
[a03a4aa] | 44 | i.e (from within the jhalfs directory) sudo make
|
---|
| 45 |
|
---|
[d3b8635] | 46 | The term <symlink> refers to the 1 of 3 package symlinks, lfs,hlfs,clfs.
|
---|
[877cc6a] | 47 | Replace <symlink> with your choice of packages; i.e.: ./lfs
|
---|
| 48 |
|
---|
[b240ee6] | 49 | ./<symlink> eg: ./lfs or ./hlfs
|
---|
[877cc6a] | 50 | Create a makefile based on the settings found in the config files.
|
---|
| 51 | You must enter the build partition/jhalfs directory and manually run <make>
|
---|
| 52 |
|
---|
[b240ee6] | 53 | ./<symlink> -G eg: ./lfs -G
|
---|
[877cc6a] | 54 | Download the packages and patches necessary to build <symlink>
|
---|
| 55 |
|
---|
[b240ee6] | 56 | ./<symlink> -G -M eg: ./lfs -G -M
|
---|
[877cc6a] | 57 | Download the packages, create and automatically run the Makefile
|
---|
| 58 |
|
---|
[b240ee6] | 59 | ./<symlink> --help eg: ./lfs --help
|
---|
| 60 | will give you a context sensitive list of command line switches.
|
---|
[877cc6a] | 61 |
|
---|
[ddde18e] | 62 | >>>> an expanded example
|
---|
[7785f91] | 63 |
|
---|
[ddde18e] | 64 | export SRC_ARCHIVE=/mnt/SourceFiles
|
---|
[7785f91] | 65 |
|
---|
[ddde18e] | 66 | ./lfs -D /mnt/partition4 \
|
---|
| 67 | -K ~/jhalfs_configs/linux-2.6.16.19-LFS.config \
|
---|
| 68 | -F ~/jhalfs-configs/fstab-sda3 \
|
---|
[7785f91] | 69 | -G -T 0 -M
|
---|
[ddde18e] | 70 |
|
---|
| 71 | explanation:::
|
---|
[7785f91] | 72 |
|
---|
[ddde18e] | 73 | export SRC_ARCHIVE=/mnt/SourceFiles
|
---|
[7785f91] | 74 | # This points to a local archive of existing packages. If the version in
|
---|
| 75 | the archive is incorrect jhalfs will access the net and download the
|
---|
[ddde18e] | 76 | necessary version and store it here for later use. DO NOT set this to
|
---|
[95a954c] | 77 | $BUILDDIR/sources. If you do not set this variable to a valid directory
|
---|
[7785f91] | 78 | ALL package tarballs will be downloaded from the 'net.
|
---|
[ddde18e] | 79 |
|
---|
[7785f91] | 80 | -D /mnt/partition4
|
---|
[ddde18e] | 81 | # where everything takes place. ..NOTE it must already exist and be mounted
|
---|
[7785f91] | 82 |
|
---|
[ddde18e] | 83 | -K ~/jhalfs_configs/linux-2.6.16.19-LFS.config
|
---|
[7785f91] | 84 | # If you want to automatically build a the kernel you MUST supply a valid
|
---|
[ddde18e] | 85 | kernel configuration file. The file you supply will be copied and renamed.
|
---|
| 86 |
|
---|
[7785f91] | 87 | -F ~/jhalfs-configs/fstab-sda3
|
---|
| 88 | # If you have a fstab file you wish to use it will be copied and renamed
|
---|
| 89 |
|
---|
| 90 | -G # Retrieve the package files. You MUST enable this flag at least once if you
|
---|
[ddde18e] | 91 | wish to do a build or whenever you update the book.
|
---|
[7785f91] | 92 |
|
---|
[ddde18e] | 93 | -T 0 # don't run any testsuites
|
---|
[7785f91] | 94 |
|
---|
[ddde18e] | 95 | -M # automatically run make against Makefile once jhalfs finishes its work.
|
---|
| 96 |
|
---|
[7785f91] | 97 |
|
---|
[877cc6a] | 98 | 5. LAYOUT::
|
---|
| 99 |
|
---|
[b240ee6] | 100 | /CLFS/config
|
---|
| 101 | /master.sh
|
---|
| 102 | /xxxx.xsl
|
---|
[d3b8635] | 103 |
|
---|
[b240ee6] | 104 | /HLFS/config
|
---|
| 105 | /master.sh
|
---|
| 106 | /xxxx.xsl
|
---|
| 107 |
|
---|
| 108 | /LFS/config
|
---|
| 109 | / master.sh
|
---|
| 110 | /xxxx.xsl
|
---|
| 111 |
|
---|
| 112 | /common/config
|
---|
| 113 | /common_functions
|
---|
| 114 | /makefile_functions
|
---|
| 115 | /func_check_versions.sh
|
---|
| 116 | /func_validate_configs.sh
|
---|
| 117 |
|
---|
| 118 | /contrib/jhalfs-paco.patch
|
---|
| 119 |
|
---|
| 120 | /extras/do_copy_files
|
---|
| 121 | /do_ica_prep
|
---|
| 122 | /do_ica_work
|
---|
| 123 | /farce
|
---|
| 124 | /filelist
|
---|
| 125 |
|
---|
| 126 | README
|
---|
| 127 | README.PACO
|
---|
| 128 | TODO
|
---|
[d3b8635] | 129 |
|
---|
[b240ee6] | 130 | ./clfs ---|
|
---|
[d3b8635] | 131 | ./hlfs ---|+---> master.sh
|
---|
| 132 | ./lfs ---|
|
---|
| 133 |
|
---|
| 134 |
|
---|
[877cc6a] | 135 | 6. FAQ::
|
---|
[60a5064] | 136 | Q. "This 'help' file is very sparse"
|
---|
| 137 | A. Yes, it is. This tool, jhalfs, is for those who understand the LFS books
|
---|
| 138 | and wish to automate the build. 99% of any problems that arise can be
|
---|
| 139 | solved by reading the book(s).
|
---|
| 140 |
|
---|
[e51d4db] | 141 | Q. "It doesn't work!"
|
---|
[b240ee6] | 142 | A. Yes it does, try ./lfs --help
|
---|
[7785f91] | 143 |
|
---|
[ac1d897] | 144 | Q. "It still doesn't work"
|
---|
| 145 | A. jhalfs was designed to work against the developement versions of the LFS
|
---|
| 146 | series of books. Consequently changes in a book(s) sometimes breaks older
|
---|
| 147 | versions of jhalfs. Before you start pulling out your hair download the
|
---|
[7785f91] | 148 | latest version of jhalfs to see if that solves your problem.
|
---|
[d3b8635] | 149 |
|
---|
[e51d4db] | 150 | Q. "How do I specify the build location?"
|
---|
[95a954c] | 151 | A. The original LFS document worked against the well known location /mnt/lfs.
|
---|
[511923a] | 152 | This script automates the build of all of the LFS series of books and uses
|
---|
[95a954c] | 153 | a generic location $BUILDDIR with a default value of /mnt/build_dir.
|
---|
[511923a] | 154 | You may change this value to suit your needs.
|
---|
[d3b8635] | 155 |
|
---|
[511923a] | 156 | The layout below $BUILDDIR is as follows.
|
---|
| 157 | $BUILDDIR/
|
---|
| 158 | jhalfs (makefile,cmd scripts,logs..etc)
|
---|
[b240ee6] | 159 | sources (where packages reside)
|
---|
[d3b8635] | 160 | tools (temporary bootstrap system)
|
---|
[b240ee6] | 161 | cross-tools (temporary CLFS only)
|
---|
[511923a] | 162 | ...
|
---|
| 163 | FHS dir structure
|
---|
| 164 | ...
|
---|
[d3b8635] | 165 |
|
---|
[e51d4db] | 166 | Q. "What is the function of the SRC_ARCHIVE variable?"
|
---|
[f4b3d20] | 167 | A. When then symlinked master.sh runs it creates a local copy of the
|
---|
[73e5448] | 168 | necessary packages in BUILDDIR/sources by downloading the files. If
|
---|
| 169 | the variable SRC_ARCHIVE is defined the software will first look in
|
---|
[f4b3d20] | 170 | this location for the file and, if found, will copy it to BUILDDIR/sources.
|
---|
[73e5448] | 171 | If the files are not found in SRC_ARCHIVE _and_ you have write priv to
|
---|
[f4b3d20] | 172 | the directory any downloaded files will be mirrored there.
|
---|
[d3b8635] | 173 |
|
---|
[e51d4db] | 174 | Q. "How do I set the SRC_ARCHIVE location?"
|
---|
[511923a] | 175 | A. The best way to set the value of SRC_ARCHIVE is
|
---|
| 176 | export SRC_ARCHIVE=/wherever/you/store/downloaded/packages
|
---|
| 177 | OR
|
---|
[95a954c] | 178 | you can change the setting in common/config.
|
---|
[d3b8635] | 179 |
|
---|
[e51d4db] | 180 | Q. "Why have 2 copies of the files?"
|
---|
[73e5448] | 181 | A. The package files must be visible during the chroot phase and this is a
|
---|
[877cc6a] | 182 | simple and reliable method of doing so. This method also handles the CLFS
|
---|
| 183 | build method where the final build may be done on a separate machine.
|
---|
| 184 |
|
---|
[bab90a1] | 185 | Q. "When I try to build 'xxx' with clfs the makefile fails at the mid-point"
|
---|
| 186 | A. There could be numerous reasons for the failure but the most likely reason
|
---|
| 187 | is you are doing a cross-build using the 'chroot' method and the target is
|
---|
| 188 | not compatible with the host. If you choose to build using the chroot
|
---|
| 189 | method a test is performed at the end of the temptools phase. If the test
|
---|
| 190 | succeeds the build continues inside a chroot jail. However if the test fails
|
---|
[7785f91] | 191 | it means the host and target are not compatible an you should use the
|
---|
| 192 | 'boot' method to create your target code.
|
---|
| 193 | As an extreme example: You can build a sparc target on a x86 platform but
|
---|
[bab90a1] | 194 | only the temptools phase. You must run ./clfs using the 'boot' method and
|
---|
[7785f91] | 195 | not the 'chroot.' You must transfer the toolchain to a sparc platform, reboot
|
---|
[bab90a1] | 196 | the sparc box and continue the build.
|
---|
[95a954c] | 197 | Of all the LFS series of books Cross-LFS requires the greatest
|
---|
[bab90a1] | 198 | understanding of host/target hardware combination. Please read the book
|
---|
| 199 | carefully and don't skip the easy parts (there are none..)
|
---|
[7785f91] | 200 |
|
---|
[bab90a1] | 201 |
|
---|
[877cc6a] | 202 | Authors:
|
---|
| 203 | George Boudreau
|
---|
| 204 | Manuel Canales Esparcia
|
---|
| 205 | Jeremy Huntwork
|
---|