website diff en/doc/scratchbook/base-apps.html @ rev 226

en: Add scratchbook pages
author Paul Issott <paul@slitaz.org>
date Tue Dec 23 14:10:23 2008 +0000 (2008-12-23)
parents
children 3291e51abf30
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/en/doc/scratchbook/base-apps.html	Tue Dec 23 14:10:23 2008 +0000
     1.3 @@ -0,0 +1,553 @@
     1.4 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     1.5 +    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     1.6 +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
     1.7 +<head>
     1.8 +    <title>SliTaz Scratchbook - Base Applications</title>
     1.9 +    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
    1.10 +    <meta name="description" content="" />
    1.11 +    <meta name="expires" content="never" />
    1.12 +    <meta name="modified" content="2008-11-22 17:00:00" />
    1.13 +    <meta name="publisher" content="www.slitaz.org" />
    1.14 +    <meta name="author" content="Christophe Lincoln"/>
    1.15 +    <link rel="shortcut icon" href="favicon.ico" />
    1.16 +    <link rel="stylesheet" type="text/css" href="book.css" />
    1.17 +</head>
    1.18 +<body bgcolor="#ffffff">
    1.19 +
    1.20 +<!-- Header and quick navigation -->
    1.21 +<div id="header">
    1.22 +<div align="right" id="quicknav">
    1.23 +    <a name="top"></a>
    1.24 +    <a href="base-system.html">Base system</a> |
    1.25 +    <a href="index.html">Table of contents</a> |
    1.26 +    <a href="base-ncurses.html">Base ncurses</a>
    1.27 +</div>
    1.28 +<h1><font color="#3E1220">SliTaz Scratchbook</font></h1>
    1.29 +</div>
    1.30 +
    1.31 +<!-- Content. -->
    1.32 +<div id="content">
    1.33 +<div class="content-right"></div>
    1.34 +
    1.35 +
    1.36 +<h2><font color="#df8f06">Base Applications</font></h2>
    1.37 +<p>
    1.38 +Install and configure libraries and basic applications.
    1.39 +</p>
    1.40 +<ul>
    1.41 +    <li><a href="#about">About the chapter</a> - Description and environmental variable ($fs)</li>
    1.42 +    <li><a href="#bc">bc-1.06</a> - Text mode calculator.</li>
    1.43 +    <li><a href="#zlib">zlib-1.2.3</a> - Compression libraries.</li>
    1.44 +    <li><a href="#pcre">pcre-7.4</a> - Perl-compatible regular expressions.</li>
    1.45 +    <li><a href="#e2fsprogs">e2fsprogs-1.39</a> - Filesystem management utilities.</li>
    1.46 +    <li><a href="#dropbear">dropbear-0.50</a> - Lightweight SSH server and client.</li>
    1.47 +    <li><a href="#lighttpd">lighttpd-1.4.18</a> - HTTP web server.</li>
    1.48 +    <li><a href="#iptables">iptables-1.3.7</a> - Netfilter, Linux firewall.</li>
    1.49 +    <li><a href="#sqlite">sqlite-3.5.1</a> - Small SQL database engine.</li>
    1.50 +    <li><a href="#cdrkit">cdrkit-1.1.5</a> - Tools for manipulating cdrom
    1.51 +    and ISO images.</li>
    1.52 +    <li><a href="#cpio">cpio-2.8</a> - Archiver used for SliTaz packages and
    1.53 +    initramfs.</li>
    1.54 +    <li><a href="#microperl">microperl-5.8.8</a> - A tiny Perl.</li>
    1.55 +    <li><a href="#module-init-tools">module-init-tools-3.2</a> - Tools for
    1.56 +    manipulating the kernel modules.</li>
    1.57 +    <li><a href="#kernel-modules">Copy and compress the Kernel modules.</a></li>
    1.58 +    <li><a href="#initramfs-iso">Generate the initramfs and an ISO image.</a></li>
    1.59 +</ul>
    1.60 +<a name="about"></a>
    1.61 +<h3><font color="#6c0023">About</font></h3>
    1.62 +<p>
    1.63 +This chaper describes the facilities libraries and basic text applications supplied with
    1.64 +SliTaz.
    1.65 +</p>
    1.66 +<h4>Assign an environment variable ($fs)</h4>
    1.67 +<p>
    1.68 +An environmental variable can't specify the path to the directory, just the name of the directory. 
    1.69 +We will affect a variable '$fs' to indicate the path to the root filesystem
    1.70 +(rootfs). To do this, we venture into the working directory SliTaz/, and type:
    1.71 +</p>
    1.72 +<pre> # export fs=$PWD/rootfs
    1.73 +</pre>
    1.74 +<p>
    1.75 +To check:
    1.76 +</p>
    1.77 +<pre> # echo $fs
    1.78 +</pre>
    1.79 +<a name="bc"></a>
    1.80 +<h3><font color="#6c0023">bc-1.06 - Text mode calculator</font></h3>
    1.81 +<p>
    1.82 +The application bc (<a href="http://www.gnu.org/software/bc/">www.gnu.org/software/bc/</a>) provides 
    1.83 +a small calculator. When compiling the utility, dc is also built, 
    1.84 +but not installed by SliTaz. Note that dc is also available with BusyBox. If you decide to copy dc, you 
    1.85 +need to delete the link to BusyBox (if it exists). We use a directory _pkg (package) for installation, 
    1.86 +use strip to clean the executables and copy the utilities:
    1.87 +</p>
    1.88 +<pre> # cd src
    1.89 + # wget http://ftp.gnu.org/pub/gnu/bc/bc-1.06.tar.gz
    1.90 + # tar xzfv bc-1.06.tar.gz
    1.91 + # cd bc-1.06
    1.92 + # ./configure --prefix=/usr --infodir=/usr/share/info \
    1.93 +   --mandir=/usr/share/man
    1.94 + # make
    1.95 + # make DESTDIR=$PWD/_pkg install
    1.96 + # strip -vs _pkg/usr/bin/*
    1.97 + # cp -avi _pkg/usr/bin/bc $fs/usr/bin
    1.98 +</pre>
    1.99 +<h4>libs</h4>
   1.100 +<p>
   1.101 +A small <code>ldd</code> on bc should produce:
   1.102 +</p>
   1.103 +<pre class="script">        libc.so.6 =&gt; /lib/libc.so.6 (0x40029000)
   1.104 +        /lib/ld-linux.so.2 =&gt; /lib/ld-linux.so.2 (0x40000000)
   1.105 +</pre>
   1.106 +<a name="zlib"></a>
   1.107 +<h3><font color="#6c0023">zlib-1.2.3 - Compression libraries</font></h3>
   1.108 +<p>
   1.109 +The zlib (<a href="http://www.zlib.net/">http://www.zlib.net/</a>) package provides compression 
   1.110 +and decompression functions used by among others, the SSH server Dropbear and the X server:
   1.111 +</p>
   1.112 +<pre> # cd ..
   1.113 + # wget http://www.gzip.org/zlib/zlib-1.2.3.tar.bz2
   1.114 + # tar xjfv zlib-1.2.3.tar.bz2
   1.115 + # cd zlib-1.2.3
   1.116 + # ./configure --shared --prefix=/usr
   1.117 + # make
   1.118 + # strip -vs libz.so*
   1.119 + # cp -av libz.so* $fs/usr/lib
   1.120 +</pre>
   1.121 +<a name="pcre"></a>
   1.122 +<h3><font color="#6c0023">pcre-7.4 - Perl-compatible regular expressions</font></h3>
   1.123 +<p>
   1.124 +The package pcre (<a href="http://www.pcre.org/">http://www.pcre.org/</a>) provides libraries of 
   1.125 +functions for Perl compatible regular expressions used by among others, the web server Lighttpd:
   1.126 +</p>
   1.127 +<pre> # cd ..
   1.128 + # wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-7.4.tar.gz
   1.129 + # tar xzfv pcre-7.4.tar.gz
   1.130 + # cd pcre-7.4
   1.131 + # ./configure --prefix=/usr
   1.132 + # make
   1.133 + # make DESTDIR=$PWD/_pkg install
   1.134 + # strip -vs _pkg/usr/bin/*
   1.135 + # strip -vs _pkg/usr/lib/*
   1.136 + # cp -av _pkg/usr/bin/* $fs/usr/bin
   1.137 + # cp -av _pkg/usr/lib/*.so* $fs/usr/lib
   1.138 +</pre>
   1.139 +<a name="e2fsprogs"></a>
   1.140 +<h3><font color="#6c0023">e2fsprogs-1.39 - Filesystem management utilities</font></h3>
   1.141 +<p>
   1.142 +The e3fsprogs (<a href="http://e2fsprogs.sourceforge.net/">http://e2fsprogs.sourceforge.net/</a>) provides 
   1.143 +utilities for handling ext2 and ext3 filesystems. We will not take all of them because we need the space. 
   1.144 +It should be noted that we use fsck of BusyBox:
   1.145 +</p>
   1.146 +<pre> # cd ..
   1.147 + # wget http://puzzle.dl.sourceforge.net/sourceforge/e2fsprogs/e2fsprogs-1.39.tar.gz
   1.148 + # tar xzf e2fsprogs-1.39.tar.gz
   1.149 + # cd e2fsprogs-1.39
   1.150 + # ./configure --prefix=/usr --with-root-prefix="" \
   1.151 +   --enable-elf-shlibs --disable-evms --sysconfdir=/etc \
   1.152 +   --infodir=/usr/share/info --mandir=/usr/share/man
   1.153 + # make
   1.154 + # make DESTDIR=$PWD/_pkg install
   1.155 + # strip -vs _pkg/sbin/*
   1.156 + # strip -vs _pkg/lib/*
   1.157 + # strip -vs _pkg/usr/bin/*
   1.158 + # strip -vs _pkg/usr/sbin/*
   1.159 + # strip -vs _pkg/usr/lib/*
   1.160 +</pre>
   1.161 +<p>
   1.162 +Install the utilities, configuration files and libraries in the rootfs of SliTaz. Be careful if you  
   1.163 +used fsck, that you didn't destroy the link to BusyBox:
   1.164 +</p>
   1.165 +<pre> # cp -i _pkg/sbin/{badblocks,blkid,dumpe2fs,e2fsck,e2image} $fs/sbin
   1.166 + # cp -i _pkg/sbin/{e2label,findfs,logsave,mke2fs,mkfs.*} $fs/sbin
   1.167 + # cp -i _pkg/sbin/{resize2fs,tune2fs} $fs/sbin
   1.168 + # cp -a _pkg/lib/* $fs/lib
   1.169 + # rm -rf $fs/lib/libss*
   1.170 + # cp -a _pkg/etc/* $fs/etc
   1.171 + # cp -a _pkg/usr/bin/* $fs/usr/bin
   1.172 + # cp -a _pkg/usr/sbin/* $fs/usr/sbin
   1.173 + # cp -ad _pkg/usr/lib/*.so $fs/usr/lib
   1.174 + # rm -rf $fs/usr/lib/libss*
   1.175 +</pre>
   1.176 +<p>
   1.177 +You can also copy files from the French locale:
   1.178 +</p>
   1.179 +<pre> # mkdir $fs/usr/share/locale
   1.180 + # cp -a _pkg/usr/share/locale/fr $fs/usr/share/locale
   1.181 +</pre>
   1.182 +<a name="dropbear"></a>
   1.183 +<h3><font color="#6c0023">Dropbear-0.50 - Lightweight SSH client and server</font></h3>
   1.184 +<p>
   1.185 +Dropbear (<a href="http://matt.ucc.asn.au/dropbear/dropbear.html">http://matt.ucc.asn.au/dropbear/dropbear.html</a>) 
   1.186 +is a small secure client/server supporting SSH 2. Dropbear is compatible with
   1.187 +OpenSSH and uses ~/.ssh/authorized_keys for the management of public keys. Dropbear also
   1.188 +provides a version of scp, which must be compiled with 'make scp':
   1.189 +</p>
   1.190 +<pre> # cd ..
   1.191 + # wget http://matt.ucc.asn.au/dropbear/releases/dropbear-0.50.tar.gz
   1.192 + # tar xzf dropbear-0.50.tar.gz
   1.193 + # cd dropbear-0.50
   1.194 + # ./configure --prefix=/usr
   1.195 + # make
   1.196 + # make scp
   1.197 + # make DESTDIR=$PWD/_pkg install
   1.198 + # strip -v scp
   1.199 + # strip -v _pkg/usr/bin/*
   1.200 + # strip -v _pkg/usr/sbin/*
   1.201 +</pre>
   1.202 +<p>
   1.203 +Install the client and tools in /usr/bin, and the server in /usr/sbin:
   1.204 +</p>
   1.205 +<pre> # cp scp $fs/usr/bin
   1.206 + # cp -a _pkg/usr/bin/* $fs/usr/bin
   1.207 + # cp -a _pkg/usr/sbin/* $fs/usr/sbin
   1.208 +</pre>
   1.209 +<h4>libs</h4>
   1.210 +<pre class="script">        libutil.so.1 =&gt; /lib/libutil.so.1 (0x40025000)
   1.211 +        libz.so.1 =&gt; /usr/lib/libz.so.1 (0x40028000)
   1.212 +        libcrypt.so.1 =&gt; /lib/libcrypt.so.1 (0x4003b000)
   1.213 +        libc.so.6 =&gt; /lib/libc.so.6 (0x40068000)
   1.214 +        /lib/ld-linux.so.2 =&gt; /lib/ld-linux.so.2 (0x40000000)
   1.215 +</pre>
   1.216 +<p>
   1.217 +Copy the library libutil.so.1 to $fs/lib, is this is not already the case. Other libraries 
   1.218 +should be present following the construction of the base system:
   1.219 +</p>
   1.220 +<pre> # cp -a /lib/libutil* $fs/lib
   1.221 +</pre>
   1.222 +<h4>Configure Dropbear</h4>
   1.223 +<p>
   1.224 +The user configuration files authorized_keys and known_hosts are in ~/.ssh. This directory and the 
   1.225 +file known_hosts are created automatically the first time the user launches dbclient. The system 
   1.226 +configuration files for the Dropbear server are in /etc/Dropbear:
   1.227 + </p>
   1.228 +<pre> # mkdir $fs/etc/dropbear
   1.229 +</pre>
   1.230 +<p>
   1.231 +You must generate the secure keys before starting the Dropbear server on SliTaz. 
   1.232 +You can use dropbearkey with the following commands:
   1.233 +</p>
   1.234 +<pre> # dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
   1.235 + # dropbearkey -t dss -f /etc/dropbear/dropbear_dss_host_key
   1.236 +</pre>
   1.237 +<p>
   1.238 +On SliTaz, you can start the SSH server with the command:
   1.239 +</p>
   1.240 +<pre> # /etc/init.d/dropbear start
   1.241 +</pre>
   1.242 +<a name="lighttpd"></a>
   1.243 +<h3><font color="#6c0023">lighttpd-1.4.18 - HTTP Web server</font></h3>
   1.244 +<p>
   1.245 +Lighttpd (<a href="http://www.lighttpd.net/">www.lighttpd.net</a>) is a light, secure and powerful web server. 
   1.246 +The project is very active and the server's configuration simple. It supports virtual hosts, CGI scripts, 
   1.247 +and allows intelligent management of the CPU:
   1.248 +</p>
   1.249 +<pre> # cd ..
   1.250 + # wget http://www.lighttpd.net/download/lighttpd-1.4.18.tar.gz
   1.251 + # tar xzf lighttpd-1.4.18.tar.gz
   1.252 + # cd lighttpd-1.4.18
   1.253 + # ./configure -enable-shared --disable-ipv6 --prefix=/usr \
   1.254 +   --libdir=/usr/lib/lighttpd --mandir=/usr/share/man
   1.255 + # make
   1.256 + # make DESTDIR=$PWD/_pkg install
   1.257 + # strip -vs _pkg/usr/bin/*
   1.258 + # strip -vs _pkg/usr/sbin/*
   1.259 + # strip -vs _pkg/usr/lib/lighttpd/*
   1.260 +</pre>
   1.261 +<p>
   1.262 +Install the server and generated libraries. We will then copy some of the modules (9):
   1.263 +</p>
   1.264 +<pre> # cp _pkg/usr/bin/* $fs/usr/bin
   1.265 + # cp _pkg/usr/sbin/* $fs/usr/sbin
   1.266 + # mkdir $fs/usr/lib/lighttpd
   1.267 + Modules :
   1.268 + # cp _pkg/usr/lib/lighttpd/mod_access.so $fs/usr/lib/lighttpd
   1.269 + # cp _pkg/usr/lib/lighttpd/mod_accesslog.so $fs/usr/lib/lighttpd
   1.270 + # cp _pkg/usr/lib/lighttpd/mod_alias.so $fs/usr/lib/lighttpd
   1.271 + # cp _pkg/usr/lib/lighttpd/mod_auth.so $fs/usr/lib/lighttpd
   1.272 + # cp _pkg/usr/lib/lighttpd/mod_cgi.so $fs/usr/lib/lighttpd
   1.273 + # cp _pkg/usr/lib/lighttpd/mod_compress.so $fs/usr/lib/lighttpd
   1.274 + # cp _pkg/usr/lib/lighttpd/mod_rewrite.so $fs/usr/lib/lighttpd
   1.275 + # cp _pkg/usr/lib/lighttpd/mod_status.so $fs/usr/lib/lighttpd
   1.276 + # cp _pkg/usr/lib/lighttpd/mod_userdir.so $fs/usr/lib/lighttpd
   1.277 +</pre>
   1.278 +<h4>libs</h4>
   1.279 +<p>
   1.280 +There should be a libdl.so.2 library; if missing, we can copy:
   1.281 +</p>
   1.282 +<pre> # cp -a /lib/libdl* $fs/lib
   1.283 +</pre>
   1.284 +<h4>/var/www - root of documents served</h4>
   1.285 +<p>
   1.286 +/var/www is the root directory of documents served by default. You can access this via the url http://localhost/. 
   1.287 +This directory contains an <code>index.html</code> automatically displayed by a query. 
   1.288 +We will create the directory /var/www, to see what's placed inside:
   1.289 +</p>
   1.290 +<pre> # mkdir -p $fs/var/www
   1.291 +</pre>
   1.292 +<h4>lighttpd.conf - Lighttpd configuration file</h4>
   1.293 +<p>
   1.294 +The Lighttpd main configuration file is located at /etc/lighttpd and is called lighttpd.conf. 
   1.295 +The configuration file SliTaz provides is self-explanatary, just browse. You can find other examples on the 
   1.296 +Lighttpd website and as well as a example configuration in /doc in the Lighttpd archive:
   1.297 +</p>
   1.298 +<pre> # cp -a ../slitaz-tools-1.1/etc/lighttpd $fs/etc
   1.299 +</pre>
   1.300 +<p>
   1.301 +Creating the directory containing the log files:
   1.302 +</p>
   1.303 +<pre> # mkdir $fs/var/log/lighttpd
   1.304 +</pre>
   1.305 +<h4>User and group www</h4>
   1.306 +<p>
   1.307 +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. 
   1.308 +The default user on SliTaz is 'www', but you can change this in the configuration file lighttpd.conf. 
   1.309 +The BusyBox application adduser has some limitations, so we add user 'www' manually. We also change permissions on 
   1.310 +the directory of web server logs:
   1.311 +</p>
   1.312 +<pre> # echo "www:x:80:80:www:/var/www:/bin/sh" &gt;&gt; $fs/etc/passwd
   1.313 + # echo "www:*:13509:0:99999:7:::" &gt;&gt; $fs/etc/shadow
   1.314 + # echo "www:*:13509:0:99999:7:::" &gt;&gt; $fs/etc/shadow-
   1.315 + # chroot $fs /bin/ash
   1.316 + /# addgroup -g 80 www
   1.317 + /# chown www.www /var/log/lighttpd
   1.318 + # exit
   1.319 +</pre>
   1.320 +<p>
   1.321 +To start the web server, you can use script /etc/init.d/lighttpd provided by SliTaz tools, by typing: 
   1.322 +<code>/etc/init.d/lighttpd start</code>. You can also automate its 
   1.323 +launch at boot with a link /etc/init.d/lighttpd pointing to /etc/rc.d/60lighttpd.
   1.324 +</p>
   1.325 +<a name="iptables"></a>
   1.326 +<h3><font color="#6c0023">iptables-1.3.7 - Netfilter, Linux firewall</font></h3>
   1.327 +<p>
   1.328 +Netfilter (<a href="http://www.netfilter.org/">www.netfilter.org</a>) is the module which provides the Linux 
   1.329 +kernel firewall functions, shared internet connections (NAT) and the archiving of network traffic. 
   1.330 +The iptables command allows you to configure Netfilter using iptables-restore 
   1.331 +and iptable-save, to save and restore the Netfilter configuration:
   1.332 +</p>
   1.333 +<pre> # cd ..
   1.334 + # wget http://www.netfilter.org/projects/iptables/files/iptables-1.3.7.tar.bz2
   1.335 + # tar xjf iptables-1.3.7.tar.bz2
   1.336 + # cd iptables-1.3.7
   1.337 + # make KERNEL_DIR=../linux-2.6.20 BINDIR=/sbin \
   1.338 +   LIBDIR=/lib MANDIR=/usr/share/man
   1.339 + # make KERNEL_DIR=../linux-2.6.20 BINDIR=/sbin \
   1.340 +   LIBDIR=/lib MANDIR=/usr/share/man \
   1.341 +   DESTDIR=$PWD/_pkg install
   1.342 + # strip  _pkg/sbin/*
   1.343 + # strip  _pkg/lib/iptables/*
   1.344 +</pre>
   1.345 +<p>
   1.346 +Installing the iptables* applications and libraries sufficient for a basic firewall:
   1.347 +</p>
   1.348 +<pre> # cp -a _pkg/sbin/iptables* $fs/sbin
   1.349 + # mkdir $fs/lib/iptables
   1.350 + # cp -a _pkg/lib/iptables/{libipt_standard.so,libipt_conntrack.so} \
   1.351 +   $fs/lib/iptables
   1.352 + # cp -a _pkg/lib/iptables/{libipt_tcp.so,libipt_udp.so} $fs/lib/iptables
   1.353 +</pre>
   1.354 +<p>
   1.355 +To satisfy the iptables dependencies, you must copy the libnsl* library:
   1.356 +</p>
   1.357 +<pre> # cp -va /lib/libnsl* $fs/lib/tls
   1.358 + # strip $fs/lib/libnsl*
   1.359 +</pre>
   1.360 +<a name="sqlite"></a>
   1.361 +<h3><font color="#6c0023">sqlite-3.5.1 - Small SQL database engine</font></h3>
   1.362 +<p>
   1.363 +This package provides sqlite3 (<a href="http://www.sqlite.org/">www.sqlite.org</a>) and sqlite3.so* 
   1.364 +libraries. SQLite is fast and efficient and integrates directly to programs using database files: 
   1.365 +</p>
   1.366 +<pre> # cd ..
   1.367 + # wget http://www.sqlite.org/sqlite-3.5.1.tar.gz
   1.368 + # tar xzf sqlite-3.5.1.tar.gz
   1.369 + # cd sqlite-3.5.1
   1.370 + # ./configure --prefix=/usr --disable-tcl
   1.371 + # make
   1.372 + # make DESTDIR=$PWD/_pkg install
   1.373 + # strip _pkg/usr/lib/*.so*
   1.374 + # strip _pkg/usr/bin/*
   1.375 +</pre>
   1.376 +<p>
   1.377 +Installing the sqlite3 utility and libraries in the rootfs of SliTaz:
   1.378 +</p>
   1.379 +<pre> # cp -a _pkg/usr/lib/*.so* $fs/usr/lib
   1.380 + # cp -a _pkg/usr/bin/* $fs/usr/bin
   1.381 +</pre>
   1.382 +<a name="cdrkit"></a>
   1.383 +<h3><font color="#6c0023">cdrkit-1.1.5 - Tools for manipulating cdrom and ISO images</font></h3>
   1.384 +<p>
   1.385 +cdrkit (<a href="http://www.cdrkit.org/">www.cdrkit.org</a>) provides tools for manipulating cdroms. 
   1.386 +SliTaz installs by default wodim for burning and genisoimage to create an ISO image. 
   1.387 +The compilation is a bit different (cmake), but shouldn't pose any problems:
   1.388 +</p>
   1.389 +<pre> # cd ..
   1.390 + # wget http://cdrkit.org/releases/cdrkit-1.1.5.tar.gz
   1.391 + # tar xzf cdrkit-1.1.5.tar.gz
   1.392 + # cd cdrkit-1.1.5
   1.393 + # make
   1.394 + # make install PREFIX=$PWD/_pkg/usr
   1.395 + # strip -v _pkg/usr/bin/*
   1.396 + # strip -v _pkg/usr/sbin/*
   1.397 + # cp _pkg/usr/bin/genisoimage $fs/usr/bin
   1.398 + # cp _pkg/usr/bin/wodim $fs/usr/bin
   1.399 +</pre>
   1.400 +<p>
   1.401 +Copy the library libcap.so.1 required by wodim:
   1.402 +</p>
   1.403 +<pre> # cp -a /lib/libcap.so* $fs/lib
   1.404 +</pre>
   1.405 +<a name="cpio"></a>
   1.406 +<h3><font color="#6c0023">cpio-2.8 - Archiver</font></h3>
   1.407 +<p>
   1.408 +<code>cpio</code> (<a href="http://www.gnu.org/software/cpio/">http://www.gnu.org/software/cpio/</a>) provides tools for 
   1.409 +manipulating cpio archives. The archive format is used for packages and the SliTaz initramfs image of the cdrom. 
   1.410 +Note that BusyBox provides a version of cpio that only unpacks archives:
   1.411 +</p>
   1.412 +<pre> # cd ..
   1.413 + # wget ftp://sunsite.cnlab-switch.ch/mirror/gnu/cpio/cpio-2.8.tar.gz
   1.414 + # tar xzf cpio-2.8.tar.gz
   1.415 + # cd cpio-2.8
   1.416 + # ./configure --prefix=/usr --bindir=/bin \
   1.417 +   --libexecdir=/usr/bin --mandir=/usr/share/man \
   1.418 +   --infodir=/usr/share/info
   1.419 + # make
   1.420 + # make DESTDIR=$PWD/_pkg install
   1.421 + # strip -v _pkg/bin/*
   1.422 + # strip -v _pkg/usr/bin/*
   1.423 +</pre>
   1.424 +<p>
   1.425 +Installing <code>cpio</code> in /bin and <code>rmt</code> in /usr/bin. You can also install the French locale files:
   1.426 +</p>
   1.427 +<pre> # cp -a _pkg/bin/* $fs/bin
   1.428 + # cp -a _pkg/usr/bin/* $fs/usr/bin
   1.429 + # cp -a _pkg/usr/share/locale/fr $fs/usr/share/locale
   1.430 +</pre>
   1.431 +<a name="microperl"></a>
   1.432 +<h3><font color="#6c0023">microperl-5.8.8 - A tiny Perl</font></h3>
   1.433 +<p>
   1.434 +Microperl is a tiny implementation of Perl using the most basic functions of the language. 
   1.435 +You can find more info in the source archive and the file <code>README.micro</code>. 
   1.436 +We use a small <code>sed</code> on the configuration file that searches for microperl modules 
   1.437 +in /usr/lib/perl5. We also create a link to the #! /usr/bin/perl script:
   1.438 +</p>
   1.439 +<pre> # wget http://ftp.funet.fi/pub/CPAN/src/perl-5.8.8.tar.gz
   1.440 + # tar xzf perl-5.8.8.tar.gz
   1.441 + # cd perl-5.8.8
   1.442 + # sed -i s/'usr\/local'/'usr'/ uconfig.sh
   1.443 + # sed -i s/'perl5\/5.9'/'perl5'/ uconfig.sh
   1.444 + # sed -i s/'unknown'/'i486-pc-linux-gnu'/ uconfig.sh
   1.445 + # make -f Makefile.micro regen_uconfig
   1.446 + # make -f Makefile.micro
   1.447 + # strip microperl
   1.448 + # cp microperl $fs/usr/bin
   1.449 + # chroot $fs /bin/ash
   1.450 + /# cd /usr/bin
   1.451 + /# ln -s microperl perl
   1.452 + /# exit
   1.453 +</pre>
   1.454 +<a name="module-init-tools"></a>
   1.455 +<h3><font color="#6c0023">module-init-tools-3.2 - Utilities for manipulating kernel modules</font></h3>
   1.456 +<p>
   1.457 +The <a href="http://ftp.kernel.org/pub/linux/utils/kernel/module-init-tools/">module-init-tools</a> 
   1.458 +from kernel.org: modprobe, insmod, rmmod and lsmod. We have chosen to use these because we can compile 
   1.459 +modutils/modprobe to support compressed (.gz) modules to save space. To do this we use the option 
   1.460 +--enable-zlib, we then clean and copy the binaries. We do not take everything that has been created, 
   1.461 +only what we need: depmod, insmod, modinfo, modprobe and rmmod in /sbin and lsmod in /bin:
   1.462 +</p>
   1.463 +<pre> # cd ..
   1.464 + # wget http://ftp.kernel.org/pub/linux/utils/kernel/module-init-tools/module-init-tools-3.2.tar.bz2
   1.465 + # tar xjf module-init-tools-3.2.tar.bz2
   1.466 + # cd module-init-tools-3.2
   1.467 + # ./configure --enable-zlib --prefix=/usr --sbindir=/sbin --bindir=/bin \
   1.468 +   --sysconfdir=/etc --infodir=/usr/share/info --mandir=/usr/share/man
   1.469 + # make
   1.470 + # make DESTDIR=$PWD/_pkg install
   1.471 + # strip -v _pkg/sbin/{depmod,insmod,modinfo,modprobe,rmmod}
   1.472 + # strip -v _pkg/bin/lsmod
   1.473 + # cp -i _pkg/sbin/{depmod,insmod,modinfo,modprobe,rmmod} $fs/sbin
   1.474 + # cp -i _pkg/bin/lsmod $fs/bin
   1.475 + # cd ..
   1.476 +</pre>
   1.477 +<a name="kernel-modules"></a>
   1.478 +<h3><font color="#6c0023">Copy kernel modules</font></h3>
   1.479 +<p>
   1.480 +Copy files from linux-2.6.20/_pkg:
   1.481 +</p>
   1.482 +<pre> # cp -a linux-2.6.20/_pkg/lib/* $fs/lib
   1.483 +</pre>
   1.484 +<h4>Compress kernel modules</h4>
   1.485 +<p>
   1.486 +Compress modules, this step will us gain back around 50% of available space.
   1.487 +We begin by moving into the rootfs, then we search for all files with the 
   1.488 +<code>.ko</code> extension, and compress them. You
   1.489 +can also do this with the 'gzmodtaz.sh' script found in SliTaz tools:
   1.490 +</p>
   1.491 +<pre> # cd $fs
   1.492 +</pre>
   1.493 +<p>
   1.494 +With 'gztazmod.sh':
   1.495 +</p>
   1.496 +<pre> # cp -v ../src/slitaz-tools-1.1/utils/gztazmod.sh sbin
   1.497 + # ./sbin/gztazmod.sh lib/modules/2.6.20-slitaz
   1.498 +</pre>
   1.499 +<p>
   1.500 +Or by hand:
   1.501 +</p>
   1.502 +<pre> # cd lib/modules/2.6.20-slitaz
   1.503 + # find . -name "*.ko" -exec gzip '{}' \;
   1.504 + # sed 's/\.ko/.ko.gz/g' modules.dep &gt; tmp.dep
   1.505 + # rm modules.dep
   1.506 + # mv tmp.dep modules.dep
   1.507 +</pre>
   1.508 +<a name="initramfs-iso"></a>
   1.509 +<h3><font color="#6c0023">Generate the initramfs and an ISO image</font></h3>
   1.510 +<p>
   1.511 +To create a new ISO image, you can use 'mktaziso' in 
   1.512 +<a href="http://www.slitaz.org/en/doc/cookbook/slitaz-tools.html">SliTaz tools</a>.  
   1.513 +Or you can create a new initramfs image, copy it to /boot in the root of the cdrom
   1.514 +(rootcd) and finally generate an ISO image with genisoimage:
   1.515 +</p>
   1.516 +<pre> # cd $fs
   1.517 + # find . -print | cpio -o -H newc | gzip -9 &gt; ../rootfs.gz
   1.518 + # cd ..
   1.519 + # cp rootfs.gz rootcd/boot
   1.520 + # genisoimage -R -o slitaz-test.iso -b boot/isolinux/isolinux.bin \
   1.521 +   -c boot/isolinux/boot.cat -no-emul-boot -boot-load-size 4 \
   1.522 +   -V "SliTaz" -input-charset iso8859-1 -boot-info-table rootcd
   1.523 +</pre>
   1.524 +<p>
   1.525 +Test iso image:
   1.526 +</p>
   1.527 +<pre> # qemu -cdrom slitaz-test.iso
   1.528 +</pre>
   1.529 +
   1.530 +<h4>Following chapter</h4>
   1.531 +<p>
   1.532 +The next chapter is called <a href="base-ncurses.html">Base Ncurses</a>. It
   1.533 +covers the installation and configuration of the ncurses libraries and
   1.534 +applications.
   1.535 +</p> 
   1.536 +
   1.537 +<!-- End of content -->
   1.538 +</div>
   1.539 +
   1.540 +<!-- Footer. -->
   1.541 +<div id="footer">
   1.542 +	<div class="footer-right"></div>
   1.543 +	<a href="#top">Top of the page</a> | 
   1.544 +	<a href="index.html">Table of contents</a>
   1.545 +</div>
   1.546 +
   1.547 +<div id="copy">
   1.548 +    Copyright &copy; 2008 <a href="http://www.slitaz.org/en/">SliTaz</a> -
   1.549 +    <a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a>;<br />
   1.550 +    Documentation is under
   1.551 +    <a href="http://www.gnu.org/copyleft/fdl.html">GNU Free Documentation License</a>
   1.552 +    and code is <a href="http://validator.w3.org/">valid xHTML 1.0</a>.
   1.553 +</div>
   1.554 +
   1.555 +</body>
   1.556 +</html>