SLIM - Source Linux Installation Manager

Installing a New SLIM System

The following instructions are taken from the "Installing base system.txt" file included in the SLIM download.

Instructions on Installing a New Base GNU/Linux System Using SLIM
-----------------------------------------------------------------

To install a new, shiny DIY-Linux/LFS system, follow this simple guide.

These commands are written for someone who is familiar with the DIY-Linux/LFS
installation procedure.  If some of these commands are foreign to you or you
wonder what they are for, then perhaps this type of system is not for you.

Also, SLIM is NOT designed to install the initial tools as an unprivileged
user.  It is designed to do it as root.  Why?  Because after screwing up
many systems, I decided to always do the tools installation from a bootable
CD that I can't screw up (hence the Live CD).  I came up with this approach
before the LFS/DIY-Linux stuff about not building as root came out. :-)  If you
want to try to install this as root with a normal distro, I'm not responsible
for screwing up your system.  I would much rather have you use the Live CD if
possible.  If you can figure out how to do it as an unprivileged user, then go
right ahead.

Also, the commands here assume your destination is /mnt/slim and that the
toolchain will go in /mnt/slim/toolchain.  I know this is not the convention of
DIY-Linux.  This is how I do it myself, and isn't that the rule for real
Do-It-YourSelf? If you decide to install somewhere else, you'll have to modify
the toolchain_adjustments package to suit your new destination.

There is experimental support for x86_64 builds.  Please note this support is
*EXPERIMENTAL* and will probably cause a lot of troubles.  Two main problems
exist in the current implementation:

1. Some packages don't interpret libdir properly and will install libraries in
   /usr/lib instead of /usr/lib64.  By the same token, some packages only look
   for libraries in /usr/lib and not /usr/lib64.  These packages have to be told
   specifically where to install/look for files.

2. The only packages that install 32-bit libraries are Glibc and GCC.  If you
   need a particular library (and its dependencies) in 32-bit format, you are
   out of luck.  Basically this system is almost a pure 64-bit with limited
   32-bit compatibility.

If you are going to create a 64-bit system, please make sure you boot with a
64-bit kernel.  Otherwise you won't get very far with the build.

Enough stuff.  Knock yourself out.


1.  Mount your destination partition (if any) in /mnt/slim.  Mount any other
file system that will tied to the new system (like separte /var or /home
partitions) if necessary.

2.  In your destination, create the var/local directory:

mkdir -p /mnt/slim/var/local

3.  Donwload and extract the latest SLIM package into the destinations's
var/local.

cd /mnt/slim/var/local
wget http://slim.mypals.org/slim/slim-latest.tar.bz2
tar -xjf /path/to/slim/source/slim-latest.tar.bz2
rm slim-latest.tar.bz2

NOTE: If you are using the SLIM Live CD, you can run slim/bin/new-install-setup
and it will do steps 4 and 5 for you with the following oddities:

    - It will install the toolchain in /mnt/slim/var/toolchain with a symlink
      in /mnt/slim/toolchain (to place the toolchain in /var and utilize the
	  temporary nature of /var if it is on a separate partition).
    - It will make a /mnt/slim/var/local/src and link /mnt/slim/usr/src to it.
      This makes it possible to find the kernel source in /usr/src/linux but
      have it installed in /var instead, right next to SLIM (for the same reason
	  abvoe).

