Developers Corner

author:bellard, linea

This page aims to list SliTaz tricks that you can’t find in other distributions.

ISO9660 image file

The SliTaz GNU/Linux distrbution is published as a downloadable iso image file. The different flavors (base, core64, loram…) are built in this format.

Nowadays booting on a CD-ROM is not so fashionable. People prefer to boot their SliTaz from a USB key, a memory card or a hard disk.

It’s easy to create a USB key under Linux with the dd command. Some third party Windows tools aim to be able to create USB keys, but most of them don’t support the SliTaz many-in-one format (also known as russian dolls).

Tip

SliTaz ISO images are also a DOS/Windows program to create USB keys.

C:\> ren slitaz.iso mkusbkey.exe

People would like to add some personal data to the ISO image such as a Wifi configuration or SSH keys. But the ISO remastering is not an easy thing to do.

SliTaz provides a linux tool iso2exe and the DOS/Windows tool isohybrid.exe to add a custom initrd and some extra cmdline arguments.

Note

By the way, these tools add the DOS/Windows program to create USB keys.

A Linux usage can be:

iso2exe -a "rdinit=init.custom" -i initrd.gz slitaz.iso -f

A DOS (16 bits) or Windows (32 bits) usage can be:

C:\> isohybrid -a "rdinit=init.custom" -i initrd.gz slitaz.iso -f

Tip

The executable shell script /init.custom in the initrd.gz file installs the extra software in the boot scripts:

#!/bin/sh

# Add custom kernel modules
sed -i 's/LOAD_MODULES="/&amodule anothermodule/' /etc/rcS.conf

# Start extra daemons
sed -i 's/RUN_DAEMONS="/&demon1 demon2/' /etc/rcS.conf

# Custom boot commands
cat >> /etc/init.d/local.sh <<EOT
shell commands...
EOT

# Continue normal boot sequence
exec /init

An iso9660 image file has three parts:

  • a 32Kb header filled with zeros
  • a ISO 9660 filesystem
  • a tail filled with zeros to round up the file size to the next megabyte

The ISO header: to create a USB key from DOS/Windows

This is a 3 in 1 header:

  • a Master boot record from isolinux to boot from a USB key
  • a 16 bits DOS .exe file to launch a Linux utility menu with a USB creation item
  • a 32 bits Windows .exe file to create a USB key

Note

The El Torito boot is untouched (as a part of the ISO9660 filesystem)

It includes a iso9660 filesystem md5sum hash and its own checksum (in the .exe file header). Design rational can be found in the README file

The taziso tool can both show and use the ISO header features.

Tip

A taziso graphical/web interface is available in the tazpanel utility under the boot ‣ mine menu item.

Tip

Most of the ISO header features can be used with other live Linux distributions such as Tiny Core Linux, Puppy Linux or KNOPPIX (i.e. you can use iso2exe or isohybrid.exe with these distributions too).

The ISO tail: to store your configurations

The ISO tail has a magic string and its own md5 hash. The md5 can be checked by taziso and the ISO boot menu under DOS. The ISO9660 filesystem is untouched. The md5 hash in the boot area is still valid.

The isolinux bootloader is modified by SliTaz to load the custom configuration unlike other distributions.

Small custom configurations should not change the ISO image size thanks to the megabyte alignment. Larger configurations can extend the ISO image without limitation.

Tip

Custom configurations help to test the SliTaz weekly build with automatic wifi setups or SSH keys… You can add the following entry in your grub config, have a custom automatic setup and still test the real CD-ROM boot sequence.

SliTaz rolling iso
   map --mem --heads=0 --sectors-per-tracks=0 /boot/slitaz-rolling.iso (hd32)
   map --hook
   chainloader (hd32)

Packages enhancements

dropbear

Dropbear is a SSH2 client and server. The server side supports X11 forwarding but the client does not. SliTaz provides a tiny shell script named sshx to restore this feature. By the way 2 other scripts are given:

  • pppssh a poor mans VPN. TCP based, it can add delays to the VPN network.
  • sshfbvnc adds authentication and encryption to the fbvnc viewer.

sshfs-fuse

Sshfs-fuse can mount a remote filesystem on the local machine. SliTaz provides a tiny script named rsshfs to mount a local filesystem on a remote machine.

cloop

Cloop packages (fusecloop, cloop-utils…) are able to mount any cloop formats. The official software fails to mount earlier formats.

They add a new format to reduce the memory consumption during the compressed file creation.

ipxe

This PXE has a built in configuration to boot from a SliTaz server and can be used without a local PXE server.

sane-backends

The scanner drivers package adds a GUI in a tazpanel module.