Quick guide to start cooking SliTaz packages

slitazSlitaz is a Linux mini distro with an ISO of around 30MB. Slitaz development has been in a standstill since the release of version 4.0 and I got involved for a while to fix an issue with disk detection and configure and upgrade the distro to a newer Linux kernel. Creating a development setup and cooking packages for (and on) SliTaz is quite easy. The following steps and instructions are meant to be a quick no-nonsense guide to get any newbie start cooking a package within an hour.

Install SliTaz on a VM

  1. Download the latest stable version of SliTaz from here. Download the slitaz-x.x-core.iso.
  2. Create a new VM with around 8GB disk, 2GB RAM and OS Linux (Version: Other Linux 2.6.x kernel).
  3. Attach the ISO and boot from CDROM. Choose the Live version. Follow the official installation guide to install SliTaz on your VM.
  4. Once the installation is over, boot into SliTaz [currently default username: tux, password: no password set, just press enter].

Set up your SliTaz development environment

  1. Install the development package and it’s dependencies with the following command:
    # tazpkg -gi tazdev
  2. Create the isolated chroot environment for development:
    # tazdev -gc
  3. su to root (password: root)
  4. chroot to the development environment:
    # tazdev chroot
  5. Install the utilities needed to start cooking:
    # tazpkg recharge
    # tazpkg -gi cookutils
  6. Clone the wok repository or create one for personal use:
    # cook setup --wok //clone the wok to build official packages
    OR
    # cook setup //create a wok from scratch for personal use
  7. cd to /home/slitaz and cook the slitaz-doc package as a start:
    # cd /home/slitaz
    # cooker pkg slitaz-doc

    You will find the package created under the /home/slitaz/packages directory.

  8. The downloaded source packages and source code for the packages will be present under the src and wok directories. cd around to get accustomed to various directories and files.

Instructions to compile new or modified kernel

  1. The package you first need to cook is linux and it is present under /home/slitaz/wok. To change any configuration, modify the following files from /home/slitaz or use our own config file:
    wok/linux/stuff/linux-slitaz.config
    wok/linux/stuff/linux-slitaz.config64
  2. If you are trying to compile a newer kernel, you have to update the references in the receipt files. Run the following under wok directory first:
    # cd /home/slitaz/wok
    # find . -type f -name receipt -exec sed -i 's/3.2.40/3.2.48/g' {} +

    Here I am trying to update all references to kernel version 3.2.40 to 3.2.48

  3. To compile a newer kernel:
    # cd /home/slitaz
    # cp -vf my_config wok/linux/source/linux-version/.config
    //OR (to use the existing config)
    //# cp -vf wok/linux/stuff/linux-slitaz.config wok/linux/source/linux-version/.config
    # cd wok/linux/source/linux-version
    # make oldconfig
    //answer the questions asked for missing config options
    # cp -vf .config wok/linux/stuff/linux-slitaz.config
    # cp -vf .config wok/linux/stuff/linux-slitaz.config64
  4. cook the package linux:
    # cooker pkg linux-slitaz
  5. If the build fails complaining about any missing configuration options, set that in linux-slitaz.config and repeat steps 3 and 4.
    Reference for configuration options from Ubuntu Raring:
    http://kernel.ubuntu.com/~kernel-ppa/configs/raring/i386-config.flavour.generic
  6. Once the linux package is built, you need to cook other packages that depend on the modules built with the linux package. Run the following under wok:
    # for i in $(grep 'WANTED="linux"' */receipt | \
    grep -v 64 | cut -d \/ -f 1); do cooker pkg $i; done

Useful links

Comment