[824b6e4] | 1 | $Id$
|
---|
| 2 |
|
---|
| 3 | 1. INTRODUCTION::
|
---|
| 4 |
|
---|
[392bd25] | 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.
|
---|
[824b6e4] | 10 |
|
---|
[392bd25] | 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.
|
---|
[824b6e4] | 15 |
|
---|
| 16 |
|
---|
[f4ed135] | 17 | 2. PREREQUISITES::
|
---|
| 18 |
|
---|
[392bd25] | 19 | To use this tool you MUST:
|
---|
[f4ed135] | 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 |
|
---|
[a54e1f1] | 27 | If you do not have the above skills, please don't use this tool.
|
---|
[f4ed135] | 28 |
|
---|
| 29 |
|
---|
| 30 | 3. USAGE::
|
---|
[824b6e4] | 31 |
|
---|
[392bd25] | 32 | Due the complexity of the BLFS book, the scripts and Makefile generation
|
---|
| 33 | is done in several steps:
|
---|
[824b6e4] | 34 |
|
---|
[a54e1f1] | 35 | 3.1 INSTALLED PACKAGES TRACKING SYSTEM
|
---|
| 36 |
|
---|
[392bd25] | 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.
|
---|
[a54e1f1] | 42 |
|
---|
[392bd25] | 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.
|
---|
[a54e1f1] | 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::
|
---|
[f4ed135] | 53 |
|
---|
| 54 | Run "make" to launch the jhalfs menuconfig interface. Select the BLFS
|
---|
[392bd25] | 55 | book and version. Then set the installation directory (default
|
---|
[a54e1f1] | 56 | $HOME/blfs_root), the BLFS sources directory (default blfs-xml), and
|
---|
| 57 | the installed packages tracking directory (default /var/lib/jhalfs/BLFS).
|
---|
[824b6e4] | 58 |
|
---|
| 59 | All required files will be placed in the installation directory and
|
---|
[392bd25] | 60 | BLFS XML sources will be installed in the named sub-directory.
|
---|
[824b6e4] | 61 |
|
---|
| 62 | Installed files:
|
---|
| 63 |
|
---|
[f4ed135] | 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
|
---|
[824b6e4] | 68 | README.BLFS this file
|
---|
| 69 | TODO developers notes
|
---|
[f4ed135] | 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
|
---|
[392bd25] | 73 | gen_pkg_book.sh resolves dependencies and generates linear BLFS books
|
---|
[f4ed135] | 74 | and build scripts
|
---|
[392bd25] | 75 | gen-makefile.sh generates the target Makefile
|
---|
[f4ed135] | 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
|
---|
[824b6e4] | 83 |
|
---|
| 84 | From now on, all the work must be done from inside the installation
|
---|
| 85 | root directory.
|
---|
| 86 |
|
---|
[a54e1f1] | 87 | When finished the installation, the configuration and target selection
|
---|
| 88 | menu is launch.
|
---|
| 89 |
|
---|
| 90 | 3.3 UPDATING BOOK SOURCES::
|
---|
[f4ed135] | 91 |
|
---|
[392bd25] | 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.
|
---|
[f4ed135] | 95 |
|
---|
[a54e1f1] | 96 | To do that run "./update_book.sh"
|
---|
[f4ed135] | 97 |
|
---|
[a54e1f1] | 98 | On the next configuration run, packages already installed but listed
|
---|
[392bd25] | 99 | with a new version in the book will be available for target selection
|
---|
| 100 | and used to solve dependencies.
|
---|
[a54e1f1] | 101 |
|
---|
| 102 | 3.4 CONFIGURING AND PARSING THE BOOK::
|
---|
[824b6e4] | 103 |
|
---|
[392bd25] | 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.
|
---|
[824b6e4] | 107 |
|
---|
[ab412b4] | 108 | WARNING:
|
---|
| 109 | Only one target (meta-package or individual package) must be
|
---|
| 110 | selected on each configuration run.
|
---|
[392bd25] | 111 | There is no way to solve dependencies properly when more
|
---|
| 112 | than one target are selected.
|
---|
[ab412b4] | 113 |
|
---|
[a54e1f1] | 114 | Run <make> to launch the configuration interface. The main menu contains
|
---|
[392bd25] | 115 | three blocks: meta-package selection, individual package selection, and
|
---|
[a54e1f1] | 116 | build options.
|
---|
[824b6e4] | 117 |
|
---|
[392bd25] | 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.
|
---|
[824b6e4] | 121 |
|
---|
[392bd25] | 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
|
---|
[a54e1f1] | 125 | future configuration runs.
|
---|
[824b6e4] | 126 |
|
---|
[392bd25] | 127 | If, for example, your target selection is Xsoft-->Graphweb-->galeon, a
|
---|
[a54e1f1] | 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.
|
---|
[824b6e4] | 132 |
|
---|
[392bd25] | 133 | There are also two other directories ("dependencies" and "xincludes")
|
---|
| 134 | that contain files generated while resolving dependencies trees.
|
---|
[f4ed135] | 135 |
|
---|
[a54e1f1] | 136 | 3.5 EDITING BUILD SCRIPTS
|
---|
[f4ed135] | 137 |
|
---|
[392bd25] | 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.
|
---|
[824b6e4] | 140 |
|
---|
[f4ed135] | 141 | Scripts for additional packages (i.e., for non-BLFS packages) can be
|
---|
[392bd25] | 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.
|
---|
[824b6e4] | 145 |
|
---|
[392bd25] | 146 | Remember, the package tracking system isn't a package management tool
|
---|
| 147 | and knows nothing about packages not in the BLFS book.
|
---|
[f4ed135] | 148 |
|
---|
[392bd25] | 149 | Also, review and edit envars.conf. This file is used to set global envars
|
---|
[a54e1f1] | 150 | needed by the build scripts.
|
---|
| 151 |
|
---|
| 152 | 3.6 CREATING THE MAKEFILE
|
---|
| 153 |
|
---|
[4c5274d] | 154 | When the build scripts are ready to be run, the Makefile can be
|
---|
[a1fcc9dd] | 155 | created. Be sure that you cd into the "package" directory and run
|
---|
[392bd25] | 156 | ../gen-makefile.sh
|
---|
[824b6e4] | 157 |
|
---|
[392bd25] | 158 | Review the Makefile, and, if all looks sane, start the build.
|
---|
[824b6e4] | 159 |
|
---|
[f4ed135] | 160 | 4. GENERATED BUILD SCRIPTS ISSUES::
|
---|
[1891ac46] | 161 |
|
---|
[392bd25] | 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
|
---|
[f4ed135] | 167 | package by hand.
|
---|
[1891ac46] | 168 |
|
---|
[f4ed135] | 169 | 4.1 BLFS BOOTSCRIPTS
|
---|
[1891ac46] | 170 |
|
---|
[392bd25] | 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.
|
---|
[1891ac46] | 174 |
|
---|
[392bd25] | 175 | 4.2 PACKAGE CONFIGURATION
|
---|
[1891ac46] | 176 |
|
---|
[392bd25] | 177 | For those packages that have a "Configuration" section, you should
|
---|
| 178 | edit the build script to fit the needs of your system.
|
---|
[1891ac46] | 179 |
|
---|
[f4ed135] | 180 | 4.4 PDL and Perl modules.
|
---|
[1891ac46] | 181 |
|
---|
[392bd25] | 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
|
---|
[1891ac46] | 184 | packages by hand.
|
---|
| 185 |
|
---|
[f4ed135] | 186 | 4.4 GCC, JDK, Sane, and KDE-multimedia
|
---|
[1891ac46] | 187 |
|
---|
[392bd25] | 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.
|
---|
[1891ac46] | 192 |
|
---|
[f4ed135] | 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 |
|
---|
[392bd25] | 198 | If you have previously downloaded the packages, you must edit the
|
---|
| 199 | scripts to use your local packages.
|
---|
[f4ed135] | 200 |
|
---|
| 201 | Also, you will need to edit the scripts to fix the commands that must
|
---|
[392bd25] | 202 | be applied only to a concrete individual sub-package. For example, the
|
---|
| 203 | "for" loop to install xorg7-util packages may read like:
|
---|
[f4ed135] | 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 |
|
---|
[392bd25] | 222 | After reading the HTML page to find what command is for what package,
|
---|
[f4ed135] | 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 |
|
---|
[392bd25] | 248 | By default, all required patches will be downloaded from the NET.
|
---|
[f4ed135] | 249 |
|
---|
[392bd25] | 250 | If you have previously downloaded the patches, you must edit the
|
---|
| 251 | scripts to use your local patches.
|
---|
[f4ed135] | 252 |
|
---|
| 253 | Also, be sure that all scripts have the commands to download/apply the
|
---|
[392bd25] | 254 | required patches. Due to book layout issues, some patches may be missing.
|
---|
[f4ed135] | 255 |
|
---|
| 256 | 4.7 ROOT COMMANDS
|
---|
| 257 |
|
---|
[392bd25] | 258 | If building as a normal user (the default setting), be sure that all
|
---|
[615ba88] | 259 | commands that require root privileges are run using sudo. Also make sure
|
---|
| 260 | necessary root privilege commands are visible in your PATH. ie. ldconfig
|
---|
| 261 | may not be in your user path and you will have to adjust all instances to
|
---|
| 262 | include the full path.
|
---|
[f4ed135] | 263 |
|
---|
[392bd25] | 264 | Due to book layout issues, some sudo commands may be missing.
|
---|
[f4ed135] | 265 |
|
---|
| 266 | 4.8 OTHERS
|
---|
[1891ac46] | 267 |
|
---|
[392bd25] | 268 | There may be other issues that we are not aware of. If you find
|
---|
| 269 | any, please report it to <alfs-discuss@linuxfromscratch.org>.
|
---|
[1891ac46] | 270 |
|
---|
| 271 |
|
---|