1 | $Id$
|
---|
2 |
|
---|
3 | 1. INTRODUCTION::
|
---|
4 |
|
---|
5 | To automate package builds from the BLFS book instructions is a huge
|
---|
6 | task. Some of the issues are: the BLFS book isn't linear; some package
|
---|
7 | pages use a custom layout; there are circular dependencies; several
|
---|
8 | packages can be installed on a non-default prefix; build commands can
|
---|
9 | change based on what dependencies will be used, etc.
|
---|
10 |
|
---|
11 | That being said, the goal of the blfs-tool is to help you solve package
|
---|
12 | dependencies, create build scripts and a Makefile. Few of the auto-generated
|
---|
13 | build scripts and Makefile will work "as is", thus, as a general rule,
|
---|
14 | you will need to review and edit the scripts while reading the book.
|
---|
15 |
|
---|
16 |
|
---|
17 | 2. PREREQUISITES::
|
---|
18 |
|
---|
19 | To use this tool you MUST:
|
---|
20 |
|
---|
21 | - have experience building BLFS packages
|
---|
22 | - know how to edit and write shell scripts
|
---|
23 | - know how a Makefile works
|
---|
24 | - be able to trace build failures and to find what is causing it
|
---|
25 | (user error, package bug, BLFS command bug, or jhalfs code bug)
|
---|
26 |
|
---|
27 | If you do not have the above skills, please don't use this tool.
|
---|
28 |
|
---|
29 |
|
---|
30 | 3. USAGE::
|
---|
31 |
|
---|
32 | Due the complexity of the BLFS book, the scripts and Makefile generation
|
---|
33 | is done in several steps:
|
---|
34 |
|
---|
35 | 3.1 INSTALLED PACKAGES TRACKING SYSTEM
|
---|
36 |
|
---|
37 | This tool includes a very simple tracking system to log which packages
|
---|
38 | have been installed using the tool. It is used to skip installed packages
|
---|
39 | from target selection menu and to test if an installed package has been
|
---|
40 | updated in the BLFS book. Do not rely on this feature as a package
|
---|
41 | management tool.
|
---|
42 |
|
---|
43 | The directory where tracking files will be stored needs to be created
|
---|
44 | before installing blfs-tool. You can place this directory anywhere, taking
|
---|
45 | care that the user must have read and write privileges on that directory
|
---|
46 | and on all files it contains.
|
---|
47 |
|
---|
48 | To use the default path set in the installation menu, run as root:
|
---|
49 |
|
---|
50 | install -d -m1777 /var/lib/jhalfs/BLFS
|
---|
51 |
|
---|
52 | 3.2 BLFS_TOOL INSTALLATION::
|
---|
53 |
|
---|
54 | Run "make" to launch the jhalfs menuconfig interface. Select the BLFS
|
---|
55 | book and version. Then set the installation directory (default
|
---|
56 | $HOME/blfs_root), the BLFS sources directory (default blfs-xml), and
|
---|
57 | the installed packages tracking directory (default /var/lib/jhalfs/BLFS).
|
---|
58 |
|
---|
59 | All required files will be placed in the installation directory and
|
---|
60 | BLFS XML sources will be installed in the named sub-directory.
|
---|
61 |
|
---|
62 | Installed files:
|
---|
63 |
|
---|
64 | blfs-xml/* SVN tree of the selected BLFS book version
|
---|
65 | lib/* functions libraries, xsl stylesheets, and auto-generated
|
---|
66 | meta-packages dependencies tree files
|
---|
67 | menu/* lxdialog and menuconfig source code
|
---|
68 | README.BLFS this file
|
---|
69 | TODO developers notes
|
---|
70 | update_book.sh update the XML book sources and regenerates packages
|
---|
71 | database and meta-packages dependencies tree
|
---|
72 | gen_config.sh regenerates Config.in
|
---|
73 | gen_pkg_book.sh resolves dependencies and generates linear BLFS books
|
---|
74 | and build scripts
|
---|
75 | gen-makefile.sh generates the target Makefile
|
---|
76 | progress_bar.sh the target Makefile progress bar
|
---|
77 | Makefile run gen_config.sh to update Config.in,
|
---|
78 | then launch the menuconfig interface, and lastly run
|
---|
79 | gen_pkg_book.sh based on configuration settings
|
---|
80 | Config.in menuconfig interface input file
|
---|
81 | packages auto-generated packages database
|
---|
82 | envars.conf envars needed when running the target build scripts
|
---|
83 |
|
---|
84 | From now on, all the work must be done from inside the installation
|
---|
85 | root directory.
|
---|
86 |
|
---|
87 | When finished the installation, the configuration and target selection
|
---|
88 | menu is launch.
|
---|
89 |
|
---|
90 | 3.3 UPDATING BOOK SOURCES::
|
---|
91 |
|
---|
92 | If you are using the development book version and you want to update
|
---|
93 | installed packages to the latest version found in that book, you need to
|
---|
94 | update the XML sources and packages database.
|
---|
95 |
|
---|
96 | To do that run "./update_book.sh"
|
---|
97 |
|
---|
98 | On the next configuration run, packages already installed but listed
|
---|
99 | with a new version in the book will be available for target selection
|
---|
100 | and used to solve dependencies.
|
---|
101 |
|
---|
102 | 3.4 CONFIGURING AND PARSING THE BOOK::
|
---|
103 |
|
---|
104 | The next step is to create a book and build scripts in dependency
|
---|
105 | build order for a target package. A target can be a package or a
|
---|
106 | meta-package.
|
---|
107 |
|
---|
108 | WARNING:
|
---|
109 | Only one target (meta-package or individual package) must be
|
---|
110 | selected on each configuration run.
|
---|
111 | There is no way to solve dependencies properly when more
|
---|
112 | than one target are selected.
|
---|
113 |
|
---|
114 | Run <make> to launch the configuration interface. The main menu contains
|
---|
115 | three blocks: meta-package selection, individual package selection, and
|
---|
116 | build options.
|
---|
117 |
|
---|
118 | When a meta-package is selected, it is possible to unselect unwanted
|
---|
119 | components. The unselected components will be skipped if no other components
|
---|
120 | depends on them.
|
---|
121 |
|
---|
122 | In the build options section, the dependencies level and default packages
|
---|
123 | used to solve alternatives are set. You can also select whether the build will
|
---|
124 | be made as a normal user or as root. That settings are saved to be reused in
|
---|
125 | future configuration runs.
|
---|
126 |
|
---|
127 | If, for example, your target selection is Xsoft-->Graphweb-->galeon, a
|
---|
128 | directory named "galeon" will be created. Inside that directory you will
|
---|
129 | find a directory named "HTML" that contains a galeon-based HTML book with
|
---|
130 | its dependencies in build order, and a "scripts" directory with build
|
---|
131 | scripts for that packages.
|
---|
132 |
|
---|
133 | There are also two other directories ("dependencies" and "xincludes")
|
---|
134 | that contain files generated while resolving dependencies trees.
|
---|
135 |
|
---|
136 | 3.5 EDITING BUILD SCRIPTS
|
---|
137 |
|
---|
138 | Now it is time to review the generated book and scripts, making any changes
|
---|
139 | to the scripts necessary to fix generation bugs or to suit your needs.
|
---|
140 |
|
---|
141 | Scripts for additional packages (i.e., for non-BLFS packages) can be
|
---|
142 | easily inserted. For example, if you want to install the external dependency
|
---|
143 | "bar" before "foo" package and the "foo" script is named "064-z-foo", you
|
---|
144 | need to create a "064-y-bar" build script.
|
---|
145 |
|
---|
146 | Remember, the package tracking system isn't a package management tool
|
---|
147 | and knows nothing about packages not in the BLFS book.
|
---|
148 |
|
---|
149 | Also, review and edit envars.conf. This file is used to set global envars
|
---|
150 | needed by the build scripts.
|
---|
151 |
|
---|
152 | 3.6 CREATING THE MAKEFILE
|
---|
153 |
|
---|
154 | When the build scripts are ready to be run, the Makefile can be
|
---|
155 | created. Be sure that you cd into the "package" directory and run
|
---|
156 | ../gen-makefile.sh
|
---|
157 |
|
---|
158 | Review the Makefile, and, if all looks sane, start the build.
|
---|
159 |
|
---|
160 | 4. GENERATED BUILD SCRIPTS ISSUES::
|
---|
161 |
|
---|
162 | In this section, known issues with the generated build scripts are
|
---|
163 | discussed. They are due to build procedures and/or BLFS layout particularities
|
---|
164 | that we can't handle. In several cases, editing the build scripts is mandatory.
|
---|
165 | You may also need to insert some build scripts created by you to resolve
|
---|
166 | unhandled dependencies and/or to remove some script installing the affected
|
---|
167 | package by hand.
|
---|
168 |
|
---|
169 | 4.1 BLFS BOOTSCRIPTS
|
---|
170 |
|
---|
171 | For now, bootscripts installation will fail. You will need to edit
|
---|
172 | the scripts for packages that install bootscripts and fix their
|
---|
173 | installation command. That could be fixed in the future.
|
---|
174 |
|
---|
175 | 4.2 PACKAGE CONFIGURATION
|
---|
176 |
|
---|
177 | For those packages that have a "Configuration" section, you should
|
---|
178 | edit the build script to fit the needs of your system.
|
---|
179 |
|
---|
180 | 4.4 PDL and Perl modules.
|
---|
181 |
|
---|
182 | The generated scripts for these packages are broken and can not
|
---|
183 | be fixed. You must replace them with your own scripts or install the
|
---|
184 | packages by hand.
|
---|
185 |
|
---|
186 | 4.4 GCC, JDK, Sane, and KDE-multimedia
|
---|
187 |
|
---|
188 | On the pages for these packages, the BLFS book actually has instructions
|
---|
189 | to install two packages. You must edit the scripts to fix this.
|
---|
190 |
|
---|
191 | We will try to fix some of them, but this may not be possible.
|
---|
192 |
|
---|
193 | 4.5 XORG7
|
---|
194 |
|
---|
195 | The generated scripts for Xorg7 pseudo-packages don't have support for
|
---|
196 | $SRC_ARCHIVE nor MD5 checking.
|
---|
197 |
|
---|
198 | If you have previously downloaded the packages, you must edit the
|
---|
199 | scripts to use your local packages.
|
---|
200 |
|
---|
201 | Also, you will need to edit the scripts to fix the commands that must
|
---|
202 | be applied only to a concrete individual sub-package. For example, the
|
---|
203 | "for" loop to install xorg7-util packages may read like:
|
---|
204 |
|
---|
205 | for package in $(cat $WGET_LST) ; do
|
---|
206 | packagedir=$(echo $package | sed 's/.tar.bz2//')
|
---|
207 | tar -xf $package
|
---|
208 | cd $packagedir
|
---|
209 | sed -i "s@/usr/X11R6@$XORG_PREFIX@" X11.tmpl &&
|
---|
210 | ./configure $XORG_CONFIG --with-config-dir=$XORG_PREFIX/lib/X11/config
|
---|
211 | sudo sh -c "make install"
|
---|
212 | ./configure $XORG_CONFIG --with-config-dir=$XORG_PREFIX/lib/X11/config &&
|
---|
213 | make
|
---|
214 | sudo sh -c "make install"
|
---|
215 | ./configure $XORG_CONFIG &&
|
---|
216 | make
|
---|
217 | sudo sh -c "make install"
|
---|
218 | cd ..
|
---|
219 | rm -rf $packagedir
|
---|
220 | done
|
---|
221 |
|
---|
222 | After reading the HTML page to find what command is for what package,
|
---|
223 | the loop can be changed to read something like:
|
---|
224 |
|
---|
225 | for package in $(cat $WGET_LST) ; do
|
---|
226 | packagedir=$(echo $package | sed 's/.tar.bz2//')
|
---|
227 | tar -xf $package
|
---|
228 | cd $packagedir
|
---|
229 | if [ ${packagedir} = "xorg-cf-files" ] ; then
|
---|
230 | sed -i "s@/usr/X11R6@$XORG_PREFIX@" X11.tmpl &&
|
---|
231 | ./configure $XORG_CONFIG --with-config-dir=$XORG_PREFIX/lib/X11/config
|
---|
232 | sudo sh -c "make install"
|
---|
233 | elif [ ${packagedir} = "Imake" ] ; then
|
---|
234 | ./configure $XORG_CONFIG --with-config-dir=$XORG_PREFIX/lib/X11/config &&
|
---|
235 | make
|
---|
236 | sudo sh -c "make install"
|
---|
237 | else
|
---|
238 | ./configure $XORG_CONFIG &&
|
---|
239 | make
|
---|
240 | sudo sh -c "make install"
|
---|
241 | fi
|
---|
242 | cd ..
|
---|
243 | rm -rf $packagedir
|
---|
244 | done
|
---|
245 |
|
---|
246 | 4.6 PATCHES
|
---|
247 |
|
---|
248 | By default, all required patches will be downloaded from the NET.
|
---|
249 |
|
---|
250 | If you have previously downloaded the patches, you must edit the
|
---|
251 | scripts to use your local patches.
|
---|
252 |
|
---|
253 | Also, be sure that all scripts have the commands to download/apply the
|
---|
254 | required patches. Due to book layout issues, some patches may be missing.
|
---|
255 |
|
---|
256 | 4.7 ROOT COMMANDS
|
---|
257 |
|
---|
258 | If building as a normal user (the default setting), be sure that all
|
---|
259 | commands that require root privileges are run using sudo.
|
---|
260 |
|
---|
261 | Due to book layout issues, some sudo commands may be missing.
|
---|
262 |
|
---|
263 | 4.8 OTHERS
|
---|
264 |
|
---|
265 | There may be other issues that we are not aware of. If you find
|
---|
266 | any, please report it to <alfs-discuss@linuxfromscratch.org>.
|
---|
267 |
|
---|
268 |
|
---|