Howto build SLINKY from scratch

Diagram of SLINKY's system architecture
Slinky sysarch (pdf)

Abstract

SLINKY ist der Versuch, mit minimalen Mitteln eine ausgewachsene LINUX Distribution, nämlich FEDORA, auch auf solchen PCs installieren zu können, auf denen der eigentliche Installer ANACONDA wegen zu geringer Systemrecourcen (Memory, CPU-Type) nicht läuft, obwohl das Gerät ansonsten durchaus in der Lage wäre, LINUX zu betreiben. SLINKY ist also ein Installer für FEDORA und hierin liegt auch seine Besonderheit. Gelingt es, FEDORA nicht nur zu installieren, sondern anschliessend auch zu booten, stehen prinzipiell alle Möglichkeiten von FEDORA zur Verfügung, insbesondere die Installation weiterer rpm-Pakete, nun aber bereits unter der Kontrolle FEDORAs selbst.

Abgesehen von seiner Funktion als Installer, kann SLINKY aber auch als einfache RESCUE-Floppy angesehen werden. Der wesentliche Aspekt dieser Facette von SLINKY ist ein aktueller LINUX-2.6-Kernel, mit all seinen Möglichkeiten, das System durch die Sicht des /proc-Filesystems zu erforschen. Für den zur Installation verwendeten Kernel stehen alle Module in kompilierter Form als iso9660-Image zur Verfügung.

Auf Grund der einfachen, geradlinigen Struktur, eignet sich SLINKY aber auch sehr gut als Demonstrations- und Lernobjekt, um unmittelbar zu sehen, wie die Installtion eines aktuellen UNIX-Systems ablaufen kann, welche Komponenten daran beteiligt sind und wie diese zusammenwirken.

