Getting Started with Runnix

What is Runnix?

Runnix is a new boot loader system which will be used on Astlinux 0.5.0 and greater.

Runnix is a kexec/syslinux based loader for booting linux systems. It supports a wide range of unique features and can be easily customized and extended. Automatic updates (even over a network), image verification, and failover are all supported.

Runnix uses syslinux to load a basic linux environment which can do several things, but eventually loads the target operating system.

Why Runnix?

You may be asking "Why would I want to use Runnix?". Here's a brief list:

  • Never have to remove the Compact Flash card to load new images, just add them to the 'os' directory.
  • Very flexible design allows you to store multiple images in the 'os' directory, then specify which version to load using the 'ver' file.
  • Ability to load new images under Windows since the os itself is stored on a FAT16 partition
  • Makes it easier to keep the 'key disk' and unionfs partitions on the same device as the os without worrying about removing either when replacing the Astlinux version currently installed. (the old process involved writing out the image using 'dd' which did replace the partition image on the CF and would likely remove the key disk if it was stored on the same CF

A flow chart attempting to explain the process is available here: http://www.djhsolutions.com/images/astlinux-runnix-boot-process.png

Installing Runnix

Alternative Method (faster/easier)

Download one of the two runnix images from here: http://www.djhsolutions.com/astlinux . The runnix.img.gz file will work on target devices which have a monitor and keyboard attached. The runnix-serial.img.gz are intended for devices for devices with a serial port connection for the console.

Execute the following:

gunzip -c runnix-serial.img.gz  | dd of=/dev/yourdevice bs=16k

Where runnix-serial.img would be replaced with runnix.img for non-serial target devices and /dev/yourdevice is the device name of your target media (/dev/sdX in many CF readers). You could also use the physwrite utility in Windows. (if you use physwrite, you must gunzip the image first)

The images were built for 1GB CF,but only contain useful information on the first 128MB (so there will be a harmless error message if using a smaller CF device).

Your CF is now ready to install Astlinux-XX.run files into the 'os' directory of the first partition on this CF.

 

Full Method

Download Runnix from http://sourceforge.net/projects/runnix/ . Extract the files into a temporary location on your development system's hard drive.

 

Create a fat 16 filesystem on the target device. Usually this will be a compact flash device, but this can also be a full blown hard drive.

fdisk -l /dev/yourdrive

verify that your filesystem Id is 6 and the System is FAT16 and that the first partition is bootable. You'll probably want to modify your drive to create two partitions on the same device (although it's still possible to use a separate device for your keydisk)

fdisk /dev/yourdrive

Delete any existing partitions

Create a new boot partitions which will contain the runnix bootloader and the Astlinux image(s). A typical size for this parition is 128MB which would be enough to hold multiple versions of Astlinux. As mentioned above this partition should be FAT16 (Filesystem type 6 in Linux fdisk) and must be bootable.

Next create a linux partition that uses the rest of the space on the drive. This will be your keydisk.

Save your changes in fdisk by using w to write the changes to disk.

 

Format your newly created partition.

mkdosfs -F 16 /dev/yourdrive1

 

Next install syslinux onto it

cd runnix-<version>

./syslinux /dev/yourdrive1

cat mbr.bin > /dev/yourdrive

 

Finally copy the runnix files to your prepared drive

mount -t vfat /dev/yourdrive1 /some/mount/point

cp -R rootfs_vfat/* /some/mount/point

 

Now what? Let's take a look inside the runnix files.

cd /some/mount/point

ls -lah

-rwxr-xr-x 1 root root 38 Aug 15 07:18 boot.msg

-r-xr-xr-x 1 root root 9.8K Aug 15 07:14 ldlinux.sys

drwxr-xr-x 2 root root 4.0K Aug 15 07:18 os

-rwxr-xr-x 1 root root 1.7M Aug 15 07:18 runnix

-rwxr-xr-x 1 root root 1.6K Aug 15 07:18 runnix.conf.sample

-rwxr-xr-x 1 root root 897K Aug 15 07:18 runnix.img

-rwxr-xr-x 1 root root 197 Aug 15 07:18 syslinux.cfg

 

runnix.img is the initrd file

runnix is the kernel

syslinux.cfg defines how runnix starts.

 

os is the directory where your target operating system images go. At a minimum you'll need an <image>.run file and the associated <image>.run.sha1 file which will be used to validate the image and the initrd file.