P06004: Air Surveillance Platform for CIS
/public/

Lynx Bootstrap

Table of Contents

This is a procedure for a "first boot" of a VersaLogic Lynx PC/104+ board.

Generating a Minimal Filesystem

If using a standard install tarball, skip directly to Copying a Minimal System

From a system that is running some OS that can interface with a CF disk (likely through a USB-CF dongle), partition the disk, and create ext3 filesystems:

  1. Connect the CF disk to the host system (we assume that the device created for this disk is /dev/sda)
  2. Partition the disk as a single, bootable partition (using a program such as cfdisk in Debian)
  3. Create an ext3 filesystem (using the program mkfs.ext3 in Debian)

Installing a Minimal System

The simplest way to install a base Debian system onto a CF disk is to use an existing Debian system, the debootstrap program, and a chroot host.

The installation procedure is (as the host system's root user):

  1. Mount the CF disk to a temporary location:
    mount /dev/sda1 /mnt
    
  2. Clear out the partition, if necessary:
    rm -rf /mnt/*
    
  3. Install a base "Sarge" system onto the empty partition:
    debootstrap sarge /mnt
    
  4. Copy the list of desired packages (eg. chosing the minimal debian install set) into the target's fresh install:
     cp <file> /mnt/root/pkg_list
    
  5. chroot into the fresh install, and apply the package list:
    chroot /mnt
    dpkg --set-selections < /root/pkg_list
    dselect
    
    From within the dselect program, select the "Install packages" option. The package selection will only be applied from within a package manager such as dselect or aptitude.

Once This minimal system is prepared, you must prepare to boot the newly-installed system.

Setting-up Base System

Here we assume the target disk is /dev/sda mounted on /mnt
  1. Enter the chroot environment:
    chroot /mnt
    
  2. Edit the file /etc/fstab to include the lines
    /dev/hda1 / ext3 defaults 0 0
    proc /proc proc defaults 0 0
    
  3. After installing the grub package with APT
    1. Edit the file /boot/grub/device.map to contain only the line
      (hd0) /dev/hda
      
      This allows GRUB to be used once the target system is booting on its own.
    2. Edit the file /boot/grub/menu.lst to include the lines
      serial --unit=1 --speed=9600
      terminal serial
      
      and to change the line containing the "kopt" to
      # kopt = root=/dev/hda1 ro console=ttyS1,9600
      
    3. Run update-grub to effect any changes made
  4. Uncomment the line containing "ttyS1" in the file /etc/inittab if serial login is disired (it is recommended).
  5. Change the line containing "ttyS0" to "ttyS1" in /etc/securetty to allow root login on the serial terminal.

Installing a Stock Kernel Image

Here we assume the target disk is /dev/sda mounted on /mnt
  1. The proc filesystem must be mounted in the target:
    mount -t proc none /mnt/proc
    
  2. Enter the chroot environment:
    chroot /mnt
    
  3. Allow kernels to set RAMdisk images by editing /etc/kernel-img.conf to include the line:
    do_initrd = Yes
    
  4. Install the RAMdisk tools:
    apt-get install initrd-tools
    
  5. Setup the RAMdisk tools by editing /etc/mkinitrd/mkinitrd.conf to have the "ROOT" option set as:
    ROOT=/dev/sda1
    
    . This is necessary because the kernel will be installed from a chroot environment, not natively.
  6. Install the desired kernel image; eg.
    apt-get install kernel-image-2.6.8-3-386
    

Copying a Minimal System

To copy a given tarball (BZ2 compressed tar file) of a filesytem image, follow the steps:

  1. Mount the target disk:
    mount /dev/sda1 /mnt
    
  2. Untar the files into the disk:
    tar xjf <tarfile> /mnt
    

Once the files are copied, the system is 'installed'. If package changes are desired, simply chroot into the target's root directory and perform any desired changes.

Preparing to Boot

Having the filesystem prepared and a minimal system installed is not enough to boot the target. First the bootloader must be installed into the MBR of the CF disk, and then the Lynx's BIOS must be configured to boot from the disk.

Installing the Bootloader

Assuming GRUB is the desired bootloader, installing it using a host system that itself has grub available is a simple task of mounting the target disk and running the command:

grub-install --no-floppy --recheck --root-directory=/mnt /dev/sda
This command should print a list of the available (writable) drives on the host systema and should result in the CF disk's MBR being written.

Configure BIOS

The default Lynx BIOS should boot the CF disk properly, but it may be advantageous to configure it to disable some hardware such as:

System Administration

For an online manual page directory, refer to Debian manpage index where you can read HTML versions of all Debian manual pages.

The Debian project's package listing site allows searching of all official packages by name or keyword. The Debian bug tracker allows viewing of existing bugs and directions for how to submit new bugs.