source: README.BLFS@ 9683707

ablfs
Last change on this file since 9683707 was d08afa5, checked in by Pierre Labastie <pierre@…>, 13 years ago

Restore a note about xorg7-font which had disappeared when updating README.BLFS

  • Property mode set to 100644
File size: 12.5 KB
RevLine 
[824b6e4]1$Id$
2
31. INTRODUCTION::
4
[63fc514]5 If you want to add blfs-tool support into an xLFS base system build,
[83ace0a]6 read the "BLFS_TOOL SUPPORT" section found in the README and be sure
7 to follow the after-booting installation intructions.
[d262d17]8
[392bd25]9 To automate package builds from the BLFS book instructions is a huge
10 task. Some of the issues are: the BLFS book isn't linear; some package
11 pages use a custom layout; there are circular dependencies; several
12 packages can be installed on a non-default prefix; build commands can
13 change based on what dependencies will be used, etc.
[824b6e4]14
[392bd25]15 That being said, the goal of the blfs-tool is to help you solve package
16 dependencies, create build scripts and a Makefile. Few of the auto-generated
17 build scripts and Makefile will work "as is", thus, as a general rule,
18 you will need to review and edit the scripts while reading the book.
[824b6e4]19
20
[f4ed135]212. PREREQUISITES::
22
[392bd25]23 To use this tool you MUST:
[f4ed135]24
25 - have experience building BLFS packages
26 - know how to edit and write shell scripts
27 - know how a Makefile works
28 - be able to trace build failures and to find what is causing it
29 (user error, package bug, BLFS command bug, or jhalfs code bug)
30
[a54e1f1]31 If you do not have the above skills, please don't use this tool.
[f4ed135]32
33
343. USAGE::
[824b6e4]35
[392bd25]36 Due the complexity of the BLFS book, the scripts and Makefile generation
37 is done in several steps:
[824b6e4]38
[63fc514]39 3.1 INSTALLED PACKAGES TRACKING SYSTEM::
[a54e1f1]40
[392bd25]41 This tool includes a very simple tracking system to log which packages
42 have been installed using the tool. It is used to skip installed packages
43 from target selection menu and to test if an installed package has been
44 updated in the BLFS book. Do not rely on this feature as a package
45 management tool.
[a54e1f1]46
[63fc514]47 The tracking system itself is an XML file: instpkg.xml. It is
[d7818f5]48 initialized when <make> is first run in blfs_root. It resides in a
49 directory, which is created when needed during the process of building
50 custom tools or blfs dependencies, right after xLFS. You can specify
51 that directory location in the blfs-tools submenu of jhalfs. You may
52 need to update permissions and/or ownership of this directory before
53 using the blfs tool (see README in jhalfs).
[a54e1f1]54
[d7818f5]55 The default location of the tracking directory is /var/lib/jhalfs/BLFS.
56 NB : after the initial build, that directory is only used to contain
57 instpkg.xml
[a54e1f1]58
59 3.2 BLFS_TOOL INSTALLATION::
[f4ed135]60
[63fc514]61 The tools are installed just after the building of xLFS, if the
62 appropriate options have been selected in the building menu, as per
63 jhalfs README. If you forgot to select the options and xLFS has been
64 built, it is possible to go back to selecting the appropriate
65 BLFS tools options in the jhalfs menu, then tick `Run makefile'
66 and not `Rebuild files'. You obtain a /blfs_root directory in the
67 root directory of the new xLFS system, which contains the followings:
[824b6e4]68
[d7818f5]69 blfs-xml/* SVN tree of the selected BLFS book version
70 lib/constants.inc functions libraries
71 /func_dependencies for building the dependency tree
72 menu/* lxdialog and menuconfig source code
73 xsl/gen_pkg_list.xsl XSL stylesheet to generate the package database
74 /gen_config.xsl XSL stylesheet to generate the Config.in file
75 for use in the menuconfig system
76 /dependencies.xsl XSL stylesheet to generate the dependency list
77 of a package
78 /make_book.xsl XSL stylesheet to generate the linear book.xml
79 /scripts.xsl XSL stylesheet to generate the scriptlets from
80 book.xml
81 /bump.xsl XSL stylesheet to generate to update the tracking
82 file
83 README.BLFS this file
84 TODO developers notes (well, not updated often)
85 gen_pkg_book.sh resolves dependencies and generates linear BLFS
86 books and build scripts
87 gen-makefile.sh generates the target Makefile
88 progress_bar.sh the target Makefile progress bar
89 gen-special.sh Helper script for generating the package database
90 Makefile Used by make to update the package database from
91 the SVN tree, then launch the menuconfig interface,
92 and run gen_pkg_book.sh based on configuration
93 settings
94 packdesc.dtd a simple DTD describing the format of the package
95 database and the tracking file.
96 envars.conf envars needed when running the target build scripts
97
98 Several files are generated during the process:
99
100 packages.xml auto-generated packages database
101 Config.in input file for the menu driven choices
102 configuration file generated by the menuconfig process
103 dependencies/* files recording the dependency tree
104 book.xml the linearized book
105 book-html/* the linearized book rendered in html
106 scripts/* the scriptlets
[824b6e4]107
108 From now on, all the work must be done from inside the installation
109 root directory.
110
[63fc514]111 You may move that directory to the $HOME of a non root user, or build
112 as root from that directory.
[a54e1f1]113
114 3.3 UPDATING BOOK SOURCES::
[f4ed135]115
[392bd25]116 If you are using the development book version and you want to update
117 installed packages to the latest version found in that book, you need to
[d7818f5]118 update the XML sources and packages database. This is not necessary if
119 you just built xLFS, and you can skip to step 3.4.
[f4ed135]120
[63fc514]121 To do that run "make update". It may happen that the subversion
122 version of your building host is older than the version you just
123 built. This may generate weird errors like "'.' omitted". The easiest
124 thing to do in that case, is to completely remove the blfs-xml directory
125 and run "make update".
[f4ed135]126
[a54e1f1]127 On the next configuration run, packages already installed but listed
[392bd25]128 with a new version in the book will be available for target selection
129 and used to solve dependencies.
[a54e1f1]130
131 3.4 CONFIGURING AND PARSING THE BOOK::
[824b6e4]132
[392bd25]133 The next step is to create a book and build scripts in dependency
[63fc514]134 build order for one or several packages.
[ab412b4]135
[a54e1f1]136 Run <make> to launch the configuration interface. The main menu contains
[63fc514]137 two blocks: individual package selection, and build options.
[824b6e4]138
[392bd25]139 In the build options section, the dependencies level and default packages
[d7818f5]140 used to solve alternatives are set (currently, only for the MTA). You can
[63fc514]141 also select whether the build will be made as a normal user or as root.
142 Those settings are saved to be reused in future configuration runs.
143
[d7818f5]144 Note that you may select as many targets as you want, not just one
145 as in the previous version of this tool. But we suggest to not select
146 too many at a time to be able to sort issues!
147
[63fc514]148 When you are done with the menu, a few checks occur, and the book is
149 generated. When circular dependencies are found, a 3 line message is
150 printed:
151 A is a dependency of B
152 C is a dependency of A
153 A is a dependency of C
154 and a question:
155 Do you want to build A first?
156 This means that the system has found the dependency chain: B->A->C->A.
157 You have therefore to choose whether A is built before C, or
158 C before A: the system cannot make that choice (well, maybe in a few
[d7818f5]159 year, with an AI system able to understand the book). If you answer no,
[63fc514]160 C is built first. If you answer yes, C is put in place of A as a dependency
161 of B, then the tree dependency restarts from there, that is with the
162 layout B->C->... You may then hit the case B->C->A->C, for which you
163 should answer no, unless you want to enter an infinite (human driven) loop.
164
165 You end up with a book.xml file which contains the linearized book,
166 and a rendered HTML, in the directory book-html, which you can browse with
167 "lynx book-html/index.html" (or with any other browser).
168
169 Furthermore, there is a directory "scripts", which contains the generated
170 scriptlets.
171
172 There is also another directory, "dependencies" that contains files
173 generated while resolving dependencies.
[f4ed135]174
[d7818f5]175 3.5 EDITING BUILD SCRIPTS::
[f4ed135]176
[63fc514]177 Now it is time to review the generated book and scripts, making any
178 changes to the scripts necessary to fix generation bugs or to suit your
179 needs.
[824b6e4]180
[f4ed135]181 Scripts for additional packages (i.e., for non-BLFS packages) can be
[392bd25]182 easily inserted. For example, if you want to install the external dependency
183 "bar" before "foo" package and the "foo" script is named "064-z-foo", you
[63fc514]184 just need to create a "064-y-bar" build script.
[824b6e4]185
[392bd25]186 Remember, the package tracking system isn't a package management tool
187 and knows nothing about packages not in the BLFS book.
[f4ed135]188
[392bd25]189 Also, review and edit envars.conf. This file is used to set global envars
[a54e1f1]190 needed by the build scripts.
191
[d7818f5]192 3.6 CREATING THE MAKEFILE::
[a54e1f1]193
[4c5274d]194 When the build scripts are ready to be run, the Makefile can be
[63fc514]195 created. Create an empty directory (for example "mkdir work") and cd
196 to that directory. Then run ../gen-makefile.sh
[824b6e4]197
[63fc514]198 Review the Makefile, and, if all looks sane, start the build by running
199 "make".
[824b6e4]200
[f4ed135]2014. GENERATED BUILD SCRIPTS ISSUES::
[1891ac46]202
[392bd25]203 In this section, known issues with the generated build scripts are
[63fc514]204 discussed. They are due to build procedures and/or BLFS layout
205 particularities that we can't handle. In several cases, editing the
206 build scripts is mandatory.
[392bd25]207 You may also need to insert some build scripts created by you to resolve
208 unhandled dependencies and/or to remove some script installing the affected
[f4ed135]209 package by hand.
[1891ac46]210
[d7818f5]211 4.1 BLFS BOOTSCRIPTS::
[1891ac46]212
[63fc514]213 Normally, bootscript installation should work. On the other hand, the
214 book does not give instruction for running them, so you might have to
[d7818f5]215 manually insert /etc/init.d/rd.d/<initscript> at some place during the build.
[1891ac46]216
[d7818f5]217 4.2 PACKAGE CONFIGURATION::
[1891ac46]218
[63fc514]219 For those packages that have a "Configuration" section, you should
220 edit the build script to fit the needs of your system. Sometimes, the
221 bash startup files are modified (see for example the instructions for
222 llvm). You might have to insert something like "source /etc/bash_profile"
223 at some point during the build.
[9d9a810]224
[d7818f5]225 4.3 GCC, JDK, Sane, and KDE-multimedia, freetype2, MesaLib and others
[1891ac46]226
[63fc514]227 On the pages for those packages, the BLFS book actually has instructions
[9d9a810]228 to download and install two or more packages. You must edit the scripts to
229 fix this.
[392bd25]230
231 We will try to fix some of them, but this may not be possible.
[1891ac46]232
[d7818f5]233 4.4 XORG7
[f4ed135]234
[63fc514]235 The generated scripts for Xorg7 packages have $SRC_ARCHIVE
[a70c289]236 support for individual packages, but not for patches nor *.wget and *.md5
237 files.
238
239 If you have previously downloaded the patches, you must edit
[0efb837]240 the scripts to use your local packages.
[f4ed135]241
[a70c289]242 The *.wget and *.md5 files should be downladed always from inside
243 the scripts to be sure that the most current individual packages are
[63fc514]244 used. Thus don't reuse previously existing ones.
[a70c289]245
[d08afa5]246 In the script for xorg7-font, be sure to move the fonts directories
247 symlinks creation to after the "for ... done" loop.
248
249
[d7818f5]250 4.5 PATCHES
[f4ed135]251
[392bd25]252 By default, all required patches will be downloaded from the NET.
[f4ed135]253
[392bd25]254 If you have previously downloaded the patches, you must edit the
255 scripts to use your local patches.
[f4ed135]256
257 Also, be sure that all scripts have the commands to download/apply the
[392bd25]258 required patches. Due to book layout issues, some patches may be missing.
[f4ed135]259
[d7818f5]260 4.6 ROOT COMMANDS
[f4ed135]261
[392bd25]262 If building as a normal user (the default setting), be sure that all
[615ba88]263 commands that require root privileges are run using sudo. Also make sure
[d7818f5]264 necessary root privilege commands are visible in your PATH. Or use
265 the `Defaults secure_path=' in /etc/sudoers. Also, the scripts use a
266 fragile construct:
267 sudo bash -c '<commands to be executed as root>'
268 which fail if the commands to be executed contain themselves a ' or access
269 a bash variable $XXX. So carefully review them.
[f4ed135]270
[392bd25]271 Due to book layout issues, some sudo commands may be missing.
[f4ed135]272
[d7818f5]273 4.7 OTHERS
[1891ac46]274
[392bd25]275 There may be other issues that we are not aware of. If you find
276 any, please report it to <alfs-discuss@linuxfromscratch.org>.
[1891ac46]277
[d7818f5]278 Presently, there is an error in the book in file
279 x/installing/x7proto.xml. You should change the role='required' to
280 role='optional' in the optional dependencies, if you plan to build
281 X.
Note: See TracBrowser for help on using the repository browser.