Next Previous Contents

12. Installing the rest of the basic system software

The rest of the software that's part of our basic system will be installed in this section. You don't need all the software, but it's recommended to have it.

12.1 Installing E2fsprogs

Installing E2fsprogs

When compiling I'm getting this error: mke2fs.c:142:SCSI_DISK_MAJOR not defined. I solved it the following way:

Please note that I have no idea what this does when you're using a SCSI system, but I can guess not a heck of a lot of good. Since I'm using an IDE system this doesn't harm me. If you're using SCSI you're on your own I'm afraid since I have no idea on how to fix this. Perhaps you don't even get it when using (a) SCSI disk(s).

Creating the checkroot bootscript

We'll create a checkroot bootscript so that whenever we boot our LFS system, the root file system will be checked by fsck.

#!/bin/sh
# Begin /etc/init.d/checkroot
 
echo "Activating swap..."
/sbin/swapon -av
 
if [ -f /fastboot ]
then
  echo "Fast boot, no file system check"
else
  mount -n -o remount,ro /
  if [ $? = 0 ]
  then
    if [ -f /forcecheck ]
    then
      force="-f"
    else
      force=""
    fi
 
    echo "Checking root file system..."
    fsck $force -a /
     
    if [ $? -gt 1 ]
    then
      echo
      echo "fsck failed. Please repair your file system manually by"
      echo "running fsck without the -a option"
      
      echo "Please note that the file system is currently mounted in"
      echo "read-only mode."
      echo "
      echo "I will start sulogin now. CTRL+D will reboot your system."
      /sbin/sulogin
      /reboot -f
    fi
  else
    echo "Cannot check root file system because it is not mounted in"
    echo "read-only mode."
  fi
fi
 
# End /etc/init.d/checkroot

Updating /etc/init.d/umountfs

echo "Deactivating swap..."
/sbin/swapoff -av

Creating proper permissions and creating symlink

12.2 Installing File

12.3 Installing Libtool

12.4 Installing Modutils

12.5 Installing Linux86

12.6 Installing Lilo

Installing Lilo

Configuring Lilo

Copying kernel image files

12.7 Installing DPKG

We don't install the Debian Package manger itself, but a small program that is shipped with this package; the start-stop-daemon program. This program is very useful in boot scripts so we're going to use it.

12.8 Installing Sysklogd

Installing Sysklogd

Configuring Sysklogd

Please note that the white spaces must be tabs and not just hitting the space bar a few times.

#!/bin/sh
# Begin /etc/syslog.conf
 
auth,authpriv.*           /var/log/auth.log
*.*;auth,authpriv.none    /var/log/syslog
daemon.*                  /var/log/daemon.log
kern.*                    /var/log/kern.log
mail.*                    /var/log/mail.log
user.*                    /var/log/user.log
 
mail.info                 /var/log/mail.info
mail.warn                 /var/log/mail.warn
mail.err                  /var/log/mail.err
 
*.=info;*.=notice;*.=warn; \
  auth,authpriv.none; \
  daemon.none             /var/log/messages
 
*.emerg                   *
 
# End /etc/syslog.conf

Creating the Sysklogd bootscript

#!/bin/sh
# Begin /etc/init.d/sysklogd
 
test -f /usr/sbin/klogd || exit 0
test -f /usr/sbin/syslogd || exit 0
 
check_status()
{
  if [ $? = 0 ]
  then
    echo "OK"
  else
    echo "FAILED"
  fi
}
 
case "$1" in
  start)
    echo -n "Starting system log daemon..."
    start-stop-daemon -S -q -o -x /usr/sbin/syslogd -- -m 0
    check_status
 
    echo -n "Starting kernel log daemon..."
    start-stop-daemon -S -q -o -x /usr/sbin/klogd
    check_status
    ;;
 
  stop)
    echo -n "Stopping kernel log daemon..."
    start-stop-daemon -K -q -o -p  /var/run/klogd.pid
    check_status
 
    echo -n "Stopping system log daemon..."
    start-stop-daemon -K -q -o -p /var/run/syslogd.pid
    check_status
    ;;
 
  reload)
    echo -n "Reloading system load daemon configuration file..."
    start-stop-daemon -K -q -o -s 1 -p /var/run/syslogd.pid
    check_status
    ;;
 
  restart)
    echo -n "Stopping kernel log daemon..."
    start-stop-daemon -K -q -o -p /var/run/klogd.pid
    check_status
 
    echo -n "Stopping system log daemon..."
    start-stop-daemon -K -q -o -p /var/run/syslogd.pid
    check_status
 
    sleep 1
 
    echo -n "Starting system log daemon..."
    start-stop-daemon -S -q -o -x /usr/sbin/syslogd -- -m 0
    check_status
 
    echo -n "Starting kernel log daemon..."
    start-stop-daemon -S -q -o -x /usr/sbin/klogd
    check_status
    ;;
 
  *)
    echo Usage: $0 {start|stop|reload|restart}
    exit 1
    ;;
esac
 
# End /etc/init.d/sysklogd

Setting up symlinks and permissions

cd /etc/rc2.d; ln -s ../init.d/sysklogd S03sysklogd
cd ../rc6.d; ln -s ../init.d/sysklogd K90sysklogd
cd ../rc0.d; ln -s ../init.d/sysklogd K90sysklogd

12.9 Installing Groff

12.10 Installing Man-db

12.11 Installing Procps

12.12 Installing Procinfo

12.13 Installing Procmisc

12.14 Installing Shadow Password

This package contains the utilities to modify user's passwords, add new users/groups, delete users/groups and more. I'm not going to explain to you what 'password shadowing' means. You can read all about that in the doc/HOWTO file. There's one thing you should keep in mind, if you decide to use shadow support, that programs that need to verify passwords (examples are xdm, ftp daemons, pop3d, etc) need to be 'shadow-compliant', eg. they need to be able to work with shadowed passwords.

If you decide you don't want to use shadowed passwords (after you're read the doc/HOWTO document), you still use this archive since the utilities in this archive are also used on system which have shadowed passwords disabled. You can read all about this in the HOWTO. Also note that you can switch between shadow and non-shadow at any point you want.

Now is a very good moment to read section #5 of the doc/HOWTO file. You can read how you can test if shadowing works and if not, how to disable it. If it doesn't work and you haven't tested it, you'll end up with an unusable system after you logout of all your consoles, since you won't be able to login anymore. You can easily fix this by passing the init=/sbin/sulogin parameter to the kernel, unpack the util-linux archive, go to the login-utils directory, build the login program and replace the /bin/login by the one in the util-linux package. Things are never hopelessly messed up, but you can avoid a hassle by testing properly and reading manuals ;)


Next Previous Contents