source: README.BLFS@ 9a865396

ablfs
Last change on this file since 9a865396 was 9a865396, checked in by Pierre Labastie <pierre@…>, 12 years ago

Update the blfs parts of README files

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