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
|
---|
8 | the {B,C,H}LFS books. An automated construction tool cannot predict the
|
---|
9 | needs of every individual and requests are made "Can you add xxxx package".
|
---|
10 | Rather than adding numerous package scripts and switches for each request it
|
---|
11 | was easier to add a tool for the user(s) to code their own package needs.
|
---|
12 |
|
---|
13 | There is two areas that can be customized: how the base system is build
|
---|
14 | and what additional configurations and packages requires your hardware to can
|
---|
15 | boot and work with. Each one of this areas is handled in a diferent way.
|
---|
16 |
|
---|
17 | BASE SYSTEM CUSTOMIZATION
|
---|
18 |
|
---|
19 | There is two ways to alter how the base system will be built:
|
---|
20 |
|
---|
21 | - Using a working copy of the book sources and editing the XML files.
|
---|
22 | This is the way used by book editors to test packages upgrades,
|
---|
23 | command changes, build order changes. etc.
|
---|
24 |
|
---|
25 | This method requires you know very well the book sources and what
|
---|
26 | files need be edited. It will not be discussed here.
|
---|
27 |
|
---|
28 | - Editing the generated build scripts to make any change you would.
|
---|
29 | This is the method discussed below.
|
---|
30 |
|
---|
31 | (TO BE WRITTEN)
|
---|
32 |
|
---|
33 |
|
---|
34 | ADDING POST-SYSTEM BUILD CONFIGURATION FILES AND EXTRA PACKAGES
|
---|
35 |
|
---|
36 | The installation of BLFS packages is handled via blfs-tool and activated
|
---|
37 | when you select the appropiate menu option. See README and README.BLFS for
|
---|
38 | more info.
|
---|
39 |
|
---|
40 | The feature descrbed below was added so users could install remaining
|
---|
41 | configuration files, build the packages necessary to access the internet
|
---|
42 | or to support specific hardware, or to install basic utilities that need
|
---|
43 | have availables from the beginning, and was not intended to replace the BLFS
|
---|
44 | install system.
|
---|
45 |
|
---|
46 |
|
---|
47 | LAYOUT
|
---|
48 | A new directory has been added to JHALFS tree which will contain the
|
---|
49 | configuration scripts and a few examples. A switch has been added to the
|
---|
50 | configuration file which enables/disables the inclusion of personal scripts.
|
---|
51 |
|
---|
52 | custom
|
---|
53 | /config <-- where to put your scripts.
|
---|
54 | /examples <-- a few example scripts
|
---|
55 | template <-- ALL scripts MUST look like this
|
---|
56 |
|
---|
57 |
|
---|
58 |
|
---|
59 | NOTE::: You are responsible for including all dependencies and ensuring they
|
---|
60 | are built in the proper order.
|
---|
61 |
|
---|
62 | 1. To add a package to the final JHALFS Makefile you must first create a file
|
---|
63 | in the custom/config directory.
|
---|
64 | **All config files MUST follow the naming convention, xxx-PKG, where xxx
|
---|
65 | is the order number and PKG is the name of the package. The file naming
|
---|
66 | format is important as it defines the build order. The example shown
|
---|
67 | below has an order number 950 and log files will list in alphabetical
|
---|
68 | order in the /logs directory after blfs-tools scripts.
|
---|
69 | The simplest method is to copy the template file into the config directory
|
---|
70 | and rename it.
|
---|
71 |
|
---|
72 | 2. Populate the variables with the necessary values.
|
---|
73 | Variable function is self explanitory except for the inclusion of the
|
---|
74 | build cmds. If the package you want to include is found in the BLFS
|
---|
75 | book then you only need to copy/paste the cmd strings between the xEOFx
|
---|
76 | pairs, otherwise you will need to define the build cmds yourself.
|
---|
77 | NOTE::: This script you just created is not usable directly but contains
|
---|
78 | all the information necessary for jhalfs to create a build script
|
---|
79 | and an entry in the jhalfs Makefile.
|
---|
80 |
|
---|
81 | 3. As mentioned previously the build order is dictated by the 3 digit number
|
---|
82 | in the file name. If a package has dependencies it must be numerically
|
---|
83 | larger than the dependency files.
|
---|
84 | ie. The package mc has glib as a dependency and build order is
|
---|
85 | 950-glib
|
---|
86 | 951-mc
|
---|
87 |
|
---|
88 | 4. A config file for BLFS-bootscripts is already created as 999-blfs_bootscripts.
|
---|
89 | If a package requires a bootscript to be installed add the cmd to this
|
---|
90 | file and NOT in the package script. The gpm script is included as an
|
---|
91 | example of multiple patch files and the need for a blfs bootscript.
|
---|
92 |
|
---|
93 | RUNNING:::
|
---|
94 | Although your scripts are added to the generated makefile they are not
|
---|
95 | automatically built. You must tell the makefile to build the tools with
|
---|
96 | the cmd
|
---|
97 | make mk_CUSTOM_TOOLS
|
---|
98 |
|
---|
99 |
|
---|
100 | #--------- GLIB example -----------
|
---|
101 |
|
---|
102 | #
|
---|
103 | # Filename syntax xxx-PKG ie. 950-glibc
|
---|
104 | # Create a file in the custom/config directory
|
---|
105 | # Populate the file using the following script as an example
|
---|
106 | #
|
---|
107 |
|
---|
108 | PKG="glib"
|
---|
109 | PKG_VERSION="1.2.10"
|
---|
110 | PKG_FILE="glib-1.2.10.tar.gz"
|
---|
111 | URL="http://gd.tuwien.ac.at/graphics/gimp/gtk/v1.2/${PKG_FILE}"
|
---|
112 | MD5="6fe30dad87c77b91b632def29dd69ef9"
|
---|
113 |
|
---|
114 | # Patches are named PATCH[1..10]
|
---|
115 | # This information is used to download the patch only
|
---|
116 | # If you do not have the MD5SUM the download will proceed with a warning.
|
---|
117 | PATCH1="http://www.linuxfromscratch.org/patches/blfs/svn/glib-1.2.10-gcc34-1.patch 0077a1cce5e8a2231ac5a9b08c6263ba"
|
---|
118 |
|
---|
119 |
|
---|
120 | # NOTE::
|
---|
121 | # The convoluted scheme used to write out a temporary file is
|
---|
122 | # a work-around for embedded single and double quotes.
|
---|
123 |
|
---|
124 | ( cat << "xEOFx"
|
---|
125 |
|
---|
126 | patch -Np1 -i ../glib-1.2.10-gcc34-1.patch &&
|
---|
127 | ./configure --prefix=/usr &&
|
---|
128 | make
|
---|
129 | make install &&
|
---|
130 | chmod -v 755 /usr/lib/libgmodule-1.2.so.0.0.10
|
---|
131 |
|
---|
132 | xEOFx
|
---|
133 | ) > tmp
|
---|
134 |
|
---|
135 |
|
---|
136 | #--------- GPM example -----------
|
---|
137 |
|
---|
138 |
|
---|
139 | PKG="gpm"
|
---|
140 | PKG_VERSION="1.20.1"
|
---|
141 | PKG_FILE="gmp-1.20.1.tar.bz2"
|
---|
142 | URL="ftp://arcana.linux.it/pub/gpm/gpm-1.20.1.tar.bz2"
|
---|
143 | MD5="2c63e827d755527950d9d13fe3d87692"
|
---|
144 |
|
---|
145 | # MD5SUM is not absolutely necessary but JHALFS whines and complains
|
---|
146 | # Add the MD5SUM if you can
|
---|
147 | PATCH1=" http://www.linuxfromscratch.org/patches/blfs/svn/gpm-1.20.1-segfault-1.patch"
|
---|
148 | PATCH2=" http://www.linuxfromscratch.org/patches/blfs/svn/gpm-1.20.1-silent-1.patch"
|
---|
149 |
|
---|
150 |
|
---|
151 | ( cat << "xEOFx"
|
---|
152 |
|
---|
153 | patch -Np1 -i ../gpm-1.20.1-segfault-1.patch &&
|
---|
154 | patch -Np1 -i ../gpm-1.20.1-silent-1.patch &&
|
---|
155 | ./configure --prefix=/usr --sysconfdir=/etc &&
|
---|
156 | LDFLAGS="-lm" make
|
---|
157 |
|
---|
158 | make install &&
|
---|
159 | cp -v conf/gpm-root.conf /etc &&
|
---|
160 | ldconfig
|
---|
161 |
|
---|
162 | # The normal cmd to install the boot script for gpm
|
---|
163 | # --- PUT THIS CMD INSIDE 999-blfs_bootscripts
|
---|
164 | #make install-gpm
|
---|
165 |
|
---|
166 | cat > /etc/sysconfig/mouse << "EOF"
|
---|
167 | # Begin /etc/sysconfig/mouse
|
---|
168 |
|
---|
169 | MDEVICE="/dev/psaux"
|
---|
170 | PROTOCOL="imps2"
|
---|
171 | GPMOPTS=""
|
---|
172 |
|
---|
173 | # End /etc/sysconfig/mouse
|
---|
174 | EOF
|
---|
175 |
|
---|
176 | xEOFx
|
---|
177 | ) > tmp
|
---|
178 |
|
---|
179 |
|
---|
180 | #--------- CMDS ONLY example -----------
|
---|
181 | # This is an example of a self contained cmd script
|
---|
182 | # There are no referenced to a package or package dir.
|
---|
183 | # This method is useful for creating user files/profiles/etc
|
---|
184 | # at build time.
|
---|
185 |
|
---|
186 |
|
---|
187 | PKG=""
|
---|
188 | PKG_VERSION=""
|
---|
189 | PKG_FILE=""
|
---|
190 | URL=""
|
---|
191 | MD5=""
|
---|
192 |
|
---|
193 | PATCH1=""
|
---|
194 |
|
---|
195 |
|
---|
196 | ( cat << "xEOFx"
|
---|
197 |
|
---|
198 | echo "JUST A USELESS TRACE"
|
---|
199 |
|
---|
200 | xEOFx
|
---|
201 | ) > tmp
|
---|
202 |
|
---|