[00f4966] | 1 | $Id$
|
---|
| 2 |
|
---|
| 3 | 1. INTRODUCTION::
|
---|
| 4 |
|
---|
| 5 | To automatize packages build from the BLFS book instructions is a huge
|
---|
| 6 | task. The BLFS book isn't linear, some package pages need to use a non
|
---|
[9e627f6] | 7 | default layout, there are circular dependencies, several packages can be
|
---|
| 8 | installed on a non default prefix, build commands can change based on what
|
---|
[00f4966] | 9 | dependencies will be used, etc.
|
---|
| 10 |
|
---|
[2ee1d11] | 11 | Said that, the goal of blfs-tool is try to help you solving packages
|
---|
| 12 | dependencies and creating your own build scripts and Makefile. Few of the
|
---|
| 13 | auto-generated build scripts and Makefile could work "as is", thus as a
|
---|
[00f4966] | 14 | general rule you will need to review and edit the scripts while reading
|
---|
| 15 | the book.
|
---|
| 16 |
|
---|
| 17 |
|
---|
[855296f] | 18 | 2. PREREQUISITES::
|
---|
| 19 |
|
---|
| 20 | To use this tool you MUST to:
|
---|
| 21 |
|
---|
| 22 | - have experience building BLFS packages
|
---|
| 23 | - know how to edit and write shell scripts
|
---|
| 24 | - know how a Makefile works
|
---|
| 25 | - be able to trace build failures and to find what is causing it
|
---|
| 26 | (user error, package bug, BLFS command bug, or jhalfs code bug)
|
---|
| 27 |
|
---|
[2ee1d11] | 28 | If you do not have the above skills, please don't use this tool.
|
---|
[855296f] | 29 |
|
---|
| 30 |
|
---|
[26e1214] | 31 | 3. USAGE::
|
---|
[00f4966] | 32 |
|
---|
[2ee1d11] | 33 | Due the complexity of the BLFS book, the scripts and Makefile generation is
|
---|
[00f4966] | 34 | done in several steps:
|
---|
| 35 |
|
---|
[2ee1d11] | 36 | 3.1 INSTALLED PACKAGES TRACKING SYSTEM
|
---|
| 37 |
|
---|
| 38 | This tool includes a very simple tracking system to know what packages
|
---|
| 39 | has been installed using the tool. It is used to skip installed packages
|
---|
| 40 | from target selection menu and to know if an installed package has been updated
|
---|
| 41 | on the BLFS book. Don't rely on this feature as a packages management tool.
|
---|
| 42 |
|
---|
| 43 | The directory where tracking files will be stored need be created
|
---|
| 44 | before installing blfs-tool. You can place that directory anywhere, taking
|
---|
| 45 | care that the builder user must have read and write privileges on that
|
---|
| 46 | directory 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::
|
---|
[e557f50] | 53 |
|
---|
| 54 | Run "make" to launch the jhalfs menuconfig interface. Select the BLFS
|
---|
| 55 | book and it version. Then set the installation directory (default
|
---|
[2ee1d11] | 56 | $HOME/blfs_root), the BLFS sources directory (default blfs-xml), and
|
---|
| 57 | the installed packages tracking directory (default /var/lib/jhalfs/BLFS).
|
---|
[00f4966] | 58 |
|
---|
| 59 | All required files will be placed in the installation directory and
|
---|
| 60 | BLFS XML sources will be checkout to the named sub-directory.
|
---|
| 61 |
|
---|
| 62 | Installed files:
|
---|
| 63 |
|
---|
[e557f50] | 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
|
---|
[00f4966] | 68 | README.BLFS this file
|
---|
| 69 | TODO developers notes
|
---|
[e557f50] | 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
|
---|
[4875ed3] | 73 | gen_pkg_book.sh solve dependencies and generates linear BLFS books
|
---|
[e557f50] | 74 | and build scripts
|
---|
| 75 | gen-makefile.sh generates target Makefile
|
---|
| 76 | progress_bar.sh the target Makefile progress bar
|
---|
[4875ed3] | 77 | Makefile run gen_config.sh to update Config.in,
|
---|
[e557f50] | 78 | then launch the menuconfig interface, and lastly run
|
---|
[4875ed3] | 79 | gen_pkg_book.sh based on configuration settings
|
---|
[78ac273] | 80 | Config.in menuconfig interface input file
|
---|
[e557f50] | 81 | packages auto-generated packages database
|
---|
| 82 | envars.conf envars needed when running the target build scripts
|
---|
[00f4966] | 83 |
|
---|
| 84 | From now on, all the work must be done from inside the installation
|
---|
| 85 | root directory.
|
---|
| 86 |
|
---|
[2ee1d11] | 87 | When finished the installation, the configuration and target selection
|
---|
| 88 | menu is launch.
|
---|
| 89 |
|
---|
| 90 | 3.3 UPDATING BOOK SOURCES::
|
---|
[00f4966] | 91 |
|
---|
[e557f50] | 92 | If using the development book version, and if you want to update already
|
---|
| 93 | installed packages to the new version found in that book, you need to update
|
---|
| 94 | the XML sources and packages database.
|
---|
| 95 |
|
---|
[2ee1d11] | 96 | To do that run "./update_book.sh"
|
---|
[e557f50] | 97 |
|
---|
[2ee1d11] | 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 and
|
---|
| 100 | used to solve dependencies.
|
---|
| 101 |
|
---|
| 102 | 3.4 CONFIGURING AND PARSING THE BOOK::
|
---|
[e557f50] | 103 |
|
---|
[00f4966] | 104 | Next step is to create a book and build scripts in dependencies build order
|
---|
[2ee1d11] | 105 | for a target package. A target can be a package or a meta-package.
|
---|
[00f4966] | 106 |
|
---|
[0510381] | 107 | WARNING:
|
---|
| 108 | Only one target (meta-package or individual package) must be
|
---|
| 109 | selected on each configuration run.
|
---|
| 110 | That is due that there is no way to solve dependencies properly
|
---|
| 111 | when more than one target are selected at the same time.
|
---|
| 112 |
|
---|
[2ee1d11] | 113 | Run <make> to launch the configuration interface. The main menu contains
|
---|
| 114 | three block: meta-package selection, individual package selection, and
|
---|
| 115 | build options.
|
---|
[00f4966] | 116 |
|
---|
[2ee1d11] | 117 | When a meta-package is selected is possible to unselect unwanted components.
|
---|
| 118 | That unselected components will be skipped if no other components depends
|
---|
| 119 | on them.
|
---|
[00f4966] | 120 |
|
---|
[2ee1d11] | 121 | In the build options section the dependencies level and default packages
|
---|
| 122 | used to solve alternatives are set. Can be set also if the build will be
|
---|
| 123 | made as a normal user or as root. That settings are saved to be reused on
|
---|
| 124 | future configuration runs.
|
---|
[00f4966] | 125 |
|
---|
[2ee1d11] | 126 | If, for example, your target selection is Xsoft-->Graphweb-->galeon a
|
---|
| 127 | directory named "galeon" will be created. Inside that directory you will
|
---|
| 128 | find a directory named "HTML" that contains a galeon-based HTML book with
|
---|
| 129 | its dependencies in build order, and a "scripts" directory with build
|
---|
| 130 | scripts for that packages.
|
---|
[00f4966] | 131 |
|
---|
[2ee1d11] | 132 | There is also two other directories, "dependencies" and "xincludes", that
|
---|
[e557f50] | 133 | contains files generated while resolving dependencies trees.
|
---|
| 134 |
|
---|
[2ee1d11] | 135 | 3.5 EDITING BUILD SCRIPTS
|
---|
[e557f50] | 136 |
|
---|
[2ee1d11] | 137 | Now is time to review the generated book and scripts, making in the
|
---|
[e557f50] | 138 | scripts any changes required to fix generation bugs or to fit your needs.
|
---|
| 139 |
|
---|
| 140 | Scripts for additional packages (i.e., for non-BLFS packages) can be
|
---|
| 141 | inserted in an easy way due how the scripts are named. For example, if you
|
---|
| 142 | want to install the external dependency "bar" before "foo" package and the
|
---|
| 143 | "foo" script is named "064-z-foo", you need to create a "064-y-bar" build
|
---|
| 144 | script.
|
---|
[00f4966] | 145 |
|
---|
[2ee1d11] | 146 | Remember that the packages tracking system isn't a packages management tool
|
---|
[e557f50] | 147 | and know nothing about packages not in the BLFS book.
|
---|
[00f4966] | 148 |
|
---|
[2ee1d11] | 149 | Also, review and edit envars.conf. That file is used to set global envars
|
---|
| 150 | needed by the build scripts.
|
---|
| 151 |
|
---|
| 152 | 3.6 CREATING THE MAKEFILE
|
---|
| 153 |
|
---|
[2fedf49] | 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
|
---|
[00f4966] | 156 |
|
---|
[2fedf49] | 157 | ../gen_makefile.sh
|
---|
[00f4966] | 158 |
|
---|
[2ee1d11] | 159 | Review the Makefile and if all looks sane, start the build.
|
---|
[855296f] | 160 |
|
---|
[26e1214] | 161 | 4. GENERATED BUILD SCRIPTS ISSUES::
|
---|
[9e627f6] | 162 |
|
---|
| 163 | In this section known issues with the generated build scripts are
|
---|
[e557f50] | 164 | discussed. They are due build procedures and/or BLFS layout particularities
|
---|
| 165 | than we can't handle. In several cases editing the build scripts is mandatory.
|
---|
[9e627f6] | 166 | You may need also to insert some build script created by you to resolve
|
---|
[e557f50] | 167 | unhandled dependencies and/or to remove some script installing the affected
|
---|
| 168 | package by hand.
|
---|
[9e627f6] | 169 |
|
---|
[26e1214] | 170 | 4.1 BLFS BOOTSCRIPTS
|
---|
[9e627f6] | 171 |
|
---|
| 172 | For now, bootscripts installation will fail. You will need to edit the
|
---|
| 173 | scripts for packages that install bootscripts and fix their installation
|
---|
| 174 | command. That could be fixed in the future, but not sure.
|
---|
| 175 |
|
---|
[26e1214] | 176 | 4.2 PACKAGES CONFIGURATION
|
---|
[9e627f6] | 177 |
|
---|
| 178 | For that packages that have a "Configuration" section, you should to
|
---|
| 179 | edit it build script to fit the configuration to your needs.
|
---|
| 180 |
|
---|
[26e1214] | 181 | 4.4 PDL and Perl modules.
|
---|
[9e627f6] | 182 |
|
---|
| 183 | The generated scripts for that packages are plainly broken and can't
|
---|
| 184 | be fixed. You must to replace it by your own ones or install that
|
---|
| 185 | packages by hand.
|
---|
| 186 |
|
---|
[26e1214] | 187 | 4.4 GCC, JDK, Sane, and KDE-multimedia
|
---|
[9e627f6] | 188 |
|
---|
| 189 | On the pages for that packages, the BLFS book actually have instructions
|
---|
| 190 | to install two packages. You must to edit the scripts to fix it. We will
|
---|
| 191 | try to fix some of them, but may not be possible.
|
---|
| 192 |
|
---|
[26e1214] | 193 | 4.5 XORG7
|
---|
[78ac273] | 194 |
|
---|
[f633610] | 195 | The generated scripts for Xorg7 pseudo-packages don't have support for
|
---|
[78ac273] | 196 | $SRC_ARCHIVE nor MD5 checking.
|
---|
| 197 |
|
---|
| 198 | If you has downloaded previously the packages, you must to edit the scripts
|
---|
| 199 | to make it to use your local packages.
|
---|
| 200 |
|
---|
[f633610] | 201 | Also, you will need to edit the scripts to fix the commands that must
|
---|
[2ee1d11] | 202 | be applied only to a concrete individual sub-package. For example the "for"
|
---|
| 203 | loop to install xorg7-util packages may read like:
|
---|
[f633610] | 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 know what commands 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 |
|
---|
[26e1214] | 246 | 4.6 PATCHES
|
---|
[78ac273] | 247 |
|
---|
| 248 | By default all required patches will be downloaded from the NET.
|
---|
| 249 |
|
---|
| 250 | If you has downloaded previously the patches, you must to edit the scripts
|
---|
| 251 | to make it to use your local patches.
|
---|
| 252 |
|
---|
| 253 | Also, be sure that all scripts have the commands to download/apply the
|
---|
| 254 | required patches. Due book layout issues some patches may be missing.
|
---|
| 255 |
|
---|
[26e1214] | 256 | 4.7 ROOT COMMANDS
|
---|
[78ac273] | 257 |
|
---|
| 258 | If building as a normal user (the default setting) be sure that all
|
---|
| 259 | commands that need root privileges are run using sudo.
|
---|
| 260 |
|
---|
| 261 | Due book layout issues some sudo command may be missing.
|
---|
| 262 |
|
---|
[26e1214] | 263 | 4.8 OTHERS
|
---|
[9e627f6] | 264 |
|
---|
| 265 | May have other issues that we are not aware on them yet. If you find
|
---|
| 266 | someone, please report it to <alfs-discuss@linuxfromscratch.org>.
|
---|
| 267 |
|
---|
| 268 |
|
---|