4.  Create the /mnt/slim/toolchain directory and link it in your host distro.
(If you are using a separate partition for /var, you can create the directory
as /mnt/slim/var/local/toolchain then make a link to it as /mnt/slim/toolchain
and one in /toolchain.  This will build the temp-tools phase in the new /var
and keep the new root (/) pretty much unused.  As the final tools are installed,
they will begin to be stored in the file system they will go in in the order
in which they are built, providing a better (?) layout on the partition,
(hopefully providing a speed inprovement.)

mkdir -p /mnt/slim/toolchain
ln -sf /mnt/slim/toolchain /toolchain

5.  Make a link to SLIM in your host's /var/local

ln -sf /mnt/slim/var/local/slim /var/local/slim

6.  Copy the sample configuration file and edit it to suit your needs:

cp slim/conf/config.sample slim/conf/config

    If you are building a 64-bit system, make sure to change the $BUILD_TYPE
	variable to x86_64.

NOTE: It is now possible to use a pre-compiled toolchain and save yourself an
hour or so of compile time.  If you want to use the pre-compiled toolchain, skip
step 7 and go to steps 7a and instead.  If you want to "do it right" and
build your own toolchain, go to step 7 and ignore step 7a.

7.  Install the toolchain:

/var/local/slim/bin/slim install toolchain

    OR (for 64-bit builds)

/var/local/slim/bin/slim install toolchain_64

7a. If you prefer to use the pre-compiled toolchain, install it and prepare it
for use:

/var/local/slim/bin/slim install toolchain_adjustments:prebuilt

8.  Mount the following pseudo filesystems:

cd /mnt/slim
for fs in dev proc sys; do mount --bind /$fs $fs; done
mount devpts dev/pts -t devpts

9.  Enter the chroot environment by typing the following junk or running /var/local/slim/bin/chroot-toolchain:

/toolchain/bin/chroot /mnt/slim \
  /toolchain/bin/env -i \
  HOME=/root \
  PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/toolchain/bin \
  TERM=${TERM} \
  PS1='\u (chroot):\w\$ ' \
  /toolchain/bin/bash --login +h

10. Install the base system:

slim install base_system

    OR (for 64-bit builds)

slim install base_system_64

11. At this stage I like to exit the chroot environment and chroot to the new
system again making sure to remove all toolchain references:

chroot /mnt/slim /bin/bash

12. Set the hostname for you machine by editing /etc/HOSTNAME.

13. Configure GRUB to your needs:

grub
root (hd?,?)
setup (hd?[,?])
quit

14. Modify the grub config file (/etc/grub/menu.lst) to suit your
configuration and add your new kernel to it.

15. Set up your partition information in /etc/fstab.

16. Set up your time zone:

ln -sf ../usr/share/zoneinfo/`tzselect` /etc/localtime

17. Edit /etc/sysconfig/hw_clock, /etc/sysconfig/* and any other files you think
you may need to modify.

18. Create the root password:

passwd

Note: if you get a "Module is unknown" error or any other strange error (such as
permission denied, etc.), you will need to reinstall linux-pam
(slim install linux-pam) to resolve the issue.

19. Go to /usr/src/linux and configure your kernel using whatever method you'd
like.  Since SLIM is rather picky about what the kernel needs, you can start a
new kernel configuration by using the newest kernel configuration found in
http://slim.mypals.org/slim/.  (Download and save as .config in /usr/src/linux
and run make oldconfig to make sure it is up to speed to the kernel you are
using. Then use make menuconfig or whatever you like.  Note that this
configuration file is meant for VMware with very little hardware support.  Make
sure you select all your appropriate hardware even if using VMware.)

20. Build and install the kernel:

slim install kernel

21. Install any disk or network drivers that are not part of the kernel.  If you
can't mount your partitions or reach the network, SLIM will be pretty useless.

22. Exit the chroot environment, unmount dev/pts, dev, proc, sys, and /mnt/slim
and any other partitions mounted somewhere on /mnt/slim.

exit
umount dev/pts dev proc sys ...
cd
umount /mnt/slim

23. Reboot to your new system.


SLIM is capable of more than just installing a base system.  Run "slim" with no
arguments for a list of options or "slim packages" for a list of packages it can
install.  For example, to install Xorg, you can do

	slim install xorg

To install KDE you can issue

	slim install kde

SLIM will automatically calculate dependencies and ask you about optional
features for a package.

[NOTE: due to a bug in the depedency calculator and the large amount of
packages required for Xorg, please install Xorg first, then any other package
manager you need.  Otherwise SLIM will get bogged down by the sheer number of
Xorg packages that it will not be very responsive.]

You can also update your system by downloading the latest version of SLIM and
updating any old packages by running:

	slim slim-upgrade
	slim update

SLIM will automatically find any outdated packages and update them.  You can
also optionally specify a list of packages to update.

To see if a package is installed, run:

	slim stauts [package name]

Enjoy!  Again, SLIM comes with no warranty.  Use at your own risk.
Unfortunately, I am not in a position to keep this up-to-date too often.  So
look at the package definitions, use the _default temple and feel free to
maintain your own package repository.