# # $Id$ # HOW TO ADD CUSTOM SCRIPTS TO THE JHALFS MAKEFILE Normally JHALFS creates a Makefile containing only those scripts found in the {B,C,H}LFS books. An automated construction tool cannot predict the needs of every individual and requests are made "Can you add xxxx package". Rather than adding numerous package scripts and switches for each request it was easier to add a tool for the user(s) to code their own package needs. There is two areas that can be customized: how the base system is build and what additional configurations and packages requires your hardware to can boot and work with. Each one of this areas is handled in a diferent way. BASE SYSTEM CUSTOMIZATION There is two ways to alter how the base system will be built: - Using a working copy of the book sources and editing the XML files. This is the way used by book editors to test packages upgrades, command changes, build order changes. etc. This method requires you know very well the book sources and what files need be edited. It will not be discussed here. - Editing the generated build scripts to make any change you would. This is the method discussed below. (TO BE WRITTEN) ADDING POST-SYSTEM BUILD CONFIGURATION FILES AND EXTRA PACKAGES The installation of BLFS packages is handled via blfs-tool and activated when you select the appropiate menu option. See README and README.BLFS for more info. The feature descrbed below was added so users could install remaining configuration files, build the packages necessary to access the internet or to support specific hardware, or to install basic utilities that need have availables from the beginning, and was not intended to replace the BLFS install system. LAYOUT A new directory has been added to JHALFS tree which will contain the configuration scripts and a few examples. A switch has been added to the configuration file which enables/disables the inclusion of personal scripts. custom /config <-- where to put your scripts. /examples <-- a few example scripts template <-- ALL scripts MUST look like this NOTE::: You are responsible for including all dependencies and ensuring they are built in the proper order. 1. To add a package to the final JHALFS Makefile you must first create a file in the custom/config directory. **All config files MUST follow the naming convention, xxx-PKG, where xxx is the order number and PKG is the name of the package. The file naming format is important as it defines the build order. The example shown below has an order number 950 and log files will list in alphabetical order in the /logs directory after blfs-tools scripts. The simplest method is to copy the template file into the config directory and rename it. 2. Populate the variables with the necessary values. Variable function is self explanitory except for the inclusion of the build cmds. If the package you want to include is found in the BLFS book then you only need to copy/paste the cmd strings between the xEOFx pairs, otherwise you will need to define the build cmds yourself. NOTE::: This script you just created is not usable directly but contains all the information necessary for jhalfs to create a build script and an entry in the jhalfs Makefile. 3. As mentioned previously the build order is dictated by the 3 digit number in the file name. If a package has dependencies it must be numerically larger than the dependency files. ie. The package mc has glib as a dependency and build order is 950-glib 951-mc 4. A config file for BLFS-bootscripts is already created as 999-blfs_bootscripts. If a package requires a bootscript to be installed add the cmd to this file and NOT in the package script. The gpm script is included as an example of multiple patch files and the need for a blfs bootscript. RUNNING::: Although your scripts are added to the generated makefile they are not automatically built. You must tell the makefile to build the tools with the cmd make mk_CUSTOM_TOOLS #--------- GLIB example ----------- # # Filename syntax xxx-PKG ie. 950-glibc # Create a file in the custom/config directory # Populate the file using the following script as an example # PKG="glib" PKG_VERSION="1.2.10" PKG_FILE="glib-1.2.10.tar.gz" URL="http://gd.tuwien.ac.at/graphics/gimp/gtk/v1.2/${PKG_FILE}" MD5="6fe30dad87c77b91b632def29dd69ef9" # Patches are named PATCH[1..10] # This information is used to download the patch only # If you do not have the MD5SUM the download will proceed with a warning. PATCH1="http://www.linuxfromscratch.org/patches/blfs/svn/glib-1.2.10-gcc34-1.patch 0077a1cce5e8a2231ac5a9b08c6263ba" # NOTE:: # The convoluted scheme used to write out a temporary file is # a work-around for embedded single and double quotes. ( cat << "xEOFx" patch -Np1 -i ../glib-1.2.10-gcc34-1.patch && ./configure --prefix=/usr && make make install && chmod -v 755 /usr/lib/libgmodule-1.2.so.0.0.10 xEOFx ) > tmp #--------- GPM example ----------- PKG="gpm" PKG_VERSION="1.20.1" PKG_FILE="gmp-1.20.1.tar.bz2" URL="ftp://arcana.linux.it/pub/gpm/gpm-1.20.1.tar.bz2" MD5="2c63e827d755527950d9d13fe3d87692" # MD5SUM is not absolutely necessary but JHALFS whines and complains # Add the MD5SUM if you can PATCH1=" http://www.linuxfromscratch.org/patches/blfs/svn/gpm-1.20.1-segfault-1.patch" PATCH2=" http://www.linuxfromscratch.org/patches/blfs/svn/gpm-1.20.1-silent-1.patch" ( cat << "xEOFx" patch -Np1 -i ../gpm-1.20.1-segfault-1.patch && patch -Np1 -i ../gpm-1.20.1-silent-1.patch && ./configure --prefix=/usr --sysconfdir=/etc && LDFLAGS="-lm" make make install && cp -v conf/gpm-root.conf /etc && ldconfig # The normal cmd to install the boot script for gpm # --- PUT THIS CMD INSIDE 999-blfs_bootscripts #make install-gpm cat > /etc/sysconfig/mouse << "EOF" # Begin /etc/sysconfig/mouse MDEVICE="/dev/psaux" PROTOCOL="imps2" GPMOPTS="" # End /etc/sysconfig/mouse EOF xEOFx ) > tmp #--------- CMDS ONLY example ----------- # This is an example of a self contained cmd script # There are no referenced to a package or package dir. # This method is useful for creating user files/profiles/etc # at build time. PKG="" PKG_VERSION="" PKG_FILE="" URL="" MD5="" PATCH1="" ( cat << "xEOFx" echo "JUST A USELESS TRACE" xEOFx ) > tmp