+This chaper describes the facilities libraries and basic text applications supplied with
+SliTaz.
+
+
Assign an environment variable ($fs)
+
+An environmental variable can't specify the path to the directory, just the name of the directory.
+We will affect a variable '$fs' to indicate the path to the root filesystem
+(rootfs). To do this, we venture into the working directory SliTaz/, and type:
+
+
# export fs=$PWD/rootfs
+
+
+To check:
+
+
# echo $fs
+
+
+
bc-1.06 - Text mode calculator
+
+The application bc (www.gnu.org/software/bc/) provides
+a small calculator. When compiling the utility, dc is also built,
+but not installed by SliTaz. Note that dc is also available with BusyBox. If you decide to copy dc, you
+need to delete the link to BusyBox (if it exists). We use a directory _pkg (package) for installation,
+use strip to clean the executables and copy the utilities:
+
+
# cd src
+ # wget http://ftp.gnu.org/pub/gnu/bc/bc-1.06.tar.gz
+ # tar xzfv bc-1.06.tar.gz
+ # cd bc-1.06
+ # ./configure --prefix=/usr --infodir=/usr/share/info \
+ --mandir=/usr/share/man
+ # make
+ # make DESTDIR=$PWD/_pkg install
+ # strip -vs _pkg/usr/bin/*
+ # cp -avi _pkg/usr/bin/bc $fs/usr/bin
+
+The zlib (http://www.zlib.net/) package provides compression
+and decompression functions used by among others, the SSH server Dropbear and the X server:
+
+
# cd ..
+ # wget http://www.gzip.org/zlib/zlib-1.2.3.tar.bz2
+ # tar xjfv zlib-1.2.3.tar.bz2
+ # cd zlib-1.2.3
+ # ./configure --shared --prefix=/usr
+ # make
+ # strip -vs libz.so*
+ # cp -av libz.so* $fs/usr/lib
+
+
+
pcre-7.4 - Perl-compatible regular expressions
+
+The package pcre (http://www.pcre.org/) provides libraries of
+functions for Perl compatible regular expressions used by among others, the web server Lighttpd:
+
+The e3fsprogs (http://e2fsprogs.sourceforge.net/) provides
+utilities for handling ext2 and ext3 filesystems. We will not take all of them because we need the space.
+It should be noted that we use fsck of BusyBox:
+
+Install the utilities, configuration files and libraries in the rootfs of SliTaz. Be careful if you
+used fsck, that you didn't destroy the link to BusyBox:
+
+You can also copy files from the French locale:
+
+
# mkdir $fs/usr/share/locale
+ # cp -a _pkg/usr/share/locale/fr $fs/usr/share/locale
+
+
+
Dropbear-0.50 - Lightweight SSH client and server
+
+Dropbear (http://matt.ucc.asn.au/dropbear/dropbear.html)
+is a small secure client/server supporting SSH 2. Dropbear is compatible with
+OpenSSH and uses ~/.ssh/authorized_keys for the management of public keys. Dropbear also
+provides a version of scp, which must be compiled with 'make scp':
+
+
# cd ..
+ # wget http://matt.ucc.asn.au/dropbear/releases/dropbear-0.50.tar.gz
+ # tar xzf dropbear-0.50.tar.gz
+ # cd dropbear-0.50
+ # ./configure --prefix=/usr
+ # make
+ # make scp
+ # make DESTDIR=$PWD/_pkg install
+ # strip -v scp
+ # strip -v _pkg/usr/bin/*
+ # strip -v _pkg/usr/sbin/*
+
+
+Install the client and tools in /usr/bin, and the server in /usr/sbin:
+
+
# cp scp $fs/usr/bin
+ # cp -a _pkg/usr/bin/* $fs/usr/bin
+ # cp -a _pkg/usr/sbin/* $fs/usr/sbin
+
+Copy the library libutil.so.1 to $fs/lib, is this is not already the case. Other libraries
+should be present following the construction of the base system:
+
+
# cp -a /lib/libutil* $fs/lib
+
+
Configure Dropbear
+
+The user configuration files authorized_keys and known_hosts are in ~/.ssh. This directory and the
+file known_hosts are created automatically the first time the user launches dbclient. The system
+configuration files for the Dropbear server are in /etc/Dropbear:
+
+
# mkdir $fs/etc/dropbear
+
+
+You must generate the secure keys before starting the Dropbear server on SliTaz.
+You can use dropbearkey with the following commands:
+
+On SliTaz, you can start the SSH server with the command:
+
+
# /etc/init.d/dropbear start
+
+
+
lighttpd-1.4.18 - HTTP Web server
+
+Lighttpd (www.lighttpd.net) is a light, secure and powerful web server.
+The project is very active and the server's configuration simple. It supports virtual hosts, CGI scripts,
+and allows intelligent management of the CPU:
+
+
# cd ..
+ # wget http://www.lighttpd.net/download/lighttpd-1.4.18.tar.gz
+ # tar xzf lighttpd-1.4.18.tar.gz
+ # cd lighttpd-1.4.18
+ # ./configure -enable-shared --disable-ipv6 --prefix=/usr \
+ --libdir=/usr/lib/lighttpd --mandir=/usr/share/man
+ # make
+ # make DESTDIR=$PWD/_pkg install
+ # strip -vs _pkg/usr/bin/*
+ # strip -vs _pkg/usr/sbin/*
+ # strip -vs _pkg/usr/lib/lighttpd/*
+
+
+Install the server and generated libraries. We will then copy some of the modules (9):
+
+There should be a libdl.so.2 library; if missing, we can copy:
+
+
# cp -a /lib/libdl* $fs/lib
+
+
/var/www - root of documents served
+
+/var/www is the root directory of documents served by default. You can access this via the url http://localhost/.
+This directory contains an index.html automatically displayed by a query.
+We will create the directory /var/www, to see what's placed inside:
+
+
# mkdir -p $fs/var/www
+
+
lighttpd.conf - Lighttpd configuration file
+
+The Lighttpd main configuration file is located at /etc/lighttpd and is called lighttpd.conf.
+The configuration file SliTaz provides is self-explanatary, just browse. You can find other examples on the
+Lighttpd website and as well as a example configuration in /doc in the Lighttpd archive:
+
+
# cp -a ../slitaz-tools-1.1/etc/lighttpd $fs/etc
+
+
+Creating the directory containing the log files:
+
+
# mkdir $fs/var/log/lighttpd
+
+
User and group www
+
+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.
+The default user on SliTaz is 'www', but you can change this in the configuration file lighttpd.conf.
+The BusyBox application adduser has some limitations, so we add user 'www' manually. We also change permissions on
+the directory of web server logs:
+
+To start the web server, you can use script /etc/init.d/lighttpd provided by SliTaz tools, by typing:
+/etc/init.d/lighttpd start. You can also automate its
+launch at boot with a link /etc/init.d/lighttpd pointing to /etc/rc.d/60lighttpd.
+
+
+
iptables-1.3.7 - Netfilter, Linux firewall
+
+Netfilter (www.netfilter.org) is the module which provides the Linux
+kernel firewall functions, shared internet connections (NAT) and the archiving of network traffic.
+The iptables command allows you to configure Netfilter using iptables-restore
+and iptable-save, to save and restore the Netfilter configuration:
+
+
# cd ..
+ # wget http://www.netfilter.org/projects/iptables/files/iptables-1.3.7.tar.bz2
+ # tar xjf iptables-1.3.7.tar.bz2
+ # cd iptables-1.3.7
+ # make KERNEL_DIR=../linux-2.6.20 BINDIR=/sbin \
+ LIBDIR=/lib MANDIR=/usr/share/man
+ # make KERNEL_DIR=../linux-2.6.20 BINDIR=/sbin \
+ LIBDIR=/lib MANDIR=/usr/share/man \
+ DESTDIR=$PWD/_pkg install
+ # strip _pkg/sbin/*
+ # strip _pkg/lib/iptables/*
+
+
+Installing the iptables* applications and libraries sufficient for a basic firewall:
+
+
# cp -a _pkg/sbin/iptables* $fs/sbin
+ # mkdir $fs/lib/iptables
+ # cp -a _pkg/lib/iptables/{libipt_standard.so,libipt_conntrack.so} \
+ $fs/lib/iptables
+ # cp -a _pkg/lib/iptables/{libipt_tcp.so,libipt_udp.so} $fs/lib/iptables
+
+
+To satisfy the iptables dependencies, you must copy the libnsl* library:
+
+This package provides sqlite3 (www.sqlite.org) and sqlite3.so*
+libraries. SQLite is fast and efficient and integrates directly to programs using database files:
+
+
# cd ..
+ # wget http://www.sqlite.org/sqlite-3.5.1.tar.gz
+ # tar xzf sqlite-3.5.1.tar.gz
+ # cd sqlite-3.5.1
+ # ./configure --prefix=/usr --disable-tcl
+ # make
+ # make DESTDIR=$PWD/_pkg install
+ # strip _pkg/usr/lib/*.so*
+ # strip _pkg/usr/bin/*
+
+
+Installing the sqlite3 utility and libraries in the rootfs of SliTaz:
+
+
# cp -a _pkg/usr/lib/*.so* $fs/usr/lib
+ # cp -a _pkg/usr/bin/* $fs/usr/bin
+
+
+
cdrkit-1.1.5 - Tools for manipulating cdrom and ISO images
+
+cdrkit (www.cdrkit.org) provides tools for manipulating cdroms.
+SliTaz installs by default wodim for burning and genisoimage to create an ISO image.
+The compilation is a bit different (cmake), but shouldn't pose any problems:
+
+
# cd ..
+ # wget http://cdrkit.org/releases/cdrkit-1.1.5.tar.gz
+ # tar xzf cdrkit-1.1.5.tar.gz
+ # cd cdrkit-1.1.5
+ # make
+ # make install PREFIX=$PWD/_pkg/usr
+ # strip -v _pkg/usr/bin/*
+ # strip -v _pkg/usr/sbin/*
+ # cp _pkg/usr/bin/genisoimage $fs/usr/bin
+ # cp _pkg/usr/bin/wodim $fs/usr/bin
+
+
+Copy the library libcap.so.1 required by wodim:
+
+
# cp -a /lib/libcap.so* $fs/lib
+
+
+
cpio-2.8 - Archiver
+
+cpio (http://www.gnu.org/software/cpio/) provides tools for
+manipulating cpio archives. The archive format is used for packages and the SliTaz initramfs image of the cdrom.
+Note that BusyBox provides a version of cpio that only unpacks archives:
+
+
# cd ..
+ # wget ftp://sunsite.cnlab-switch.ch/mirror/gnu/cpio/cpio-2.8.tar.gz
+ # tar xzf cpio-2.8.tar.gz
+ # cd cpio-2.8
+ # ./configure --prefix=/usr --bindir=/bin \
+ --libexecdir=/usr/bin --mandir=/usr/share/man \
+ --infodir=/usr/share/info
+ # make
+ # make DESTDIR=$PWD/_pkg install
+ # strip -v _pkg/bin/*
+ # strip -v _pkg/usr/bin/*
+
+
+Installing cpio in /bin and rmt in /usr/bin. You can also install the French locale files:
+
+
# cp -a _pkg/bin/* $fs/bin
+ # cp -a _pkg/usr/bin/* $fs/usr/bin
+ # cp -a _pkg/usr/share/locale/fr $fs/usr/share/locale
+
+
+
microperl-5.8.8 - A tiny Perl
+
+Microperl is a tiny implementation of Perl using the most basic functions of the language.
+You can find more info in the source archive and the file README.micro.
+We use a small sed on the configuration file that searches for microperl modules
+in /usr/lib/perl5. We also create a link to the #! /usr/bin/perl script:
+
+
# wget http://ftp.funet.fi/pub/CPAN/src/perl-5.8.8.tar.gz
+ # tar xzf perl-5.8.8.tar.gz
+ # cd perl-5.8.8
+ # sed -i s/'usr\/local'/'usr'/ uconfig.sh
+ # sed -i s/'perl5\/5.9'/'perl5'/ uconfig.sh
+ # sed -i s/'unknown'/'i486-pc-linux-gnu'/ uconfig.sh
+ # make -f Makefile.micro regen_uconfig
+ # make -f Makefile.micro
+ # strip microperl
+ # cp microperl $fs/usr/bin
+ # chroot $fs /bin/ash
+ /# cd /usr/bin
+ /# ln -s microperl perl
+ /# exit
+
+
+
module-init-tools-3.2 - Utilities for manipulating kernel modules
+
+The module-init-tools
+from kernel.org: modprobe, insmod, rmmod and lsmod. We have chosen to use these because we can compile
+modutils/modprobe to support compressed (.gz) modules to save space. To do this we use the option
+--enable-zlib, we then clean and copy the binaries. We do not take everything that has been created,
+only what we need: depmod, insmod, modinfo, modprobe and rmmod in /sbin and lsmod in /bin:
+
+Compress modules, this step will us gain back around 50% of available space.
+We begin by moving into the rootfs, then we search for all files with the
+.ko extension, and compress them. You
+can also do this with the 'gzmodtaz.sh' script found in SliTaz tools:
+
+To create a new ISO image, you can use 'mktaziso' in
+SliTaz tools.
+Or you can create a new initramfs image, copy it to /boot in the root of the cdrom
+(rootcd) and finally generate an ISO image with genisoimage:
+
+This chapter describes the construction and installation of some ncurses applications
+and libraries in SliTaz. The procedure consists of moving into the /src directory,
+downloading the sources for the application in question, unpacking, reading the README or
+INSTALL file(s), compiling and installing the binary in SliTaz. Once the applications
+are installed, we can create a new initramfs, copy it to the root of the cdrom and generate
+a new ISO image. For this you can also use mktaziso in
+SliTaz tools.
+
+
Assign an environment variable ($fs)
+
+An environmental variable can't specify the path to the directory, just the name of the directory.
+We will affect a variable '$fs' to indicate the path to the root filesystem
+(rootfs). To do this, we venture into the working directory SliTaz/, and type:
+
+
# export fs=$PWD/rootfs
+
+
+To check:
+
+
# echo $fs
+
+
+
ncurses-5.6 - Terminal utilities and libraries
+
+ncurses (dickey.his.com/ncurses/) contains
+functions to display text in different ways on the screen of a Linux terminal and also provides
+the terminfo file. Ncurses libraries are used among others by retawq, nano and some games.
+We install the libraries in /lib and the rest in /usr/bin with a small strip to clean the executables:
+
+Copy the libcurses library and some applications in SliTaz. The reset utility is used at the end of
+the rcS initialization script to remove the Linux logo. If you wish, you can copy the associated utilities
+(tic, tack, toe, etc), being careful not to delete the link to BusyBox:
+
+GNU nano (www.nano-editor.org) is a well known,
+fast, effective GNU/Linux text editor that supports colored syntax.
+This is the default text editor in SliTaz:
+
+
# cd ..
+ # wget http://www.nano-editor.org/dist/v2.0/nano-2.0.6.tar.gz
+ # tar xzf nano-2.0.6.tar.gz
+ # cd nano-2.0.6
+ # ./configure --enable-all --enable-extra --prefix=/usr \
+ --infodir=/usr/share/info --mandir=/usr/share/man \
+ --sysconfdir=/etc
+ # make
+ # make DESTDIR=$PWD/_pkg install
+ # strip -v _pkg/usr/bin/nano
+
+
+Copy the nano binary and the rnano link in SliTaz:
+
+
# cp -a _pkg/usr/bin/* $fs/usr/bin
+
+
+Copy the configuration files in _pkg/usr/share/nano to our rootfs:
+
+
# cp -a _pkg/usr/share/nano $fs/usr/share
+
+
libs
+
+If we execute the ldd command on nano, the following dependancies
+should be displayed:
+
+About the language, you can copy the .mo files created when installing nano from
+/usr/share/locale/(fr,en,de,es,etc)/LC_MESSAGES to the rootfs. Example for the the French language:
+
+
# cp -a _pkg/usr/share/locale/fr/LC_MESSAGES $fs/usr/share/locale/fr
+
+
Customize nano
+
+You can customize nano via /etc/nanorc or ~/.nanorc for each user of the system. It's in
+this file that you can define the colors used by nano through the files in /usr/share/nano.
+You will find a broad example of this file in the archive of nano and
+SliTaz tools.
+
+
+For a system configuration file, you can copy the file in SliTaz tools to /etc in the rootfs:
+
+
# cd ..
+ # cp -a slitaz-tools-1.1/etc/nanorc $fs/etc
+
+
+
retawq-0.2.6c - Text mode Web browser
+
+retawq (retawq.sourceforge.net)
+is a small text-only web browser. We only flag a few useful options when configuring,
+retawq needs terminfo files, libcurses libraries and libthread:
+
+For language, you can copy the .mo files in /i18n of the retawq archive to
+/usr/share/locale/(fr,en,es,etc)/LC_MESSAGES. Example for the French language,
+renaming the file to retawq.mo:
+
+To personalize retawq, you can use a ~/.retawq directory containing a config file.
+You can also save bookmarks (html) in the root directory of the user. You will find an
+examples/ in the archive of retawq (or SliTaz tools) containing a bookmarks.html
+page with a list of favorite web sites. You can also copy the docs (/documents) from retawq
+to /usr/share/doc/retawq.
+
+
+
htop-6.0.5 - System process viewer
+
+
+htop (htop.sourceforge.net/) is software
+that displays system processes using ncurses.
+
+
+Returning to the /src directory, download, unpack, configure, compile and clean (with strip):
+
+
# cd ..
+ # wget http://switch.dl.sourceforge.net/sourceforge/htop/htop-0.6.5.tar.gz
+ # tar xzf htop-0.6.5.tar.gz
+ # cd htop-0.6.5
+ # ./configure --prefix=/usr --mandir=/usr/share/man
+ # make
+ # make DESTDIR=$PWD/_pkg install
+ # strip -v _pkg/usr/bin/htop
+
+
+Copy the htop binary in SliTaz:
+
+
# cp _pkg/usr/bin/htop $fs/usr/bin
+
+
+You can still copy the htop icon found in: _pkg/usr/share/pixmaps.
+
# cp -a _pkg/usr/share/locale/fr $fs/usr/share/locale
+
+
+The dialog configuration file is /etc/dialogrc and/or ~/.dialogrc for each user.
+There are also full examples of scripts in the /sample directory in the sources of dialog.
+
+
+
Ninvaders-0.1.1 - Space Invaders clone
+
+
+ninvaders (http://ninvaders.sourceforge.net/)
+is a clone of the popular Space Invaders game (46 KB). We begin by placing ourselves in the
+/src directory, then we download, untar, compile, clean using strip and copy the nInvaders binary
+in /usr/games of SliTaz:
+
+
# cd ..
+ # wget http://ovh.dl.sourceforge.net/sourceforge/ninvaders/ninvaders-0.1.1.tar.gz
+ # tar xzf ninvaders-0.1.1.tar.gz
+ # cd ninvaders-0.1.1
+ # make
+ # strip -v nInvaders
+ # cp nInvaders $fs/usr/games
+
+Rhapsody (http://rhapsody.sourceforge.net/)
+is a fast and lightweight chat client supporting the IRC protocol. It provides a menu for
+managing servers, channels and configuration. It is therefore easy to use:
+
+
# cd ..
+ # wget http://switch.dl.sourceforge.net/sourceforge/rhapsody/rhapsody_0.28b.tgz
+ # tar xzf rhapsody_0.28b.tgz
+ # cd rhapsody-0.28b
+ # ./configure -i /usr/bin -d /usr/share/doc/rhapsody
+ # make
+ # strip -v rhapsody
+
+
+Install the binary and help files in SliTaz. We must adjust permissions on
+these files so that everyone can read:
+
+
# cp rhapsody $fs/usr/bin
+ # mkdir $fs/usr/share/doc/rhapsody
+ # cp -a help $fs/usr/share/doc/rhapsody/help
+ # chmod 644 $fs/usr/share/doc/rhapsody/help/*
+
+You can customize rhapsody via ~/.rhapsodyrc or use <Ctrl+T> for options:
+
+
+
Generate the initramfs and an ISO image
+
+To create a new ISO image, you can use 'mktaziso' in SliTaz tools.
+Or you can create a new initramfs image, copy it to /boot in the root of the cdrom
+(rootcd) and finally generate an ISO image with genisoimage:
+
+SliTaz does not use a level of execution (runlevel), the
+system is initialized via a primary script and its main
+configuration file. This script itself launches some other smaller
+scripts which deal with the internationalization or the
+commands placed for the system to start.
+
+
+
+
/etc/init.d/* - Directory of scripts and daemons
+
+The directory /etc/init.d contains all of the rc scripts,
+scripts finishing with '.sh' are simple shell scripts and
+daemons such as 'dropbear' or 'lighttpd' are scripts
+that launch a service. The daemon scripts can start, stop or
+restart through the command:
+
+
# /etc/init.d/daemon [start|stop|restart]
+
+
+On SliTaz you will find a /etc/init.d/README describing the
+basic function of rc scripts. Also note that all startup
+scripts and daemons can call upon the /etc/init.d/rc.functions
+file. This file makes it possible to include various functions
+in rc scripts. SliTaz uses a function status to check whether
+the previous command has succeeded (0) or not.
+
+
+
+
/etc/init.d/rcS - Primary initialization script
+
+The /etc/init.d/rcS script configures all the
+basic services and initializes the base system. It begins by
+mounting the filesystems and starts services like syslogd, klogd,
+mdev and cleans up the system and so on. It
+uses the configuration file /etc/rcS.conf to locate which daemons
+and scripts to launch at startup. You can browse the script
+to know which commands are executed:
+
+
# nano rootfs/etc/init.d/rcS
+
+
+
+
+
Specific scripts and daemons
+
+
bootopts.sh - LiveCD mode options
+
+This script is used to configure the LiveCD options passed
+at boot time and is readable via the /proc/cmdline file.
+This is the script that allows you to use a USB key or
+external hard disk /home partition with the option home=usb
+or home=sda[1-9] or directly specify the language and
+keyboard parameters.
+
+
+
network.sh - Initializing the network
+
+This script searches the network.sh configuration file
+/etc/network.conf for the network interface to use; if one wants to
+launch the DHCP client (or not) or if you want to use a fixed
+(static) IP. On SliTaz the /etc/init.d/network.sh
+script configures the network interfaces to start using the
+information contained in /etc/network.conf. If the variable
+$DHCP is equal to yes, then the /etc/init.d/network.sh
+script launches the DHCP client on the $INTERFACE interface.
+
+
+
i18n.sh - Internationalization
+
+SliTaz backs up the configuration of the default locale in
+/etc/locale.conf which is read by /etc/profile at each
+login. The /etc/locale.conf is generated during boot time
+thanks to the /etc/i18n.sh script. This script launches the
+'tazlocale' application if /etc/locale.conf doesn't exist.
+We use the same process for the keyboard layout using 'tazkmap'
+and the /etc/kmap.conf configuration file. Both applications
+are installed and located in /sbin and use dialog and the
+ncurses library. The script also checks whether the
+configuration file for the time zone /etc/TZ exists,
+otherwise it creates one relying on the keyboard configuration.
+
+
+
local.sh - Local commands
+
+The /etc/init.d/local.sh script allows the system administrator
+to add local commands to be executed at boot. Example:
+
+
#!/bin/sh
+# /etc/init.d/local.sh: Local startup commands.
+# All commands here will be executed at boot time.
+#
+. /etc/init.d/rc.functions
+
+echo "Starting local startup commands... "
+
+
+
+
rc.shutdown
+
+This script is invoked by /etc/inittab during system shutdown.
+It also stops all daemons via the variable RUN_DAEMONS in
+the primary /etc/rcS.conf configuration file.
+
+
+
+
/etc/inittab - Configuration file init
+
+The first file read by the Kernel at boot. It defines the
+initialization script (/etc/init.d/rcS), shells (ttys) and
+actions in the event of a reboot or disruption. You will find
+a complete example with accompanying notes in SliTaz tools:
+
+
# /etc/inittab: init configuration for SliTaz GNU/Linux.
+# Boot-time system configuration/initialization script.
+#
+::sysinit:/etc/init.d/rcS
+
+# /sbin/getty respawn shell invocations for selected ttys.
+tty1::respawn:/sbin/getty 38400 tty1
+tty2::respawn:/sbin/getty 38400 tty2
+tty3::respawn:/sbin/getty 38400 tty3
+tty4::respawn:/sbin/getty 38400 tty4
+tty5::respawn:/sbin/getty 38400 tty5
+tty6::respawn:/sbin/getty 38400 tty6
+
+# Stuff to do when restarting the init
+# process, or before rebooting.
+::restart:/etc/init.d/rc.shutdown
+::restart:/sbin/init
+::ctrlaltdel:/sbin/reboot
+::shutdown:/etc/init.d/rc.shutdown
+
+
+This chapter describes the commands for the compilation and installation of
+GTK+ applications distributed by default on the SliTaz LiveCD. The installation
+of GTK+ libraries are described in the
+GTK+ libs chapter.
+
+
Environmental variable ($fs)
+
+If you do not specify any path to the rootfs directory, export the environmental variable:
+
+Tranmission BitTorrent client is fast, lightweight and easy to use. The compiled package provides
+the command line client (transmissioncli) and a GTK+ client (transmission-gtk). We install the GTK+ client,
+the command line client is distributed as a separate SliTaz package (*.tazpkg).
+
+The emelFM2 application is a file manager providing lots of useful functions, such as mounting
+devices, a text viewer, opening a terminal in the current directory and so on.
+
+To compile and run geany on SliTaz, you must have the libstdc++ and libgcc1 libraries,
+both provided by gcc (we recompiled with gcc-4.1.1), but you can copy the libraries from the host system.
+
+
+Note: The force is with you, if you activate it via the option --enable-the-force.
+
+
# wget http://mesh.dl.sourceforge.net/sourceforge/geany/geany-0.11.tar.gz
+ # tar xzf geany-0.11.tar.gz
+ # cd geany-0.11
+ # ./configure --prefix=/usr --mandir=/usr/share/man \
+ --disable-vte --enable-the-force
+ # make
+ # make DESTDIR=$PWD/_pkg install
+ # strip -v _pkg/usr/bin/*
+
+The gFTP application is a fast and efficient FTP client with a GTK+ graphical interface.
+Note that we compile without support for a text interface and ssl support. Get, untar,
+configure, compile and install.
+
# wget http://www.gftp.org/gftp-2.0.18.tar.gz
+ # tar xzf gftp-2.0.18.tar.gz
+ # cd gftp-2.0.18
+ # ./configure --prefix=/usr --mandir=/usr/share/man \
+ --disable-ssl --disable-textport \
+ --build=i486-pc-linux-gnu --host=i486-pc-linux-gnu
+ # make
+ # make DESTDIR=$PWD/_pkg install
+ # strip _pkg/usr/bin/*
+
+
Install in rootfs
+
+SliTaz provides only the GTK+ client on the CD. Note that gftp is just a small
+script that detects the environment (console or X) and launches the right interface:
+
+
# cp _pkg/usr/bin/gftp $fs/usr/bin
+ # cp _pkg/usr/bin/gftp-gtk $fs/usr/bin
+ # cp -a _pkg/usr/share/gftp $fs/usr/share
+ # cp -a _pkg/usr/share/pixmaps $fs/usr/share
+ # cp -a _pkg/usr/share/locale/fr $fs/usr/share/locale
+
+
+To save a little space and avoid duplication, you can delete 'COPYING' (17 KB)
+included in /usr/share/gftp. The GNU licence is already present in /usr/share/licence,
+if you want to create a symbolic link.
+
+
+
xpad-2.12 - Mini note taking application
+
+The Xpad application can quickly take notes via various customizable (GTK+) windows.
+
+This chapter describes the installation and configuration of GTK libraries
+on SliTaz used by lots of free software. Note that you can simply compile and
+create a SliTaz package that you can install on demand with tazpkg.
+
+
+The compilation of GTK applications can take quite some time and you must meet many dependencies.
+You will find a guide in English:
+gtk-building.html on developer.gnome.org.
+This document sets out the need to compile things in order: Glib, Pango, ATK and GTK+, etc.
+Before commencing you must verify that the dependencies are properly installed on your host system.
+Glib, Pango, ATK and GTK+ form a group of packages and are distributed by the team of GTK developers.
+
+
Environmental variable ($fs)
+
+If you do not specify any path to the rootfs directory, export the environmental variable:
+
# cd src
+ # wget http://cairographics.org/releases/cairo-1.2.6.tar.gz
+ # tar xzf cairo-1.2.6.tar.gz
+ # cd cairo-1.2.6
+ # ./configure --prefix=/usr --mandir=/usr/share/man \
+ --with-html-dir=/usr/share/doc
+ # make
+ # make DESTDIR=$PWD/_pkg install
+ # strip -v _pkg/usr/lib/*.so*
+
+
Install in rootfs
+
# cp -av _pkg/usr/lib/*.so* $fs/usr/lib
+
+
+
glib-2.12.4 - C routines
+
# cd ..
+ # wget ftp://ftp.gtk.org/pub/glib/2.12/glib-2.12.4.tar.bz2
+ # tar xjf glib-2.12.4.tar.bz2
+ # cd glib-2.12.4
+ # ./configure --prefix=/usr --sysconfdir=/etc \
+ --mandir=/usr/share/man --with-html-dir=/usr/share/doc
+ # make
+ # make DESTDIR=$PWD/_pkg install
+ # strip -v _pkg/usr/bin/*
+ # strip -v _pkg/usr/lib/*.so*
+
+
Install in rootfs
+
+Option: the utilities glib-genmarshal and gobject-query need the /lib/tls/librt.so.1:
+
+
# cp -a _pkg/usr/lib/*.so* $fs/usr/lib
+ # cp -a _pkg/usr/share/locale/fr $fs/usr/share/locale
+
+ The binaries and options:
+ # cp -a _pkg/usr/bin/* $fs/usr/bin
+
+
+
pango-1.14.8 - Library for layout and rendering of text
+
# cd ..
+ # wget ftp://ftp.gtk.org/pub/pango/1.14/pango-1.14.8.tar.bz2
+ # tar xjf pango-1.14.8.tar.bz2
+ # cd pango-1.14.8
+ # ./configure --prefix=/usr --sysconfdir=/etc \
+ --mandir=/usr/share/man --with-html-dir=/usr/share/doc
+ # make
+ # make DESTDIR=$PWD/_pkg install
+ # strip -v _pkg/usr/bin/*
+ # strip -v _pkg/usr/lib/*.so*
+ # strip -v _pkg/usr/lib/pango/1.5.0/modules/*
+
+
Install in rootfs
+
# cp -a _pkg/usr/bin/* $fs/usr/bin
+ # cp -a _pkg/usr/lib/*.so* $fs/usr/lib
+ # cp -a _pkg/usr/lib/pango $fs/usr/lib
+ # rm -rf $fs/usr/lib/pango/1.5.0/modules/*.la
+ # cp -a _pkg/etc $fs
+
+
+Create /etc/pango.modules via chroot in the rootfs (pango-querymodules uses librt.so.1):
+
+At this stage you can test GTK+ with the 'gtk-demo' application by creating an ISO and using qemu.
+You can also compile a small GTK application such as LeafPad and test! The compiliation and installation
+of GTK+ applications distributed by default with SliTaz are described in the next chapter
+GTK apps.
+
+
+
Generate the initramfs and an ISO image
+
+To create a new ISO image, you can use 'mktaziso' in
+SliTaz tools .
+Or you can create a new initramfs image, copy it to /boot in the root of the cdrom
+(rootcd) and finally generate an ISO image with genisoimage:
+
+This chapter describes the installation of locales in SliTaz GNU/Linux from a SliTaz GNU/Linux host system.
+The installation of locales contained in the X server are described in the chapter
+X window system. The various files copied in this chapter come from the
+compiliation package glibc-2.3.6 forming part of the toolchain.
+
+
Various file directories
+
+We begin by creating the directories that contain libraries and files relevant to the different locales.
+The directory LC_MESSAGES contains the files for the translated messages (.mo), if they exist:
+
+You can delete the localedef binary to gain some space:
+
+
# rm rootfs/usr/bin/localedef
+
+
+
Config and use of locale
+
+To use a language in a session, you can create a script launched at boot, or
+add 2 lines to the ~/.profile specific to each user with:
+
+
+export LANG=fr_CH
+export LC_ALL=fr_CH
+
+
+
+Voilà, the French language should now function If you installed retawq or nano, you can check the
+performance of locales by copying the .mo files in the sources of Retawq or Nano to /usr/share/locale/fr/LC_MESSAGES.
+
+
Following chapter
+
+SliTaz uses the /etc/init.d/i18n.sh script and the /etc/locale.conf configuration file to
+manage the system locale. This is detailed in the next chapter Boot scripts.
+On a working system, just modify /etc/locale.conf with a text editor or launch 'tazlocale'
+to change the default system locale Or to specify the language as a boot option: lang=xx.
+
+This chapter describes the installation and configuration of the X window system on SliTaz. We will
+install libraries for expat, XML, fonts, a graphical server (Xvesa), a terminal emulator (xterm),
+various small tools and a window manager (JWM). We'll also install the JPEG libraries and Links web browser.
+
+
Environmental variable ($fs)
+
+If you do not specify any path to the rootfs directory, export the environmental variable:
+
# cd ..
+ # wget http://switch.dl.sourceforge.net/sourceforge/expat/expat-2.0.0.tar.gz
+ # tar xzf expat-2.0.0.tar.gz
+ # cd expat-2.0.0
+ # ./configure --sysconfdir=/etc --prefix=/usr \
+ --mandir=/usr/share/man
+ # make
+ # make DESTDIR=$PWD/_pkg install
+ # strip -v _pkg/usr/lib/*
+ # strip -v _pkg/usr/bin/*
+
+
+Thereafter, we will install 'xterm' which needs libexpat.so.0, simply create a symbolic link and voilà.
+Then you can install the 'xmlwf' application and libraries in the rootfs:
+
+
# cd _pkg/usr/lib
+ # ln -s libexpat.so.1.5.0 libexpat.so.0
+ # cp -a *.so* $fs/usr/lib
+ # cd ..
+ # cp -a bin/* $fs/usr/bin
+ # cd ../..
+
+The package freetype (http://www.freetype.org/)
+contains libraries used by X for configuring the system fonts:
+
+
# cd ..
+ # wget http://download.savannah.gnu.org/releases/freetype/freetype-2.3.1.tar.bz2
+ # tar xjf freetype-2.3.1.tar.bz2
+ # cd freetype-2.3.1
+ # ./configure --sysconfdir=/etc --prefix=/usr \
+ --mandir=/usr/share/man
+ # make
+ # make DESTDIR=$PWD/_pkg install
+ # strip -vs _pkg/usr/lib/*
+ # cp -a _pkg/usr/bin/* $fs/usr/bin
+ # cp -a _pkg/usr/lib/*.so* $fs/usr/lib
+
+
+
fontconfig-2.4.2 - Manage system fonts
+
+The fontconfig package (www.fontconfig.org/wiki/)
+provides the libfontconfig library used by many programs under X. Note XFree86 also provides these
+utilities. We chose the original package because it works better with JWM:
+
+
# cd ..
+ # wget http://fontconfig.org/release/fontconfig-2.4.2.tar.gz
+ # tar xzf fontconfig-2.4.2.tar.gz
+ # cd fontconfig-2.4.2
+ # ./configure --sysconfdir=/etc --prefix=/usr \
+ --mandir=/usr/share/man --localstatedir=/var
+ # make
+ # make DESTDIR=$PWD/_pkg install
+ # strip -v _pkg/usr/bin/*
+ # strip -v _pkg/usr/lib/*
+ # cp -a _pkg/usr/bin/* $fs/usr/bin
+ # cp -a _pkg/usr/lib/*.so* $fs/usr/lib
+ # cp -a _pkg/etc $fs
+ # cp -a _pkg/var $fs
+
+
libs
+
+A 'ldd' on fc-cache gives the libraries below. You can also use libfreetype of XFree86:
+
+We will use the binary versions of Xvesa server (www.xfree86.org/)
+and fonts distributed by Xfree86.org. We could also copy Xorg libraries from the host system that would
+be used for compiling X applications. Xvesa works well like this and simplifies things. You can also rebuild
+Xorg packages on your development system.
+
+
Xtinyx server - Xvesa
+
+The Xvesa server is very light and uses tiny libraries; it is contained in the Xtinyx.tgz archive.
+Download and install in /usr/bin of SliTaz rootfs:
+
+The colors configuration file used by the X server is called: rgb.txt; we suggest
+that you copy it to the host system. The library libX11.so will seek the configuration files in
+/usr/share/X11, and the Xvesa server in /usr/X11R6/lib/X11; we create a link in /usr/share/X11 to enable this:
+
+To operate the server, we need the basic fonts; you can download them from Xfree86.org and then compile
+packages from Xorg, or copy them from your host system. The system fonts can be put into different folders
+and the cache updated with lc-cache. Attention, fonts take pride of place and you can only install
+the minimum. /usr/share/fonts contains the TrueType fonts such as bitstream-vera:
+
+
# wget http://ftp.xfree86.org/pub/XFree86/4.6.0/binaries/Linux-ix86-glibc23/Xfnts.tgz
+ # tar xzf Xfnts.tgz
+ # mkdir -p $fs/usr/X11R6/lib/X11/fonts
+ # mkdir -p $fs/usr/share/fonts/truetype
+
+ Copy the fonts...
+ (# cp -a lib/X11/fonts/* $fs/usr/X11R6/lib/X11/fonts)
+ (# cp -a /usr/share/fonts/truetype/* $fs/usr/share/fonts/truetype
+
+
+Then regenerate the fonts.dir file, you must run mkfontdir on the directory in question:
+
+
# mkfontdir $fs/usr/X11R6/lib/X11/fonts/75dpi
+
+
+Fontconfig configuration files can be found in /etc/fonts provided by the fontconfig package.
+Now you can run 'fc-cache' to update the cache, and 'fc-list' for a list of fonts. You do this
+by chrooting into the rootfs:
+
+On SliTaz, we installed 4 locales: C, iso8859-1, iso8859-15 and iso 8859-2 from the
+compilation of Xorg.
+You can copy the files from the host system or use the files distributed by XFree86.
+Sample copy of all the locales from the host system:
+
+Note that can already use Xvesa as a X terminal if you have a machine on the network accepting XDMCP connections.
+For this, you can start the server with -query, for example:
+
# wget http://puzzle.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.18.tar.bz2
+ # tar xjf libpng-1.2.18.tar.bz2
+ # cd libpng-1.2.18
+ # ./configure --enable-shared --prefix=/usr \
+ --mandir=/usr/share/man
+ # make
+ # make DESTDIR=$PWD/_pkg install
+ # strip _pkg/usr/lib/*.so*
+ # cp -a _pkg/usr/lib/libpng12.so* $fs/usr/lib
+ # cp -a _pkg/usr/bin/libpng12* $fs/usr/bin
+
+
+
jwm-2.0 - Window manager
+
+Joe's Window Manager (http://www.joewing.net/programs/jwm/)
+is an ultra light and friendly window manager. This is the default SliTaz window manager. The main configuration
+file: /etc/jwm/system.jwnrc includes the style and config menu:
+
+SliTaz uses the ~/.Xsession file to start a graphical session. The 'startx' command checks
+whether the file exists or it runs 'tazx' to configure the X system. The user guide on X
+window is located in: /usr/share/doc/slitaz/user-guide/x-window.html or is on the website:
+
+
+We chose to use the Tango icons theme http://tango.freedesktop.org/,
+that aren't compiled. We only use the minimum: images in 16 x 16 format that we put in /usr/share/icons.
+
+To create a new ISO image, you can use 'mktaziso' in
+SliTaz tools .
+Or you can create a new initramfs image, copy it to /boot in the root of the cdrom
+(rootcd) and finally generate an ISO image with genisoimage:
+
+Note SliTaz uses the Xvesa server provided by XFree86 and Xorg libraries, this page describes
+the compilation of Xorg libraries used by SliTaz. This document is primarily aimed at
+develpers and contributors to the project, but it may be useful to all those seeking to rebuild
+Xorg and Xlib libraries from source generating a minimum of dependencies.
+
+
+
+
Build Xorg automatically with Tazwok
+
+On SliTaz, if you have Tazwok installed, you can rebuild Xorg with a few commands.
+The wok contains a package called xorg and another named xorg-dev,
+they can compile/cook all the packages used by Xorg on SliTaz. To compile, you must have
+most of the development packages installed; if this is not the case:
+
+
# tazpkg get-install slitaz-dev-pkgs
+
+
+Then you can start to cook (if everything is ready, wok and development packages, etc),
+starting with the protos' (xproto, etc):
+
+Xorg is distributed in the form of modules, which is handy because you can only install what you want,
+but it takes a lot of downloads. To help, we have created a small script that downloads the minimum
+required for SliTaz; you can find the script getXorg.sh in
+SliTaz tools (1.1).
+This script is no longer updated, developers use the
+wok and tools.
+To use the script, it must be placed in the directory where you want to download Xorg:
+
+
# cd ..
+ # mkdir Xorg && cd Xorg
+ # cp slitaz-tools-1.1/utils/getXorg-7.2.sh .
+ # ./getXorg-7.2.sh
+
+
+
Compile Xorg by hand
+
+Compiling Xorg can take a long time, there are many packages. To commence you need to
+compile the downloaded proto packages, you can use the command make DESTDIR=$PWD/_pkg install to
+install the package in a given directory. Example:
+
+
# cd proto
+ # tar xzf xproto-X11R7.2-7.0.10.tar.gz
+ # cd xproto-X11R7.2-7.0.10
+ # ./configure --prefix=/usr --sysconfdir=/etc \
+ --mandir=/usr/share/man --localstatedir=/var \
+ --build=i486-pc-linux-gnu --host=i486-pc-linux-gnu
+ # make
+ # make install
+
+
+Compile libraries by taking again the options used by proto. Example using the proper package to
+compile xtrans, remember to run ldconfig if you install the package on the development machine:
+
+
# cd .. && cd lib
+ # tar xzf xtrans-X11R7.2-1.0.3.tar.gz
+ # cd xtrans-X11R7.2-1.0.3
+ # ./configure --prefix=/usr --sysconfdir=/etc \
+ --mandir=/usr/share/man --localstatedir=/var \
+ --build=i486-pc-linux-gnu --host=i486-pc-linux-gnu
+ # make
+ # make install
+ # ldconfig
+
+
+Once all the packaged libraries are compiled, you can begin to compile X applications such as the
+graphical terminal Xterm. Note: SliTaz uses the RGB package containing the /usr/share/X11/rgt.text
+file for defining colors. Example using the xsetroot application that permits
+you to change the background color of the screen (modify $VERSION for the version that you want downloaded):
+
+
# cd .. && cd app
+ # tar xzf xsetroot-$VERSION.tar.gz
+ # cd xsetroot-$VERSION
+ # ./configure --prefix=/usr --sysconfdir=/etc \
+ --mandir=/usr/share/man --localstatedir=/var \
+ --build=i486-pc-linux-gnu --host=i486-pc-linux-gnu
+ # make && make install
+