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