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