Der Slinky Installer wurde ursprünglich im Zuge des RULE-Projekes erstellt.

  1. Download Slinky Boot Floppy

    The easiest way to get in touch with SLINKY is by using the SLINKY Boot Floppy. It is of no harm to try to boot with it and see what happens. Try it. You will be warned before any sereous action to take place like partitioning or formatting a disk. If you are actually going to install FEDORA with SLINKY you also need at least CD1 from FEDORA Core4 from the FEDORA Download Server or its mirrors. The name of the file is: FC4-i386-disc1.iso.

    1. download_boot_floppy

      You can download the floppy image from http://www.fzk.at/SLINKY/slinky-0.5.03-disk1.img.

    2. boot_floppy

      To create the real Slinky Boot Floppy use

      # dd if=slinky-0.5.03-disk1.img of=/dev/fd0

      to copy the image to a 1.44MB 3.5in. floppy. Under a none UNIX-like operating system you need a tool like rawrite to put the image to the floppy. The FEDORA-CDs provide this utility in the /dosutil directory.

  2. Download Slinky Module Image

    If you have special hardware - and nearly everything exept a simple IDE-based x86-system with floppy, harddisk and CD-ROM might be special - you can use these modules to get SLINKY working with your hardware. Using modules is not that hard but as there are too many modules to fit on a single floppy you have to select the ones you need. If at least the CD-ROM is known by the SLINKY-install-kernel you can spend a blank CD and have them at hand all at once.

    1. download_module_img

      You can download the module image from http://www.fzk.at/SLINKY/slinky-0.5.03-modules.img.bz2.

    2. module_img

      Now that you downloaded the module image, you can uncompress it with the utility bzip2, loopback mount it and inspect its contents. This can be done by:

      bzip2 -dc slinky-0.5.03-modules.img.bz2
      mount -t iso9660 -o loop slinky-0.5.03-modules.img /mnt/loop
  3. Create Module Floppy

    1. kernel_modules

      If you already have created the boot-kernel for Slinky creating the kernel-modules is easy:

      $ cd /usr/src/linux
      $ su
      # make modules
      # make modules_install
      # exit
      		  
      If everything worked fine this should have created /lib/modules/2.6.9 the kernel modules.

    2. customize_mod_modules

      I cannot explain in short and in detail how to create a floppy with appropriate modules from all the available modules.

      In very short:

      • loopback mount the iso9660 module image
      • a floppy with an ext2 fileystem
      • copy any needed modules from the module image to the floppy but retain paths

      If you cannot manage to get it to work please subscribe the RULE-Mailing List and ask there.

    3. modules_floppy

      If you customized your floppy with modules you can now mount it under SLINKY at the mountpoint /lib/modules. Then the utility modprobe can load them, but you have to know theire names:

      • rather at the beginning of the installation with SLINKY select option: sh_oldroot to get a shell in the old root context (means /-root directory of SLINKY itself)
      • mount the floppy at directory /lib/modules:
        mount -t ext2 /dev/fd0 /lib/modules
      • alternative: mount the the CD with all the modules:
        mount -t iso9660 /dev/cdrom /lib/modules
      • then load the module with:
        modprobe _modulename_you_want_to_load_
  4. Create Slinky Boot Floppy from Tarball

    If you want to modify the Slinky Boot Floppy you can download the SLINKY devel-tarball, add your changes and create the boot floppy or a bootable CD from it. If you even want to change the basic tools like busybox or use another boot kernel, you can compile these components yourself and replace the parts from the devel-tar. As SLINKY is protected by the GPL it is necessary to provide any used source-code and instructions how to build it. But the sources of the LINUX-kernel and other tools are far too big to provide them from a RULE-server. We can only tell which version of sourcecode we used and point you to other download servers. But we provide any config-Files to compile these parts of SLINKY.

    1. linux_source

      Location: .config for LINUX-kernel 2.6.9
      The LINUX-sources are ready for download from The Linux Kernel Archives. You would typically use a download server listed in The Linux Kernel Archive Mirror System. In order to compile the kernel do the following:

      $ cd /usr/src
      $ ... download the kernel sources ...
      $ bzip2 -dc linux-2.6.9.tar.bz2 | tar -xvf -
      $ ln -sf linux-2.6.9 linux
      $ cd linux
      $ ... download the Slinky .config-file to this directory ...
      $ make oldconfig
      $ make bzImage
      
      If everything worked fine this should have created /usr/src/linux/arch/i386/boot/bzImage the LINUX-kernel. To use it with Slinky copy this kernel to your local copy of the devel-tree:
      $ su
      # cp /usr/src/linux/arch/i386/boot/bzImage _devel-tree_/base_files/vmlinuz_rule
      # _devel-tree_/makedisk.sh   ... this creates the Slinky boot floppy ...
      # exit
      	      

    2. busybox_source

    3. dialog_source

    4. uClibc_source

    5. uClibc

    6. devel_tarball

      Location: Develop tarball v0.5.03
      If you want to create the Slinky boot floppy yourself you need the archive containing the develop files.

      $ cd ~
      $ mkdir SLINKY_devel
      $ cd SLINKY_devel
      $ ... download the archive ...
      $ su
      # bzip2 -dc slinky-devel-0.5.03.bz2 | tar -xvf -
      # exit
      	      

    7. Create Slinky Boot Floppy

      1. boot_kernel

        Location: devel-tree/base_files/vmlinuz-rule
        The boot-kernel is primaly configured to be small enough to fit on the boot-floppy, but also to be able to use IDE discs and CDs, some network cards and NFS. You find the .config at to_be_filled. The running kernel shows its configuration in the file /proc/config.gz. Use

        gzip -dc /proc/config.gz
        to list the contents.

      2. boot_msg_files

        Location: devel-tree/base_files
        Before booting the kernel some screens of text show informations about SLINKY and what's going on.

      3. busybox

        Location: devel-tree/filesystem/bin/busybox

      4. cardmgr

        This is an old binary. By now I havn't got neither the source nor the config file for this binary.

      5. dialog

      6. mke2fs

        This is an old binary. By now I havn't got neither the source nor the config file for this binary.

      7. rootfs

        Location: devel-tree/filesystem
        This is the root filesystem as it is available while installing with SLINKY. Thats the oldrood context. It is totally placed in a ram-disk.

      8. syslinux_config

        Location: devel-tree/base_files/syslinux.cfg

      9. syslinux

  5. Provide FCx Install Media

    In order to install FEDORA Core 4 on your PC you need the rpm-packages contained on FC4 install media.

    1. FCx_install_media

      You can download the CD iso-images from the FEDORA Download Server or its mirrors. The files are named: FC4-i386-disc[1234].iso. You can inspect the contents of these CD after downloding by loopback-mounting the iso-images:

      mount -t iso9660 -o loop _cd_device_ _mountpoint_
      All the rpms are then located under the following PATH: _mountpoint_/Fedora/RPMS

    2. make_accessible

      SLINKY provides several ways to access the rpm-packages from the CD iso-images. Choose your appropriate install-methode.

           I You get | Source on harddisk | Source on CD I
           I source  |    in        |              I
           I from:   | Fedora |   rpms**) |   Fedora     I
           I         |  iso*) |           |     iso      I
           I---------------------------------------------I
           I local   |    iso |      rpms |    cdrom     I
           I---------|--------+-----------I--------------I
           I nfs     | nfsiso |   nfsrpms I
           I---------|--------+-----------I
           I ftp     |   n/a  |   ftprpms I
           I------------------------------I
           *) ISOs are found, if placed in the top-level-directory of
              a local harddisk-partion or nfs-export-directory.
           **)RPMs are found, if placed in the $distri/RPMS directory.
      	      

      Install methods when the rpms are locally available on the installation PC.

      • cdrom This is by far the best tested/working method. With this method you burn the FC4 iso-images to CD. This can be used, if SLINKY can detect the CD-drive of your installation PC.
      • iso This method is similar to cdrom. In contrast to cdrom-method you dont burn CDs but use the iso-images directly. This can be used if the installation PC has enough disk-space where you can provide the images. You could copy the images at the download-PC to a harddisk and install this disk in the installation-PC. Another usage of this method is when you repeatedly try different installations and dont want to change CDs. Then copy the CDs to a disk-partition. Installing from disk is also usually faster than from CD.
      • rpms This method is similar to iso, but you have extracted the rpms in advance from the iso-images. This method could be used, if you know exactly which rpms are needed and don't have space for 4 CDs on your harddisk.

      Install methods when the rpms are available in the LAN via NFS.

      • nfsiso Like method iso but access is via NFS.
      • nfsrpms Like method rpms but access is via NFS.

      Install methods when the rpms are available in the LAN via FTP.

      • ftpiso This theoretical method is not available, because the whole iso-image had to be copied over the LAN before installing the first package. This has many disadvantages.
      • ftprpms Like method rpms but access is via FTP.

    3. mount_installsource

      This function mounts the image if you install from an image.

  6. Install FCx with Slinky

    The process of installing FEDORA is devided into many steps. Usually they are performed in a predefined order one after one. But whenever the Slinky-menue prompts you for the next already preselected task, you can change the order of preocessing by selecting another one. This can be usefull if you performed some task giving certain information but changed your mind afterwards. Then you don't have to start over again from booting the Slinky boot floppy, which is very time consuming, but simply can select this task and repeat it. Some tasks like selecting the keymap can be repeated at any time without the need to also repeat any later task but others like partitioning the harddisk cannot.

    The two tasks sh_newroot and sh_oldroot can be selected at any time to get a shell in the new (that's the new installed /-root directory) or the old (that's Slinky's /-root directory) filecontext. The old filecontext is marked whith this file /_slinky_install_partition_ to make clear which is what.

    The installer has activated 2 virtual ttys which can be switched by typing the usual <alt>-<F2> to get to the second tty and <alt>-<F1> to get back to the first tty (that's where the installer is running).

    1. activate_swap

      This function activates the swap-partition for the installation. Usually you have created a swap-partition on a harddisk and can use it now. If your PC has enough memory you can skip this action.

    2. base_install

    3. boot

    4. boot_floppy

    5. bootstrap_rpm

      Former versions of Slinky provided a second floppy mainly containing a rather big rpm-binary to perform the actual installation of the rpm-archives. But busybox already contains a minimal rpm-binary which can be used to install the full featured rpm contained in the FEDORA distribution. Ignore the error-messages during this bootstrap.

    6. config_new

    7. do_partitioning

      We use the busybox fdisk function to partition the harddisk(s). There is nothing horrible about partitiong a harddisk, it's really a simple task. But make shure to not re-partition just a disk containing data that you still need. Usually you will not be able to access old data after re-parttioning.

    8. format_mount

    9. grub_install

    10. in_newroot

    11. initial_reboot

    12. mk_boot_floppy

    13. modules_floppy

    14. mount_installsource

    15. prepare_newroot

    16. run_installer

    17. select_distri

    18. select_fstype

      Slinky boot floppy supports 2 filesystems:

      • ext2 the traditional LINUX filesystem
      • ext3 it's successor, with journaling functionality, the default option
    19. select_instdev

    20. select_keymap

      Slinky boot floppy supports 4 keymaps:

      • us for QWERTY-keyboards the default option
      • german for QWERTZ with german umlauts
      • french for AZERTY
      • italien for QWERTZ with italien characters

      Here you find a description to add the mapping you are used to: english deutsch.

    21. select_method

    22. setup

    23. sh_newroot

    24. sh_oldroot

    25. umount_installsource

  7. The new system

    1. base_install

    2. bootable_Fedora

    3. initial_boot

    4. configure_fedora

    5. install_more_software


Franz Zahaurek
Last modified: Sun Jan 8 21:24:19 CET 2006