[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.
|
---|
[50b1fb7] | 7 | This software is an evolution of the original "jhalfs-0.2" code developed
|
---|
| 8 | by Jeremy Huntwork.
|
---|
[4457252] | 9 |
|
---|
[877cc6a] | 10 | The usage of this script assumes you have read and are familiar with
|
---|
[50b1fb7] | 11 | the book(s) and, therefore, the configuration variables found in menuconfig
|
---|
| 12 | interface will have meaning to you.
|
---|
| 13 |
|
---|
| 14 | The list of supported books can be found at
|
---|
| 15 | http://wiki.linuxfromscratch.org/alfs/wiki/SupportedBooks
|
---|
| 16 |
|
---|
[877cc6a] | 17 | NOTES::
|
---|
| 18 | *. The resulting Makefile takes considerable time to run to completion.
|
---|
| 19 | Lay in a supply of caffeine beverages.
|
---|
[4457252] | 20 |
|
---|
[877cc6a] | 21 | *. It is recommended that you temporarily unpack your linux kernel,
|
---|
[e51d4db] | 22 | run <make menuconfig>, configure the kernel as per the book and save
|
---|
[877cc6a] | 23 | the resulting .config file. This suggestion also applies to the
|
---|
| 24 | configuration of the uClibc package when building a HLFS system using
|
---|
| 25 | uClibc rather than glibc.
|
---|
| 26 |
|
---|
[3e7ceed] | 27 | *. Read carefully this file and the other README.* files before start
|
---|
| 28 | using the tool.
|
---|
| 29 |
|
---|
[f4ed135] | 30 | 2. PREREQUISITES::
|
---|
| 31 |
|
---|
| 32 | To use this tool you MUST:
|
---|
| 33 |
|
---|
| 34 | - have experience building {c,h,b}LFS packages
|
---|
| 35 | - know how to edit and write shell scripts
|
---|
| 36 | - know how a Makefile works
|
---|
| 37 | - be able to trace build failures and to find what is causing it
|
---|
| 38 | (user error, package bug, {c,h,b}LFS command bug, or jhalfs code bug)
|
---|
| 39 |
|
---|
[597d802] | 40 | If you do not have the above skills, please don't use this tool.
|
---|
[f4ed135] | 41 |
|
---|
| 42 |
|
---|
| 43 | 3. INSTALLATION::
|
---|
[597d802] | 44 |
|
---|
[50b1fb7] | 45 | No installation is required. System-wide installation is not allowed.
|
---|
[877cc6a] | 46 |
|
---|
[50b1fb7] | 47 | 4. CONFIGURATION::
|
---|
[877cc6a] | 48 |
|
---|
[a705708] | 49 | We have installed the familiar menu based configuration tool driven by
|
---|
[50b1fb7] | 50 | GNU make. see the section RUNNING, for details
|
---|
[a705708] | 51 |
|
---|
[f4ed135] | 52 | 5. RUNNING::
|
---|
[7785f91] | 53 |
|
---|
[597d802] | 54 | The command <make> will launch a menu based configuration program. You will
|
---|
[50b1fb7] | 55 | recognize the layout from building the kernel or uClibc/BusyBox. The
|
---|
| 56 | underlying menu code was borrowed from BusyBox and slightly modified for
|
---|
[597d802] | 57 | our use.
|
---|
[7785f91] | 58 |
|
---|
[6acdc9c] | 59 | Help on parameter function is available from the on-line help. Please
|
---|
[86d7ef3] | 60 | make use of that feature for additional information not in this file.
|
---|
[50b1fb7] | 61 |
|
---|
| 62 | Once you have set the parameters you wish and have saved your work the
|
---|
| 63 | jhalfs script is launch. The script verify first that the host can run
|
---|
| 64 | it and build the xLFS system, then validate the configuration and present
|
---|
| 65 | you with your selections which you may accept or reject.
|
---|
| 66 |
|
---|
[597d802] | 67 | If you accepted the displayed settings jhalfs will proceed to create the
|
---|
[50b1fb7] | 68 | Makefile, optionally download packages.
|
---|
| 69 |
|
---|
[adc85de] | 70 | IMPORTANT::
|
---|
[50b1fb7] | 71 | You must be logged as a normal user with sudo privileges to run
|
---|
[adc85de] | 72 | the Makefile. Furthermore, you are supposed to have enough privilege
|
---|
| 73 | to become any user. If you are not bothered about security issues,
|
---|
| 74 | the entry for the user "jhalfs_user" in /etc/sudoers could be
|
---|
| 75 | jhalfs_user ALL=(ALL) NOPASSWD:ALL
|
---|
[ddde18e] | 76 |
|
---|
[50b1fb7] | 77 | NOTE::
|
---|
| 78 | If you run the jhalfs script directly the only function you can select
|
---|
| 79 | is to display the version number running <./jhalfs -v>
|
---|
[ddde18e] | 80 |
|
---|
[c2b6002] | 81 | 6. BLFS_TOOL SUPPORT::
|
---|
[7785f91] | 82 |
|
---|
[d7818f5] | 83 | For books that support it (TODO: which ones?), there is an option
|
---|
| 84 | to install an automated framework for building BLFS packages. Let
|
---|
| 85 | us call it blfs-tool for now. When you tick `BOOK Settings/Add
|
---|
| 86 | blfs-tool support' in jhalfs configuration menu, the tools are
|
---|
| 87 | installed in $BLFS_ROOT (default /blfs_root) on the xLFS system,
|
---|
| 88 | and a few dependencies (which you may select) are built at the
|
---|
[9a865396] | 89 | end of the jhalfs run, before the custom tools. As of March 8, 2012,
|
---|
| 90 | works only with LFS. The instructions for building the dependencies
|
---|
| 91 | are taken from the BLFS book.
|
---|
[c2b6002] | 92 |
|
---|
[d7818f5] | 93 | (TODO: is this relevant to present CLFS?)
|
---|
[52b0d10] | 94 | WARNING:: If you add blfs-tool support on a CLFS Sysroot build
|
---|
[d7818f5] | 95 | you MUST edit the scripts to fix the installation paths.
|
---|
[cd4466f] | 96 |
|
---|
[c2b6002] | 97 | After booting the new xLFS system some steps are needed to finish
|
---|
[d7818f5] | 98 | the installation of the automated tools:
|
---|
[c2b6002] | 99 |
|
---|
[9416165] | 100 | - A user account must be created. You must be logged on that user
|
---|
[d7818f5] | 101 | account to use blfs-tool. This is not strictly necessary,
|
---|
| 102 | since the packages can be built as root, too, but it is
|
---|
| 103 | never a good idea to build packages as root.
|
---|
[c2b6002] | 104 |
|
---|
[9416165] | 105 | - Move /blfs-root to that user's home and change ownership of the
|
---|
| 106 | directory and files to the user.
|
---|
[c2b6002] | 107 |
|
---|
[9416165] | 108 | - Give the user read and write privileges over the $TRACKING_DIR
|
---|
[c2b6002] | 109 | directory and the files that it contains.
|
---|
| 110 |
|
---|
[d7818f5] | 111 | - Configure sudo, adding the needed privileges for the user. For
|
---|
| 112 | newer sudo version, do not forget to add a line Defaults secure_path=
|
---|
| 113 | containing /sbin and /usr/sbin (in /etc/sudoers), otherwise some
|
---|
| 114 | executables are not found.
|
---|
| 115 |
|
---|
| 116 | - Although it is not strictly necessary, it is recommended to install
|
---|
| 117 | the bash shell startup files (as per `3.After LFS Configuration
|
---|
| 118 | Issues' of the BLFS book), as some instructions in BLFS rely on
|
---|
| 119 | their being present.
|
---|
[c2b6002] | 120 |
|
---|
| 121 | We assume that blfs-tool will be used on a running fresh xLFS system.
|
---|
| 122 | To use it to build BLFS packages from the chroot jail is also possible,
|
---|
[d7818f5] | 123 | but not supported.
|
---|
[c2b6002] | 124 |
|
---|
[d7818f5] | 125 | To know how to use blfs-tool, see README.BLFS.
|
---|
[c2b6002] | 126 |
|
---|
| 127 | 7. LAYOUT::
|
---|
[877cc6a] | 128 |
|
---|
[50b1fb7] | 129 | /BLFS (see README.BLFS)
|
---|
| 130 |
|
---|
| 131 | /CLFS/master.sh
|
---|
| 132 | /clfs.xsl
|
---|
[d3b8635] | 133 |
|
---|
[50b1fb7] | 134 | /CLFS2/master.sh
|
---|
| 135 | /clfs2.xsl
|
---|
[7432834] | 136 |
|
---|
[d517356] | 137 | /CLFS3/master.sh
|
---|
| 138 | /clfs3.xsl
|
---|
| 139 |
|
---|
[50b1fb7] | 140 | /HLFS/master.sh
|
---|
| 141 | /hlfs.xsl
|
---|
[b240ee6] | 142 |
|
---|
[50b1fb7] | 143 | /LFS/master.sh
|
---|
| 144 | /lfs.xsl
|
---|
[b240ee6] | 145 |
|
---|
[50b1fb7] | 146 | /common/common_functions
|
---|
[b240ee6] | 147 | /makefile_functions
|
---|
[50b1fb7] | 148 | /packages.xsl
|
---|
| 149 | /urls.xsl
|
---|
| 150 | /create-sbu_du-report.sh
|
---|
| 151 | /progress_bar.sh
|
---|
| 152 | /blfs-tool-deps/9xx-*
|
---|
[fe30c61] | 153 | /libs/func_*
|
---|
[b240ee6] | 154 |
|
---|
[daa489d] | 155 | /custom/template
|
---|
| 156 | /config/
|
---|
| 157 | /examples/*
|
---|
| 158 | /examples_CLFS-E/*
|
---|
[b240ee6] | 159 |
|
---|
[50b1fb7] | 160 | /extras/do_copy_files
|
---|
[b240ee6] | 161 | /do_ica_prep
|
---|
| 162 | /do_ica_work
|
---|
| 163 | /farce
|
---|
| 164 | /filelist
|
---|
| 165 |
|
---|
[50b1fb7] | 166 | /optimize/opt_config
|
---|
| 167 | /opt_override
|
---|
| 168 | /optimize_functions
|
---|
| 169 | /opt_config.d/noOpt
|
---|
| 170 | /noSymbols
|
---|
| 171 | /O3pipe
|
---|
| 172 | /O3pipe_march
|
---|
| 173 | /defOpt_fPIC
|
---|
| 174 |
|
---|
| 175 | /menu/*
|
---|
| 176 |
|
---|
[597d802] | 177 | README
|
---|
[50b1fb7] | 178 | README.BLFS
|
---|
[daa489d] | 179 | README.CLFS
|
---|
[50b1fb7] | 180 | README.HLFS
|
---|
[daa489d] | 181 | README.CUSTOM
|
---|
[50b1fb7] | 182 | TODO
|
---|
| 183 | LICENSE
|
---|
[d3b8635] | 184 |
|
---|
[50b1fb7] | 185 | Config.in
|
---|
| 186 | Makefile
|
---|
| 187 | jhalfs
|
---|
| 188 | blfs-tool
|
---|
[d3b8635] | 189 |
|
---|
[c2b6002] | 190 | 8. FAQ::
|
---|
[60a5064] | 191 | Q. "This 'help' file is very sparse"
|
---|
| 192 | A. Yes, it is. This tool, jhalfs, is for those who understand the LFS books
|
---|
| 193 | and wish to automate the build. 99% of any problems that arise can be
|
---|
| 194 | solved by reading the book(s).
|
---|
[6ad5a2f] | 195 |
|
---|
[e51d4db] | 196 | Q. "It doesn't work!"
|
---|
[597d802] | 197 | A. Yes it does, try >> make
|
---|
[50b1fb7] | 198 | Remember you must have 'sudo' privileges.
|
---|
[7785f91] | 199 |
|
---|
[ac1d897] | 200 | Q. "It still doesn't work"
|
---|
[50b1fb7] | 201 | A. jhalfs was designed to work against the development versions of the LFS
|
---|
[ac1d897] | 202 | series of books. Consequently changes in a book(s) sometimes breaks older
|
---|
| 203 | versions of jhalfs. Before you start pulling out your hair download the
|
---|
[7785f91] | 204 | latest version of jhalfs to see if that solves your problem.
|
---|
[d3b8635] | 205 |
|
---|
[e51d4db] | 206 | Q. "How do I specify the build location?"
|
---|
[d385453] | 207 | A. The original LFS document worked against the well known location /mnt/lfs.
|
---|
[511923a] | 208 | This script automates the build of all of the LFS series of books and uses
|
---|
[d385453] | 209 | a generic location $BUILDDIR with a default value of /mnt/build_dir.
|
---|
[511923a] | 210 | You may change this value to suit your needs.
|
---|
[d3b8635] | 211 |
|
---|
[511923a] | 212 | The layout below $BUILDDIR is as follows.
|
---|
| 213 | $BUILDDIR/
|
---|
[50b1fb7] | 214 | jhalfs (Makefile, cmd scripts, logs, etc..)
|
---|
| 215 | sources (where packages reside)
|
---|
| 216 | tools (temporary bootstrap system)
|
---|
| 217 | cross-tools (temporary CLFS only)
|
---|
| 218 | ...
|
---|
| 219 | FHS dir structure
|
---|
| 220 | ...
|
---|
| 221 | blfs_root (files to use blfs-tool if selected to install it)
|
---|
[d3b8635] | 222 |
|
---|
[e51d4db] | 223 | Q. "What is the function of the SRC_ARCHIVE variable?"
|
---|
[50b1fb7] | 224 | A. When jhalfs runs and packages download was selected, it creates a local
|
---|
| 225 | copy of the necessary packages in BUILDDIR/sources by downloading the
|
---|
| 226 | files. If the variable SRC_ARCHIVE is defined the software will first
|
---|
| 227 | look in this location for the file and, if found, will copy it to
|
---|
| 228 | BUILDDIR/sources.
|
---|
[73e5448] | 229 | If the files are not found in SRC_ARCHIVE _and_ you have write priv to
|
---|
[f4b3d20] | 230 | the directory any downloaded files will be mirrored there.
|
---|
[d3b8635] | 231 |
|
---|
[e51d4db] | 232 | Q. "How do I set the SRC_ARCHIVE location?"
|
---|
[511923a] | 233 | A. The best way to set the value of SRC_ARCHIVE is
|
---|
[50b1fb7] | 234 |
|
---|
[511923a] | 235 | export SRC_ARCHIVE=/wherever/you/store/downloaded/packages
|
---|
[50b1fb7] | 236 |
|
---|
| 237 | or you can set the full path in the proper menu entry.
|
---|
[d3b8635] | 238 |
|
---|
[e51d4db] | 239 | Q. "Why have 2 copies of the files?"
|
---|
[73e5448] | 240 | A. The package files must be visible during the chroot phase and this is a
|
---|
[877cc6a] | 241 | simple and reliable method of doing so. This method also handles the CLFS
|
---|
[50b1fb7] | 242 | boot build method where the final build may be done on a separate machine.
|
---|
| 243 |
|
---|
| 244 | Q. "What is the function of "User account" and "Group account" menu settings?"
|
---|
| 245 | A. If you are running jhalfs from a low or non-privileged account you may not
|
---|
[b11c10b] | 246 | have the priv to create/delete the user needed to build temporary tools.
|
---|
[50b1fb7] | 247 | These settings allow you to use your own user and group name to do that
|
---|
| 248 | build steps.
|
---|
| 249 |
|
---|
| 250 | These variables are adjustable also when invoking make:
|
---|
[877cc6a] | 251 |
|
---|
[597d802] | 252 | $BUILDDIR make LUSER=myaccount LGROUP=mygroup
|
---|
[6ad5a2f] | 253 |
|
---|
[50b1fb7] | 254 | The only changes to your account will be the creation of a NEW .bashrc
|
---|
| 255 | after saving your original to .bashrc.XXX
|
---|
| 256 |
|
---|
| 257 | Q. "When I try to build CLFS the Makefile fails at the mid-point"
|
---|
[bab90a1] | 258 | A. There could be numerous reasons for the failure but the most likely reason
|
---|
| 259 | is you are doing a cross-build using the 'chroot' method and the target is
|
---|
| 260 | not compatible with the host. If you choose to build using the chroot
|
---|
| 261 | method a test is performed at the end of the temptools phase. If the test
|
---|
| 262 | succeeds the build continues inside a chroot jail. However if the test fails
|
---|
[7785f91] | 263 | it means the host and target are not compatible an you should use the
|
---|
| 264 | 'boot' method to create your target code.
|
---|
| 265 | As an extreme example: You can build a sparc target on a x86 platform but
|
---|
[50b1fb7] | 266 | only the temptools phase. You must select the 'boot' method and not the
|
---|
[597d802] | 267 | 'chroot.' You must transfer the toolchain to a sparc platform, reboot the
|
---|
| 268 | sparc box and continue the build.
|
---|
[d385453] | 269 | Of all the LFS series of books Cross-LFS requires the greatest
|
---|
[bab90a1] | 270 | understanding of host/target hardware combination. Please read the book
|
---|
| 271 | carefully and don't skip the easy parts (there are none..)
|
---|
[7785f91] | 272 |
|
---|
[dbcdfd7] | 273 | Q. "How could I stop the build at a predefined chosen point?"
|
---|
| 274 | A. Launch the Makefile manually passing the last numbered target to be build
|
---|
| 275 | as the break point. For example:
|
---|
| 276 |
|
---|
| 277 | make BREAKPOINT=84-bash
|
---|
| 278 |
|
---|
| 279 | The build can be stopped also at the end of a top-level build phase by
|
---|
| 280 | calling directly the appropriate mk_* target. For example:
|
---|
| 281 |
|
---|
| 282 | make mk_LUSER
|
---|
| 283 |
|
---|
| 284 | See the Makefile to know the proper target names for that book build.
|
---|
| 285 |
|
---|
[877cc6a] | 286 | Authors:
|
---|
| 287 | George Boudreau
|
---|
| 288 | Manuel Canales Esparcia
|
---|