source: README.CUSTOM@ 106157fd

ablfs-more legacy trunk
Last change on this file since 106157fd was c7c32a3, checked in by Pierre Labastie <pierre@…>, 7 years ago

Update READMEs

  • Property mode set to 100644
File size: 9.5 KB
Line 
1#
2# $Id$
3#
4 HOW TO ADD CUSTOM SCRIPTS TO THE JHALFS MAKEFILE
5
6
7 Normally JHALFS creates a Makefile containing only those scripts found in
8the {,B,C,H}LFS books. An automated construction tool cannot predict the
9needs of every individual and requests are made "Can you add xxxx package".
10Rather than adding numerous package scripts and switches for each request it
11was easier to add a tool for the user(s) to code their own package needs.
12
13 There are two areas that can be customized: how the base system is built
14and what additional configurations and packages your hardware requires to be
15able to boot and run. Each of those areas are handled in a different way.
16
17
18
19 BASE SYSTEM CUSTOMIZATION
20
21 There are two ways to alter how the base system will be built:
22
23 - Using a working copy of the book sources and editing the XML files.
24 This is the way used by book editors to test packages upgrades,
25 command changes, build order changes. etc.
26
27 This method requires you know very well the book sources and what
28 files need be edited. It will not be discussed here.
29
30 - Editing the generated build scripts to make any change you want.
31 This is the method discussed below.
32
33
34 EDITING THE BASE SCRIPTS
35
36 To begin with, the build scripts should be generated with book defaults. To
37do that, configure jhalfs activating any option you want included, but do not
38select "Run the Makefile" option.
39
40 Under the ${BUILD_DIR}/${SCRIPT_ROOT}/${PROGNAME}-commands directory
41(using the defaults values to do an LFS build, that directory name is
42/mnt/build_dir/jhalfs/lfs-commands) you will find the default build scripts.
43
44 If all you want is modify, add, or remove some command from a package
45installation, for example to change its ./configure line, just edit the related
46script. If changing or adding a patch, be sure to copy the new patch to the
47${BUILD_DIR}/sources directory. When done, run 'make' from inside the
48${BUILD_DIR}/${SCRIPT_ROOT} directory.
49
50
51 REPLACING OR INSERTING PACKAGES AND CHANGING BUILD ORDER
52
53 To remove a package from the system, just remove its script(s).
54
55 To change the version of some package, or to build a newer or older version
56than that in the book, edit ${BUILD_DIR}/${SCRIPT_ROOT}/pkg_tarball_list to
57change its tarball name and place the new tarball in the ${BUILD_DIR}/sources
58directory.
59
60 To replace a package by an equivalent one, rename the replaced package script
61to reflect the new package name (for example, 102-man-db -> 102-man), edit the
62script to made the required commands changes, place the new tarball in the
63${BUILD_DIR}/sources directory, and edit ${BUILD_DIR}/${SCRIPT_ROOT}/pkg_tarball_list
64file to replace the removed package tarball name by the new package tarball
65name.
66
67 To change the build order, rename the scripts changing the first 3-digits
68string until they are sorted in the way you want.
69
70 To insert a new package, for example to build Cracklib in order to build
71Shadow with Cracklib support, you should first decide before what package it
72needs to be installed, in this example 107-shadow. Then create a new script
73containing the needed commands, using an existing one as template, and name it
74with the same 3-digits string used for that mentioned default package, but
75adding another 1-digit string. In our example, the new script to build Cracklib
76before Shadow will be named 107-1-cracklib. This naming scheme allows inserting
77up to 10 scripts before each of the existing scripts. Place the tarball for
78the new package and required patches, if any, in ${BUILD_DIR}/sources and edit
79${BUILD_DIR}/${SCRIPT_ROOT}/pkg_tarball_list to add the tarball name for that
80package.
81
82 When ready, launch again the jhalfs configuration interface. Make sure that
83exactly the same options are selected as when generating the default build
84scripts. Be sure that "Rebuild files" is unselected and select "Run the
85Makefile" if you want. Then select "Rebuild the Makefile". This will create a
86new Makefile based on the changes you made to the build scripts.
87
88
89 ADDING POST-SYSTEM BUILD CONFIGURATION FILES AND EXTRA PACKAGES
90
91 The installation of BLFS packages is handled via blfs-tool and activated
92when you select the appropriate menu option. See README and README.BLFS for
93more info.
94
95 The feature described below was added so users could install remaining
96configuration files, build the packages necessary to access the Internet
97or to support specific hardware, or to install basic utilities that are
98needed from the beginning, and was not intended to replace the BLFS
99install system.
100
101 :::NOTICE:::
102 The following examples are for use with LFS and are not applicable to any
103of the CLFS-sysroot or CLFS-Embedded books. The directory examples_CLFS-E
104contains code extracted from Beyond CLFS-embedded. Any packages you chose to
105add should honour the DESTDIR=${CLFS} switch or equivalent.
106
107
108 LAYOUT
109 A new directory has been added to JHALFS tree which contains the
110configuration scripts and a few examples. A switch has been added to the
111configuration file which enables/disables the inclusion of custom scripts.
112
113 custom
114 /config <-- where to put your scripts.
115 /examples <-- a few example scripts
116 /examples_CLFS-E <-- example scripts for CLFS-Embedded
117 template <-- ALL scripts MUST look like this
118
119
120
121 NOTE::: You are responsible for including all dependencies and ensuring they
122 are built in the right order.
123
124 1. To add a package to the final JHALFS Makefile you must first create a file
125 in the custom/config directory.
126 **All config files MUST follow the naming convention, xxx-PKG, where xxx
127 is the order number and PKG is the name of the package. The file naming
128 format is important as it defines the build order. The example shown
129 below has an order number 950 and log files will list in alphabetical
130 order in the /logs directory after blfs-tools scripts.
131 The simplest method is to copy the template file into the config directory
132 and rename it.
133
134 2. Populate the variables with the necessary values.
135 Variable function is self explanatory except for the inclusion of the
136 build cmds. If the package you want to include is found in the BLFS
137 book then you only need to copy/paste the cmd strings between the xEOFx
138 pairs, otherwise you will need to define the build cmds yourself.
139 NOTE::: This script you just created is not usable directly but contains
140 all the information necessary for jhalfs to create a build script
141 and an entry in the jhalfs Makefile.
142
143 3. As mentioned previously the build order is dictated by the 3 digit number
144 in the file name. If a package has dependencies it must be numerically
145 larger than the dependency files.
146 i.e. The package mc has glib as a dependency and build order is
147 950-glib
148 951-mc
149
150 4. A config file for BLFS-bootscripts is already created as 999-blfs_bootscripts.
151 If a package requires a bootscript to be installed add the cmd to this
152 file and NOT in the package script. The gpm script is included as an
153 example of multiple patch files and the need for a blfs bootscript.
154
155
156#--------- GLIB example -----------
157
158 #
159 # Filename syntax xxx-PKG ie. 950-glibc
160 # Create a file in the custom/config directory
161 # Populate the file using the following script as an example
162 #
163
164PKG="glib"
165PKG_VERSION="1.2.10"
166PKG_FILE="glib-1.2.10.tar.gz"
167URL="http://gd.tuwien.ac.at/graphics/gimp/gtk/v1.2/${PKG_FILE}"
168MD5="6fe30dad87c77b91b632def29dd69ef9"
169
170 # The following code removes previously defined PATCHx variables
171for i in PATCH{1..10}; do
172 unset $i
173done
174 # Patches are named PATCH[1..10]
175 # This information is used to download the patch only
176 # If you do not have the MD5SUM the download will proceed with a warning.
177PATCH1="http://www.linuxfromscratch.org/patches/blfs/svn/glib-1.2.10-gcc34-1.patch 0077a1cce5e8a2231ac5a9b08c6263ba"
178
179
180 # NOTE::
181 # The convoluted scheme used to write out a temporary file is
182 # a work-around for embedded single and double quotes.
183
184( cat << "xEOFx"
185
186patch -Np1 -i ../glib-1.2.10-gcc34-1.patch &&
187./configure --prefix=/usr &&
188make
189make install &&
190chmod -v 755 /usr/lib/libgmodule-1.2.so.0.0.10
191
192xEOFx
193) > tmp
194
195
196#--------- GPM example -----------
197
198
199PKG="gpm"
200PKG_VERSION="1.20.1"
201PKG_FILE="gpm-1.20.1.tar.bz2"
202URL="ftp://arcana.linux.it/pub/gpm/gpm-1.20.1.tar.bz2"
203MD5="2c63e827d755527950d9d13fe3d87692"
204for i in PATCH{1..10}; do
205 unset $i
206done
207 # MD5SUM is not absolutely necessary but JHALFS whines and complains
208 # Add the MD5SUM if you can
209PATCH1=" http://www.linuxfromscratch.org/patches/blfs/svn/gpm-1.20.1-segfault-1.patch"
210PATCH2=" http://www.linuxfromscratch.org/patches/blfs/svn/gpm-1.20.1-silent-1.patch"
211
212
213( cat << "xEOFx"
214
215patch -Np1 -i ../gpm-1.20.1-segfault-1.patch &&
216patch -Np1 -i ../gpm-1.20.1-silent-1.patch &&
217./configure --prefix=/usr --sysconfdir=/etc &&
218LDFLAGS="-lm" make
219
220make install &&
221cp -v conf/gpm-root.conf /etc &&
222ldconfig
223
224# The normal cmd to install the boot script for gpm
225# --- PUT THIS CMD INSIDE 999-blfs_bootscripts
226#make install-gpm
227
228cat > /etc/sysconfig/mouse << "EOF"
229# Begin /etc/sysconfig/mouse
230
231MDEVICE="/dev/psaux"
232PROTOCOL="imps2"
233GPMOPTS=""
234
235# End /etc/sysconfig/mouse
236EOF
237
238xEOFx
239) > tmp
240
241
242#--------- CMDS ONLY example -----------
243 # This is an example of a self contained cmd script
244 # There are no referenced to a package or package dir.
245 # This method is useful for creating user files/profiles/etc
246 # at build time.
247
248
249PKG=""
250PKG_VERSION=""
251PKG_FILE=""
252URL=""
253MD5=""
254for i in PATCH{1..10}; do
255 unset $i
256done
257PATCH1=""
258
259
260( cat << "xEOFx"
261
262echo "JUST A USELESS TRACE"
263
264xEOFx
265) > tmp
266
Note: See TracBrowser for help on using the repository browser.