website view pt/doc/scratchbook/base-apps.html @ rev 551

Fix c6b2d9c4e031, pt: localy browseable (with file://)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Oct 26 10:30:55 2009 +0100 (2009-10-26)
parents c6b2d9c4e031
children
line source
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4 <head>
5 <title>SliTaz Scratchbook - Base Applications</title>
6 <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
7 <meta name="description" content="" />
8 <meta name="expires" content="never" />
9 <meta name="modified" content="2008-11-22 17:00:00" />
10 <meta name="publisher" content="www.slitaz.org" />
11 <meta name="author" content="Christophe Lincoln"/>
12 <link rel="shortcut icon" href="favicon.ico" />
13 <link rel="stylesheet" type="text/css" href="book.css" />
14 </head>
15 <body bgcolor="#ffffff">
17 <!-- Header and quick navigation -->
18 <div id="header">
19 <div align="right" id="quicknav">
20 <a name="top"></a>
21 <a href="base-system.html">Base system</a> |
22 <a href="index.html">Table of contents</a> |
23 <a href="base-ncurses.html">Base ncurses</a>
24 </div>
25 <h1><font color="#3E1220">SliTaz Scratchbook</font></h1>
26 </div>
28 <!-- Content. -->
29 <div id="content">
30 <div class="content-right"></div>
33 <h2><font color="#df8f06">Base Applications</font></h2>
34 <p>
35 Install and configure libraries and basic applications.
36 </p>
37 <ul>
38 <li><a href="base-apps.html#about">About the chapter</a> - Description and environmental variable ($fs)</li>
39 <li><a href="base-apps.html#bc">bc-1.06</a> - Text mode calculator.</li>
40 <li><a href="base-apps.html#zlib">zlib-1.2.3</a> - Compression libraries.</li>
41 <li><a href="base-apps.html#pcre">pcre-7.4</a> - Perl-compatible regular expressions.</li>
42 <li><a href="base-apps.html#e2fsprogs">e2fsprogs-1.39</a> - Filesystem management utilities.</li>
43 <li><a href="base-apps.html#dropbear">dropbear-0.50</a> - Lightweight SSH server and client.</li>
44 <li><a href="base-apps.html#lighttpd">lighttpd-1.4.18</a> - HTTP web server.</li>
45 <li><a href="base-apps.html#iptables">iptables-1.3.7</a> - Netfilter, Linux firewall.</li>
46 <li><a href="base-apps.html#sqlite">sqlite-3.5.1</a> - Small SQL database engine.</li>
47 <li><a href="base-apps.html#cdrkit">cdrkit-1.1.5</a> - Tools for manipulating cdrom
48 and ISO images.</li>
49 <li><a href="base-apps.html#cpio">cpio-2.8</a> - Archiver used for SliTaz packages and
50 initramfs.</li>
51 <li><a href="base-apps.html#microperl">microperl-5.8.8</a> - A tiny Perl.</li>
52 <li><a href="base-apps.html#module-init-tools">module-init-tools-3.2</a> - Tools for
53 manipulating the kernel modules.</li>
54 <li><a href="base-apps.html#kernel-modules">Copy and compress the Kernel modules.</a></li>
55 <li><a href="base-apps.html#initramfs-iso">Generate the initramfs and an ISO image.</a></li>
56 </ul>
57 <a name="about"></a>
58 <h3><font color="#6c0023">About</font></h3>
59 <p>
60 This chapter describes the facilities libraries and basic text mode applications supplied with
61 SliTaz.
62 </p>
63 <h4>Assign an environment variable ($fs)</h4>
64 <p>
65 An environmental variable can't specify the path to the directory, just the name of the directory.
66 We will affect a variable '$fs' to indicate the path to the root filesystem
67 (rootfs). To do this, we venture into the working directory SliTaz/, and type:
68 </p>
69 <pre> # export fs=$PWD/rootfs
70 </pre>
71 <p>
72 To check:
73 </p>
74 <pre> # echo $fs
75 </pre>
76 <a name="bc"></a>
77 <h3><font color="#6c0023">bc-1.06 - Text mode calculator</font></h3>
78 <p>
79 The application bc (<a href="http://www.gnu.org/software/bc/">www.gnu.org/software/bc/</a>) provides
80 a small calculator. When compiling the utility, dc is also built,
81 but not installed by SliTaz. Note that dc is also available with BusyBox. If you decide to copy dc, you
82 need to delete the link to BusyBox (if it exists). We use a directory _pkg (package) for installation,
83 use strip to clean the executables and copy the utilities:
84 </p>
85 <pre> # cd src
86 # wget http://ftp.gnu.org/pub/gnu/bc/bc-1.06.tar.gz
87 # tar xzfv bc-1.06.tar.gz
88 # cd bc-1.06
89 # ./configure --prefix=/usr --infodir=/usr/share/info \
90 --mandir=/usr/share/man
91 # make
92 # make DESTDIR=$PWD/_pkg install
93 # strip -vs _pkg/usr/bin/*
94 # cp -avi _pkg/usr/bin/bc $fs/usr/bin
95 </pre>
96 <h4>libs</h4>
97 <p>
98 A small <code>ldd</code> on bc should produce:
99 </p>
100 <pre class="script"> libc.so.6 =&gt; /lib/libc.so.6 (0x40029000)
101 /lib/ld-linux.so.2 =&gt; /lib/ld-linux.so.2 (0x40000000)
102 </pre>
103 <a name="zlib"></a>
104 <h3><font color="#6c0023">zlib-1.2.3 - Compression libraries</font></h3>
105 <p>
106 The zlib (<a href="http://www.zlib.net/">http://www.zlib.net/</a>) package provides compression
107 and decompression functions used by among others, the SSH server Dropbear and the X server:
108 </p>
109 <pre> # cd ..
110 # wget http://www.gzip.org/zlib/zlib-1.2.3.tar.bz2
111 # tar xjfv zlib-1.2.3.tar.bz2
112 # cd zlib-1.2.3
113 # ./configure --shared --prefix=/usr
114 # make
115 # strip -vs libz.so*
116 # cp -av libz.so* $fs/usr/lib
117 </pre>
118 <a name="pcre"></a>
119 <h3><font color="#6c0023">pcre-7.4 - Perl-compatible regular expressions</font></h3>
120 <p>
121 The package pcre (<a href="http://www.pcre.org/">http://www.pcre.org/</a>) provides libraries of
122 functions for Perl compatible regular expressions used by among others, the web server Lighttpd:
123 </p>
124 <pre> # cd ..
125 # wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-7.4.tar.gz
126 # tar xzfv pcre-7.4.tar.gz
127 # cd pcre-7.4
128 # ./configure --prefix=/usr
129 # make
130 # make DESTDIR=$PWD/_pkg install
131 # strip -vs _pkg/usr/bin/*
132 # strip -vs _pkg/usr/lib/*
133 # cp -av _pkg/usr/bin/* $fs/usr/bin
134 # cp -av _pkg/usr/lib/*.so* $fs/usr/lib
135 </pre>
136 <a name="e2fsprogs"></a>
137 <h3><font color="#6c0023">e2fsprogs-1.39 - Filesystem management utilities</font></h3>
138 <p>
139 The e3fsprogs (<a href="http://e2fsprogs.sourceforge.net/">http://e2fsprogs.sourceforge.net/</a>) provides
140 utilities for handling ext2 and ext3 filesystems. We will not take all of them because we need the space.
141 It should be noted that we use fsck of BusyBox:
142 </p>
143 <pre> # cd ..
144 # wget http://puzzle.dl.sourceforge.net/sourceforge/e2fsprogs/e2fsprogs-1.39.tar.gz
145 # tar xzf e2fsprogs-1.39.tar.gz
146 # cd e2fsprogs-1.39
147 # ./configure --prefix=/usr --with-root-prefix="" \
148 --enable-elf-shlibs --disable-evms --sysconfdir=/etc \
149 --infodir=/usr/share/info --mandir=/usr/share/man
150 # make
151 # make DESTDIR=$PWD/_pkg install
152 # strip -vs _pkg/sbin/*
153 # strip -vs _pkg/lib/*
154 # strip -vs _pkg/usr/bin/*
155 # strip -vs _pkg/usr/sbin/*
156 # strip -vs _pkg/usr/lib/*
157 </pre>
158 <p>
159 Install the utilities, configuration files and libraries in the rootfs of SliTaz. Be careful if you
160 used fsck, that you didn't destroy the link to BusyBox:
161 </p>
162 <pre> # cp -i _pkg/sbin/{badblocks,blkid,dumpe2fs,e2fsck,e2image} $fs/sbin
163 # cp -i _pkg/sbin/{e2label,findfs,logsave,mke2fs,mkfs.*} $fs/sbin
164 # cp -i _pkg/sbin/{resize2fs,tune2fs} $fs/sbin
165 # cp -a _pkg/lib/* $fs/lib
166 # rm -rf $fs/lib/libss*
167 # cp -a _pkg/etc/* $fs/etc
168 # cp -a _pkg/usr/bin/* $fs/usr/bin
169 # cp -a _pkg/usr/sbin/* $fs/usr/sbin
170 # cp -ad _pkg/usr/lib/*.so $fs/usr/lib
171 # rm -rf $fs/usr/lib/libss*
172 </pre>
173 <p>
174 You can also copy files from the French locale:
175 </p>
176 <pre> # mkdir $fs/usr/share/locale
177 # cp -a _pkg/usr/share/locale/fr $fs/usr/share/locale
178 </pre>
179 <a name="dropbear"></a>
180 <h3><font color="#6c0023">Dropbear-0.50 - Lightweight SSH client and server</font></h3>
181 <p>
182 Dropbear (<a href="http://matt.ucc.asn.au/dropbear/dropbear.html">http://matt.ucc.asn.au/dropbear/dropbear.html</a>)
183 is a small secure client/server supporting SSH 2. Dropbear is compatible with
184 OpenSSH and uses ~/.ssh/authorized_keys for the management of public keys. Dropbear also
185 provides a version of scp, which must be compiled with 'make scp':
186 </p>
187 <pre> # cd ..
188 # wget http://matt.ucc.asn.au/dropbear/releases/dropbear-0.50.tar.gz
189 # tar xzf dropbear-0.50.tar.gz
190 # cd dropbear-0.50
191 # ./configure --prefix=/usr
192 # make
193 # make scp
194 # make DESTDIR=$PWD/_pkg install
195 # strip -v scp
196 # strip -v _pkg/usr/bin/*
197 # strip -v _pkg/usr/sbin/*
198 </pre>
199 <p>
200 Install the client and tools in /usr/bin, and the server in /usr/sbin:
201 </p>
202 <pre> # cp scp $fs/usr/bin
203 # cp -a _pkg/usr/bin/* $fs/usr/bin
204 # cp -a _pkg/usr/sbin/* $fs/usr/sbin
205 </pre>
206 <h4>libs</h4>
207 <pre class="script"> libutil.so.1 =&gt; /lib/libutil.so.1 (0x40025000)
208 libz.so.1 =&gt; /usr/lib/libz.so.1 (0x40028000)
209 libcrypt.so.1 =&gt; /lib/libcrypt.so.1 (0x4003b000)
210 libc.so.6 =&gt; /lib/libc.so.6 (0x40068000)
211 /lib/ld-linux.so.2 =&gt; /lib/ld-linux.so.2 (0x40000000)
212 </pre>
213 <p>
214 Copy the library libutil.so.1 to $fs/lib, if this is not already the case. Other libraries
215 should be present following the construction of the base system:
216 </p>
217 <pre> # cp -a /lib/libutil* $fs/lib
218 </pre>
219 <h4>Configure Dropbear</h4>
220 <p>
221 The user configuration files authorized_keys and known_hosts are in ~/.ssh. This directory and the
222 file known_hosts are created automatically the first time the user launches dbclient. The system
223 configuration files for the Dropbear server are in /etc/dropbear:
224 </p>
225 <pre> # mkdir $fs/etc/dropbear
226 </pre>
227 <p>
228 You must generate the secure keys before starting the Dropbear server on SliTaz.
229 You can use dropbearkey with the following commands:
230 </p>
231 <pre> # dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
232 # dropbearkey -t dss -f /etc/dropbear/dropbear_dss_host_key
233 </pre>
234 <p>
235 On SliTaz, you can start the SSH server with the command:
236 </p>
237 <pre> # /etc/init.d/dropbear start
238 </pre>
239 <a name="lighttpd"></a>
240 <h3><font color="#6c0023">lighttpd-1.4.18 - HTTP Web server</font></h3>
241 <p>
242 Lighttpd (<a href="http://www.lighttpd.net/">www.lighttpd.net</a>) is a light, secure and powerful web server.
243 The project is very active and the server's configuration simple. It supports virtual hosts, CGI scripts,
244 and allows intelligent management of the CPU:
245 </p>
246 <pre> # cd ..
247 # wget http://www.lighttpd.net/download/lighttpd-1.4.18.tar.gz
248 # tar xzf lighttpd-1.4.18.tar.gz
249 # cd lighttpd-1.4.18
250 # ./configure -enable-shared --disable-ipv6 --prefix=/usr \
251 --libdir=/usr/lib/lighttpd --mandir=/usr/share/man
252 # make
253 # make DESTDIR=$PWD/_pkg install
254 # strip -vs _pkg/usr/bin/*
255 # strip -vs _pkg/usr/sbin/*
256 # strip -vs _pkg/usr/lib/lighttpd/*
257 </pre>
258 <p>
259 Install the server and generated libraries. We will then copy some of the modules (9):
260 </p>
261 <pre> # cp _pkg/usr/bin/* $fs/usr/bin
262 # cp _pkg/usr/sbin/* $fs/usr/sbin
263 # mkdir $fs/usr/lib/lighttpd
264 Modules :
265 # cp _pkg/usr/lib/lighttpd/mod_access.so $fs/usr/lib/lighttpd
266 # cp _pkg/usr/lib/lighttpd/mod_accesslog.so $fs/usr/lib/lighttpd
267 # cp _pkg/usr/lib/lighttpd/mod_alias.so $fs/usr/lib/lighttpd
268 # cp _pkg/usr/lib/lighttpd/mod_auth.so $fs/usr/lib/lighttpd
269 # cp _pkg/usr/lib/lighttpd/mod_cgi.so $fs/usr/lib/lighttpd
270 # cp _pkg/usr/lib/lighttpd/mod_compress.so $fs/usr/lib/lighttpd
271 # cp _pkg/usr/lib/lighttpd/mod_rewrite.so $fs/usr/lib/lighttpd
272 # cp _pkg/usr/lib/lighttpd/mod_status.so $fs/usr/lib/lighttpd
273 # cp _pkg/usr/lib/lighttpd/mod_userdir.so $fs/usr/lib/lighttpd
274 </pre>
275 <h4>libs</h4>
276 <p>
277 There should be a libdl.so.2 library; if missing, we can copy:
278 </p>
279 <pre> # cp -a /lib/libdl* $fs/lib
280 </pre>
281 <h4>/var/www - root of documents served</h4>
282 <p>
283 /var/www is the root directory of documents served by default. You can access this via the url http://localhost/.
284 This directory contains an <code>index.html</code> automatically displayed by a query.
285 We will create the directory /var/www, to see what's placed inside:
286 </p>
287 <pre> # mkdir -p $fs/var/www
288 </pre>
289 <h4>lighttpd.conf - Lighttpd configuration file</h4>
290 <p>
291 The Lighttpd main configuration file is located at /etc/lighttpd and is called lighttpd.conf.
292 The configuration file SliTaz provides is self-explanatary, just browse. You can find other examples on the
293 Lighttpd website and as well as an example configuration in /doc in the Lighttpd archive:
294 </p>
295 <pre> # cp -a ../slitaz-tools-1.1/etc/lighttpd $fs/etc
296 </pre>
297 <p>
298 Creating the directory containing the log files:
299 </p>
300 <pre> # mkdir $fs/var/log/lighttpd
301 </pre>
302 <h4>User and group www</h4>
303 <p>
304 We will add a user and a group for the web server, it adds security and there is no reason for it to be run a root.
305 The default user on SliTaz is 'www', but you can change this in the configuration file lighttpd.conf.
306 The BusyBox application adduser has some limitations, so we add user 'www' manually. We also change permissions on
307 the directory of web server logs:
308 </p>
309 <pre> # echo "www:x:80:80:www:/var/www:/bin/sh" &gt;&gt; $fs/etc/passwd
310 # echo "www:*:13509:0:99999:7:::" &gt;&gt; $fs/etc/shadow
311 # echo "www:*:13509:0:99999:7:::" &gt;&gt; $fs/etc/shadow-
312 # chroot $fs /bin/ash
313 /# addgroup -g 80 www
314 /# chown www.www /var/log/lighttpd
315 # exit
316 </pre>
317 <p>
318 To start the web server, you can use script /etc/init.d/lighttpd provided by SliTaz tools, by typing:
319 <code>/etc/init.d/lighttpd start</code>. You can also automate its
320 launch at boot with a link /etc/init.d/lighttpd pointing to /etc/rc.d/60lighttpd.
321 </p>
322 <a name="iptables"></a>
323 <h3><font color="#6c0023">iptables-1.3.7 - Netfilter, Linux firewall</font></h3>
324 <p>
325 Netfilter (<a href="http://www.netfilter.org/">www.netfilter.org</a>) is the module which provides the Linux
326 kernel firewall functions, shared internet connections (NAT) and the archiving of network traffic.
327 The iptables command allows you to configure Netfilter using iptables-restore
328 and iptable-save, to save and restore the Netfilter configuration:
329 </p>
330 <pre> # cd ..
331 # wget http://www.netfilter.org/projects/iptables/files/iptables-1.3.7.tar.bz2
332 # tar xjf iptables-1.3.7.tar.bz2
333 # cd iptables-1.3.7
334 # make KERNEL_DIR=../linux-2.6.20 BINDIR=/sbin \
335 LIBDIR=/lib MANDIR=/usr/share/man
336 # make KERNEL_DIR=../linux-2.6.20 BINDIR=/sbin \
337 LIBDIR=/lib MANDIR=/usr/share/man \
338 DESTDIR=$PWD/_pkg install
339 # strip _pkg/sbin/*
340 # strip _pkg/lib/iptables/*
341 </pre>
342 <p>
343 Installing the iptables* applications and libraries sufficient for a basic firewall:
344 </p>
345 <pre> # cp -a _pkg/sbin/iptables* $fs/sbin
346 # mkdir $fs/lib/iptables
347 # cp -a _pkg/lib/iptables/{libipt_standard.so,libipt_conntrack.so} \
348 $fs/lib/iptables
349 # cp -a _pkg/lib/iptables/{libipt_tcp.so,libipt_udp.so} $fs/lib/iptables
350 </pre>
351 <p>
352 To satisfy the iptables dependencies, you must copy the libnsl* library:
353 </p>
354 <pre> # cp -va /lib/libnsl* $fs/lib/tls
355 # strip $fs/lib/libnsl*
356 </pre>
357 <a name="sqlite"></a>
358 <h3><font color="#6c0023">sqlite-3.5.1 - Small SQL database engine</font></h3>
359 <p>
360 This package provides sqlite3 (<a href="http://www.sqlite.org/">www.sqlite.org</a>) and sqlite3.so*
361 libraries. SQLite is fast and efficient and integrates directly to programs using database files:
362 </p>
363 <pre> # cd ..
364 # wget http://www.sqlite.org/sqlite-3.5.1.tar.gz
365 # tar xzf sqlite-3.5.1.tar.gz
366 # cd sqlite-3.5.1
367 # ./configure --prefix=/usr --disable-tcl
368 # make
369 # make DESTDIR=$PWD/_pkg install
370 # strip _pkg/usr/lib/*.so*
371 # strip _pkg/usr/bin/*
372 </pre>
373 <p>
374 Installing the sqlite3 utility and libraries in the rootfs of SliTaz:
375 </p>
376 <pre> # cp -a _pkg/usr/lib/*.so* $fs/usr/lib
377 # cp -a _pkg/usr/bin/* $fs/usr/bin
378 </pre>
379 <a name="cdrkit"></a>
380 <h3><font color="#6c0023">cdrkit-1.1.5 - Tools for manipulating cdrom and ISO images</font></h3>
381 <p>
382 cdrkit (<a href="http://www.cdrkit.org/">www.cdrkit.org</a>) provides tools for manipulating cdroms.
383 SliTaz installs by default wodim for burning and genisoimage to create an ISO image.
384 The compilation is a bit different (cmake), but shouldn't pose any problems:
385 </p>
386 <pre> # cd ..
387 # wget http://cdrkit.org/releases/cdrkit-1.1.5.tar.gz
388 # tar xzf cdrkit-1.1.5.tar.gz
389 # cd cdrkit-1.1.5
390 # make
391 # make install PREFIX=$PWD/_pkg/usr
392 # strip -v _pkg/usr/bin/*
393 # strip -v _pkg/usr/sbin/*
394 # cp _pkg/usr/bin/genisoimage $fs/usr/bin
395 # cp _pkg/usr/bin/wodim $fs/usr/bin
396 </pre>
397 <p>
398 Copy the library libcap.so.1 required by wodim:
399 </p>
400 <pre> # cp -a /lib/libcap.so* $fs/lib
401 </pre>
402 <a name="cpio"></a>
403 <h3><font color="#6c0023">cpio-2.8 - Archiver</font></h3>
404 <p>
405 <code>cpio</code> (<a href="http://www.gnu.org/software/cpio/">http://www.gnu.org/software/cpio/</a>) provides tools for
406 manipulating cpio archives. The archive format is used for packages and the SliTaz initramfs image of the cdrom.
407 Note that BusyBox provides a version of cpio that only unpacks archives:
408 </p>
409 <pre> # cd ..
410 # wget ftp://sunsite.cnlab-switch.ch/mirror/gnu/cpio/cpio-2.8.tar.gz
411 # tar xzf cpio-2.8.tar.gz
412 # cd cpio-2.8
413 # ./configure --prefix=/usr --bindir=/bin \
414 --libexecdir=/usr/bin --mandir=/usr/share/man \
415 --infodir=/usr/share/info
416 # make
417 # make DESTDIR=$PWD/_pkg install
418 # strip -v _pkg/bin/*
419 # strip -v _pkg/usr/bin/*
420 </pre>
421 <p>
422 Installing <code>cpio</code> in /bin and <code>rmt</code> in /usr/bin. You can also install the French locale files:
423 </p>
424 <pre> # cp -a _pkg/bin/* $fs/bin
425 # cp -a _pkg/usr/bin/* $fs/usr/bin
426 # cp -a _pkg/usr/share/locale/fr $fs/usr/share/locale
427 </pre>
428 <a name="microperl"></a>
429 <h3><font color="#6c0023">microperl-5.8.8 - A tiny Perl</font></h3>
430 <p>
431 Microperl is a tiny implementation of Perl using the most basic functions of the language.
432 You can find more info in the source archive and the file <code>README.micro</code>.
433 We use a small <code>sed</code> on the configuration file that searches for microperl modules
434 in /usr/lib/perl5. We also create a link to the #! /usr/bin/perl script:
435 </p>
436 <pre> # wget http://ftp.funet.fi/pub/CPAN/src/perl-5.8.8.tar.gz
437 # tar xzf perl-5.8.8.tar.gz
438 # cd perl-5.8.8
439 # sed -i s/'usr\/local'/'usr'/ uconfig.sh
440 # sed -i s/'perl5\/5.9'/'perl5'/ uconfig.sh
441 # sed -i s/'unknown'/'i486-pc-linux-gnu'/ uconfig.sh
442 # make -f Makefile.micro regen_uconfig
443 # make -f Makefile.micro
444 # strip microperl
445 # cp microperl $fs/usr/bin
446 # chroot $fs /bin/ash
447 /# cd /usr/bin
448 /# ln -s microperl perl
449 /# exit
450 </pre>
451 <a name="module-init-tools"></a>
452 <h3><font color="#6c0023">module-init-tools-3.2 - Utilities for manipulating kernel modules</font></h3>
453 <p>
454 The <a href="http://ftp.kernel.org/pub/linux/utils/kernel/module-init-tools/">module-init-tools</a>
455 from kernel.org: modprobe, insmod, rmmod and lsmod. We have chosen to use these because we can compile
456 modutils/modprobe to support compressed (.gz) modules to save space. To do this we use the option
457 --enable-zlib, we then clean and copy the binaries. We do not take everything that has been created,
458 only what we need: depmod, insmod, modinfo, modprobe and rmmod in /sbin and lsmod in /bin:
459 </p>
460 <pre> # cd ..
461 # wget http://ftp.kernel.org/pub/linux/utils/kernel/module-init-tools/module-init-tools-3.2.tar.bz2
462 # tar xjf module-init-tools-3.2.tar.bz2
463 # cd module-init-tools-3.2
464 # ./configure --enable-zlib --prefix=/usr --sbindir=/sbin --bindir=/bin \
465 --sysconfdir=/etc --infodir=/usr/share/info --mandir=/usr/share/man
466 # make
467 # make DESTDIR=$PWD/_pkg install
468 # strip -v _pkg/sbin/{depmod,insmod,modinfo,modprobe,rmmod}
469 # strip -v _pkg/bin/lsmod
470 # cp -i _pkg/sbin/{depmod,insmod,modinfo,modprobe,rmmod} $fs/sbin
471 # cp -i _pkg/bin/lsmod $fs/bin
472 # cd ..
473 </pre>
474 <a name="kernel-modules"></a>
475 <h3><font color="#6c0023">Copy kernel modules</font></h3>
476 <p>
477 Copy files from linux-2.6.20/_pkg:
478 </p>
479 <pre> # cp -a linux-2.6.20/_pkg/lib/* $fs/lib
480 </pre>
481 <h4>Compress kernel modules</h4>
482 <p>
483 Compress modules, this step will gain us back around 50% of available space.
484 We begin by moving into the rootfs, then we search for all files with the
485 <code>.ko</code> extension, and compress them. You
486 can also do this with the 'gzmodtaz.sh' script found in SliTaz tools:
487 </p>
488 <pre> # cd $fs
489 </pre>
490 <p>
491 With 'gztazmod.sh':
492 </p>
493 <pre> # cp -v ../src/slitaz-tools-1.1/utils/gztazmod.sh sbin
494 # ./sbin/gztazmod.sh lib/modules/2.6.20-slitaz
495 </pre>
496 <p>
497 Or by hand:
498 </p>
499 <pre> # cd lib/modules/2.6.20-slitaz
500 # find . -name "*.ko" -exec gzip '{}' \;
501 # sed 's/\.ko/.ko.gz/g' modules.dep &gt; tmp.dep
502 # rm modules.dep
503 # mv tmp.dep modules.dep
504 </pre>
505 <a name="initramfs-iso"></a>
506 <h3><font color="#6c0023">Generate the initramfs and an ISO image</font></h3>
507 <p>
508 To create a new ISO image, you can use 'mktaziso' in
509 <a href="http://www.slitaz.org/en/doc/cookbook/slitaz-tools.html">SliTaz tools</a>.
510 Or you can create a new initramfs image, copy it to /boot in the root of the cdrom
511 (rootcd) and finally generate an ISO image with genisoimage:
512 </p>
513 <pre> # cd $fs
514 # find . -print | cpio -o -H newc | gzip -9 &gt; ../rootfs.gz
515 # cd ..
516 # cp rootfs.gz rootcd/boot
517 # genisoimage -R -o slitaz-test.iso -b boot/isolinux/isolinux.bin \
518 -c boot/isolinux/boot.cat -no-emul-boot -boot-load-size 4 \
519 -V "SliTaz" -input-charset iso8859-1 -boot-info-table rootcd
520 </pre>
521 <p>
522 Test iso image:
523 </p>
524 <pre> # qemu -cdrom slitaz-test.iso
525 </pre>
527 <h4>Following chapter</h4>
528 <p>
529 The next chapter is called <a href="base-ncurses.html">Base Ncurses</a>. It
530 covers the installation and configuration of the ncurses libraries and
531 applications.
532 </p>
534 <!-- End of content -->
535 </div>
537 <!-- Footer. -->
538 <div id="footer">
539 <div class="footer-right"></div>
540 <a href="base-apps.html#top">Top of the page</a> |
541 <a href="index.html">Table of contents</a>
542 </div>
544 <div id="copy">
545 Copyright &copy; 2008 <a href="http://www.slitaz.org/en/">SliTaz</a> -
546 <a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a>;<br />
547 Documentation is under
548 <a href="http://www.gnu.org/copyleft/fdl.html">GNU Free Documentation License</a>
549 and code is <a href="http://validator.w3.org/">valid xHTML 1.0</a>.
550 </div>
552 </body>
553 </html>