Slind distribution ================== Slind is a small distribution targeted at embedded applications, which main feature is its close ties to Debian and Debian package management. Slind consists of two main parts: host part, which is basically a set of toolchains produced out of standard Debian gcc source packages for different architectures and target part, which is a debootstrappable set of packages compiled with all of the toolchains available from the host part. Also included is a snapshot of the slind-installer, the installation system for the Slind (or, rather, any Debian-style distribution), aimed at embedded targets. Slind-installer is currently at the development stage. Host environment ================ Host environment consists of a dozen Debian packages that may be installed on a Debian host ("sarge" and up) and may be used to cross-compile target binaries and packages. Cross-compilation of the packages is performed using the tool called "dpkg-cross", which is a set of perl wrappers around standard dpkg scripts and binaries like dpkg-buildpackage and dpkg-architecture. Dpkg-cross is also used to manage an installation of a set of target libraries on a cross-compilation host (under /usr/). Please note that currently only dpkg-cross version included in Slind would work with Slind toolchains and packages (current Debian unstable has newer version, and our changes are not yet merged). Please refer to dpkg-cross manpages and documentation for details, we will only describe basics of its usage here. To cross-compile a package for a certain architecture, add `-a' to dpkg-buildpackage options: $ dpkg-buildpackage -auclibc-powerpc -rfakeroot (refer to doc/README.toolchains for complete description of architectures supported by Slind toolchains). If you are lucky and have installed all of the build-depends, you should get a uclibc-powerpc Debian package afterwards. Note that in most cases (except probably the simplest ones), you will have to introduce some changes to debian/rules for the package to cross-compile cleanly -- for example, pass "--host" and "--build" to `configure' call like this: .. # Somewhere at the top of rules DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) .. configure: .. configure \ --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \ .. .. Have a look at Slind target packages rules files for some examples. If you need to install some target library on the host (a build dependency, for example), use `dpkg-cross' tool: $ dpkg-cross -a -i _.deb `dpkg-cross' will re-package the target package, taking out all useful files like libraries and includes, putting them under /usr/, building all arch debian package and installing it. If you just wish to get the .deb without installation, use -b instead of -i. 'contrib' subdirectory on the CD includes sample configuration files for pbuilder tool, to cross-compile packages in a clean chroot tree like this: $ sudo pbuilder create --distribution sarge $ sudo pbuilder build --debbuildopts -a ./.dsc Target environment ================== Slind contains two different types of target base systems: small busybox-based one (around 5 megabytes on target) and a slightly bigger coreutils/sysvinit one (close to what one would expect from a regular Linux distribution, around 10 megabytes on target). Both environments include dpkg and apt-get, so targets may be updated and package managed as easy as a regular Debian machine. Base type is chosen on the installation by passing a `variant' parameter to debootstrap -- more on this in section "Target installation". In addition to two types of base systems, they are cross-compiled against two different C libraries: uclibc and glibc. Target installation =================== Since full cross-debootstrap is not possible, target installation is performed on the target itself. Initially, target is being brought up using NFS-mounted root (provided as a part of slind-installer), and debootstrap is run on target itself by hands directly or via slind-installer. Target Installation using `debootstrap' ======================================= Set up NFS server/dhcp/tftp/whatever else is needed to get the target up and mount its root from NFS. Slind does not (yet) include any kernels, so its up to you to find and cross-compile the kernel for your target. Unpack slind-installer//slind-installer-nfsroot-.tar.gz somewhere (as root, as this would create device nodes, will be fixed in future releases), NFS-export it and mount as root directory on your target. 1. Login with `root' (empty password). 2. Create /etc/resolv.conf with your nameserver parameters. 3. Either mount an NFS-exported Slind CD with target pool, or set a web/ftp server and put target packages on it. 4. Run debootstrap: a) For busybox variant # debootstrap --arch suffolk b) For coreutils/sysvinit variant # debootstrap --arch --variant=gnu suffolk is either `uclibc-' for uclibc-compiled system or `' for glibc-compiled system (check doc/README.toolchains for details) is the directory under which you would like to install. is "file:///" or "[http|ftp]://" URL of the target pool. 5. Edit /etc/inittab serial getty line to match your port settings. 6. Pack the debootstrapped tree with your filesystem image creation tool of choice, flash/write onto target and enjoy. Target installation using `slind-installer' =========================================== 1. Repeat steps 0 and 1 from the previous section. 2. Run the installer server part with # /usr/share/dfuibe_lua/main.lua option.booted_from_install_media=true 3. Run the installer frontend binary (you can build yours with "make frontend" in installer sources top directory) from the CD: slind-installer/frontend/i386/dfuife_curses-static -r :9999 4. Answer the questions and fill in forms. Limitations: Only ext2 filesystem type is available on the partitioning stage. If you like, you can convert the image to JFFS2 later on "Configure system" step. Please, make sure that the kernel you are using for target contains support for loop devices. Unfortunately, no detailed documentation on the installer is available yet. If you want to hack on the installer, check its source code and Makefiles: they are pretty easy. Installer itself is written in lua language, and forked off from http://bsdinstaller.org source code. Submit patches and ideas to me, Vartan Khachaturov . Enjoy! Feel free to send all bug reports, patches, flames and blames to yours truly, The Slind team: Vartan Khachaturov Alexander Shishkin