SliTaz GNU/Linux official and community documentation wiki.
.png
Translations of this page:

This is an old revision of the document!


Cook a flavor from scratch

Introduction

Welcome to this howto ! it's the base for a second scratchbook, which explain how too recompile entirely SliTaz from scratch including toolchain. All the job will be done using tazwok-experimental (actually in Alpha state). Even if the scripts have some major issue, the steps explained here should do the job without problems. Thanks to report any problem to the author (tazpkg info tazwok-experimental give you my mail).

Having some knowledge about how legacies SliTaz tools and basics commands works will help you to understand what's going on in this howto. Hoverwhere, simply copy/paste the given command lines will probably works.

Explanation

Tazwok now provide tools to cook the wok from scratch using a minimal chroot. You have to use a special version of the wok, called wok-experimental. It contains the needed patches, which should be applied ontop of the wok cooking. Explanations about how to obtain the wok experimental are here : Prepare experimental wok.

Tools needed

  • A functionnal cooking system (live or installed); you also can use the slitaz-experimental-base ISO.
  • tazwok-experimental-0.0.2, tazchroot-0.0.1 and libtaz-0.0.1. Note: installing tazwok-experimental remove tazwok legacy.
  • An internet connection to download sources.

Steps

  • Make the chroot (in this how-to we use the packages of the new toolchain from the experimental repository; but this should works with cooking toolchain).
  • Cook a temporary toolchain : it's the cross-compile toolchain which will cook the “real” toolchain (the packaged one) without linking anything to the host system.
  • Cook the definitive toolchain.
  • Cook some other package of one of SliTaz flavors.
  • Create the iso.
  • Burn, boot & enjoy :).

Install the tools

Note: all following commands should be executed as root. You don't have to add the experimental repository if you wish to use the cooking toolchain.

Add the cooking-experimental repository as undigest:

tazpkg add-undigest experimental http://people.slitaz.org/~gokhlayeh/experimental/packages

Give it priority over main repository:

echo experimental > /var/lib/tazpkg/priority

Install the cook tools:

tazpkg get-install tazwok-experimental
tazpkg get-install tazchroot

Cook toolchain

Following command-lines works for a wok at: /home/slitaz/experimental/wok. If you putted the wok elsewhere, you can use the option –SLITAZ_DIR=adress; where address is equivalent to /home/slitaz. This option must be used each time –SLITAZ_VERSION is used. You can also define SLITAZ_VERSION & SLITAZ_DIR globally using /etc/slitaz/slitaz.conf.

Configure the chroot:

tazwok configure-chroot --SLITAZ_VERSION=experimental

If you have at least 1GB RAM free you can put the minimal chroot in RAM speed-up cooking process:

sed 's~chroot_dir=.*~chroot_dir=/tmp/chroot-experimental~' -i /home/slitaz/experimental/tazchroot.conf

All-in-one command to cook the toolchain packages:

tazwok cook-toolchain --SLITAZ_VERSION=experimental

At the end of this operation, the chroot should be removed. If you had modified it's adress before, you have to do this manually :

rm -r /tmp/chroot-experimental

Toolchain package are now ready to be used. They actually are in the packages-incoming repository. If all was cooked fine it's possible to push them to the classical packages directory using :

tazwok check-incoming --SLITAZ_VERSION=experimental

You need to tell to tazpkg that you now have a local version of experimental:

# If you had already defined the experimental repository:
echo "/home/slitaz/experimental/packages" > /var/lib/tazpkg/undigest/experimental/mirror
tazpkg recharge
# Else:
tazpkg add-undigest experimental /home/slitaz/experimental/packages
echo experimental > /var/lib/tazpkg/priority
tazpkg recharge

Recook toolchain packages except core (linux-api-headers/glibc/binutils/gcc) over itself to consolidate it; in fact it's not really needed with actual configuration but it's generally good to do to solve loop dependencies. It warrants consistency of the toolchain before and after an update of non-core toolchain packages. Note that core-toolchain should never be updated this way, but by re-using cook-toolchain script.

tazwok chroot --SLITAZ_VERSION=experimental
tazwok build-depends toolchain-cooklist | sed '1,/^gcc$/d' > /tmp/consolidate.list
tazwok cook-list /tmp/consolidate.list
rm /tmp/consolidate.list

As packages has been re-cooked, you have to update the packages repository once again:

tazwok check-incoming

Still in the chroot for the next step.

Cook packages of a flavor

First you need datas about cooking flavors:

cd /home/slitaz/experimental/flavors
hg clone http://hg.slitaz.org/flavors .

Create chroot and enter into it:

tazwok chroot --SLITAZ_VERSION=experimental

Generate the cooklist for a given flavor. Note: for next, use the choosen flavor name instead of FLAVOR in the command line.

tazwok gen-cooklist --list=/home/slitaz/experimental/flavors/FLAVOR/packages.list > /tmp/FLAVOR.list

This list contains some already cooked packages, remove them:

cat /tmp/FLAVOR.list | while read p; do
	grep -q ^$p$ /home/slitaz/experimental/packages/packages.txt && \
		sed "/^$p$/d" -i /tmp/FLAVOR.list
done

The cooklist is now ready, to create the packages:

tazwok cook-list /tmp/FLAVOR.list

Update packages repository:

tazwok check-incoming

You can repeat theses steps each time you wich to add new packages in your repository.

Still in chroot for the next step.

Create the ISO

Actually tazlito use /home/slitaz/flavors. Create a symbolic link:

ln -s /home/slitaz/experimental/flavors /home/slitaz

Set release as experimental for the future ISO:

cd  /home/slitaz/flavors/FLAVOR
mkdir -p rootfs/etc
echo experimental > rootfs/etc/slitaz-release

Configure you're ISO to use you're local repository:

mkdir -p rootfs/var/lib/tazpkg
echo /home/slitaz/experimental/packages > rootfs/var/lib/tazpkg/mirror

Use tazwok-experimental instead of tazwok and add tazchroot:

sed 's/tazwok/tazwok-experimental/' -i packages.list
echo tazchroot >> packages.list

Pack FLAVOR:

tazlito pack-flavor FLAVOR

Get FLAVOR:

tazlito get-flavor FLAVOR

Generate ISO:

tazlito gen-distro

Save ISO in your home:

mv /home/slitaz/distro/slitaz-FLAVOR.iso /home/slitaz/distro/slitaz-FLAVOR.md5 /home/slitaz/experimental/iso

Exit chroot:

exit
 
en/devnotes/cook-flavor-from-scratch.1295745493.txt.gz · Last modified: 2011/01/23 02:18 by gokhlayeh