website annotate en/doc/scratchbook/base-apps.html @ rev 669

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