website view en/doc/scratchbook/base-apps.html @ rev 1344

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