Revision 2 of 2026-11-25 18:54 UTC by tux, not the current one. Current version - History

Remaster SliTaz 5.1

Changing a SliTaz ISO: add your files, settings or scripts, change the boot menu, or make an ISO with your own set of packages. There are three ways, from the lightest to the cleanest:

To write an image of a live system you have already customized, see Remaster a live system in the Handbook (i486, with tazlito).

What is on a SliTaz ISO

The whole live system is two files in /boot:

The boot loader differs with the architecture:

The tools used below: cpio comes with BusyBox; lzma and unlzma (package lzma) and genisoimage (package cdrkit) are on the core ISOs; xorriso is in the libisoburn package, isohybrid in syslinux-extra (i486).

Add an archive next to rootfs.gz

The kernel can unpack several archives one after the other: the files of the last one win. Put your changes in a small archive, load it after rootfs.gz, and the system stays untouched. For example, a command run at the end of every boot, in /etc/init.d/local.sh. As root, take the file from the ISO, change it, and pack it alone. Here the ISO is in /home/remaster; an i486 ISO works the same way:

# mkdir -p /home/remaster/extra
# cd /home/remaster
# mount -o loop,ro slitaz-core-x86_64-cooking.iso /media/cdrom
# cp /media/cdrom/boot/grub/grub.cfg .
# cd extra
# unlzma -c /media/cdrom/boot/rootfs.gz | cpio -id etc/init.d/local.sh
# echo 'echo "Hello from my remaster"' >> etc/init.d/local.sh
# find etc | cpio -o -H newc | gzip -9 > ../my.gz
# cd ..

Run these as root, so the files in the archive belong to root. Any file can go in extra/, at its place in the system: etc/hostname, a script in usr/bin/, a setting in etc/slitaz/.

On x86_64

Add the archive to the initrd line of each SliTaz entry in grub.cfg:

initrd /boot/rootfs.gz /boot/my.gz

then write a new ISO from the old one, with the two files added:

# xorriso -indev slitaz-core-x86_64-cooking.iso -outdev my-slitaz.iso \
  -map my.gz /boot/my.gz -map grub.cfg /boot/grub/grub.cfg \
  -boot_image any replay

-boot_image any replay copies the boot setup of the original ISO: GRUB for BIOS, the UEFI partition, the hybrid layout for USB keys.

On i486

Copy the files of the ISO, add the archive, and list it after rootfs.gz, separated by a comma, on the APPEND line of the slitaz label in isolinux.cfg:

# mkdir rootcd
# cp -a /media/cdrom/. rootcd/
# cp my.gz rootcd/boot/
# vi rootcd/boot/isolinux/isolinux.cfg
APPEND linux /boot/bzImage initrd=/boot/rootfs.gz,/boot/my.gz root=/dev/null video=-32 autologin

The entries of the language menu reuse that line. Then build the ISO as told in "Write an i486 ISO" below.

Unpack and change the system

For bigger changes, unpack rootfs.gz. Work as root, on a disk with some room: unpacked, the core system takes about 170 MB on i486 and 230 MB on x86_64. Root keeps the owners and the device files of /dev. With the ISO mounted on /media/cdrom as above:

# mkdir -p /home/remaster/rootfs
# cd /home/remaster/rootfs
# unlzma -c /media/cdrom/boot/rootfs.gz | cpio -idm

unlzma refuses a rootfs.gz made with another compression: use zcat for gzip, zstd -dc for zstd.

Change what you want in rootfs/: settings in etc/, files for the live user, scripts in etc/init.d/local.sh. To change the packages, build a flavor instead (below): a package copied by hand is missing from the package database of the live system.

Then pack it again, from the same directory:

# find . -print | cpio -o -H newc | lzma e -si -so > ../rootfs.gz

With the xz package, xz --format=lzma -9 -c in place of lzma e -si -so makes a slightly smaller file, in the same format.

On x86_64, put it in a new ISO:

# cd /home/remaster
# xorriso -indev slitaz-core-x86_64-cooking.iso -outdev my-slitaz.iso \
  -map rootfs.gz /boot/rootfs.gz -boot_image any replay

On i486, copy it to rootcd/boot/rootfs.gz (see above for rootcd) and write the ISO as below.

Write an i486 ISO

Do not use xorriso here: the isolinux of SliTaz cannot read the ISO it writes ("ERROR: No configuration file found"). Use genisoimage, then isohybrid so the ISO also boots from a USB key:

# cd /home/remaster/rootcd
# find * -type f ! -name md5sum ! -name isolinux.bin ! -name boot.cat | \
  sort | xargs md5sum > ../md5sum && mv ../md5sum md5sum
# cd ..
# genisoimage -R -o my-slitaz.iso -b boot/isolinux/isolinux.bin \
  -c boot/isolinux/boot.cat -no-emul-boot -boot-load-size 4 \
  -boot-info-table -V SliTaz rootcd
# isohybrid my-slitaz.iso

The md5sum file lists the checksums the "Check media" entry of the menu verifies: the find line writes it again for the changed files, the way metier does.

Change the boot menu

On i486, add a label to rootcd/boot/isolinux/isolinux.cfg, a copy of the slitaz one with your boot options:

LABEL french
	MENU LABEL SliTaz in French
	COM32 c32box.c32
	APPEND linux /boot/bzImage initrd=/boot/rootfs.gz root=/dev/null video=-32 autologin lang=fr_FR kmap=fr-latin1

On x86_64, add an entry to grub.cfg and map it into the new ISO as above:

menuentry "SliTaz in French" {
	linux  /boot/bzImage rw root=/dev/null autologin lang=fr_FR.UTF-8 kmap=fr-latin1
	initrd /boot/rootfs.gz
}

Your own flavor with metier

A flavor is a directory: a receipt, a packages.list and the files to add. metier installs the packages of the list and their dependencies into a new system, adds your files and writes the ISO, for i486 or x86_64. It is the tool behind the official ISOs, and the right way to add or remove packages.

# spk-add metier mercurial

metier works in /home/slitaz when you can write there (after cook setup, for example), otherwise in ~/.slitaz. Get the official flavors there and start from the closest one:

$ mkdir -p ~/.slitaz/repos
$ hg clone https://hg.slitaz.org/flavors ~/.slitaz/repos/flavors
$ cd ~/.slitaz/repos/flavors
$ cp -a core-x86_64 my-x86_64

In my-x86_64/:

Check the flavor, build it, and boot it in QEMU:

$ metier check my-x86_64
$ metier build my-x86_64
$ metier emu my-x86_64 --memory 1024

The build needs root: run by a user, metier starts itself again with sudo. The ISO lands in ~/.slitaz/iso/ (or /home/slitaz/iso/), with its .md5 and a .pkgs list of the packages it holds. Packages come from the mirror, except those you cooked yourself and left in the packages directory of the workspace: they come first. See Receipt to make them.

Tips

Troubleshooting

isolinux stops at boot: with "No configuration file found": the i486 ISO was written with xorriso. Write it with genisoimage as above.

The kernel panics at boot, or the system misses files: the archive was packed from the wrong directory, or not as root. Paths in the archive are relative to the root of the system (etc/... or ./etc/...), never rootfs/etc/...: run find from inside rootfs/ or extra/.

unlzma stops with an error on rootfs.gz: it is not lzma; see the note on zcat and zstd -dc above.

The VM is stuck or killed while loading the system: not enough RAM. The live system runs from memory.