Lt1 - Custom 1.44MB GNU/Linux Distribution

Last updated — Aug 12, 2004
First published — Sep 13, 1999
#custom

Lt1. Linux, GNU, diskless, single floppy, 1.44MB, 2MB flash RAM, ramdisk, rescue disk.

Article Collection

This article is part of the following series:

1. Misc

Table of Contents

Introduction

LT1 is small GNU/Linux distribution that I co-authored in 1999. The name is a shorthand for “Linux Terminal 1”.

It was made for diskless terminals with a diskette drive and 2MB of flash RAM. The image is also useful as rescue and maintenance diskette, running administrative tools, or for a single-disk FTP server.

The base of lt1 is a single, 1.44MB floppy disk which loads into ramdisk. After it loads, the diskette can be removed. An additional diskette 2 with more tools can then be inserted and mounted on /usr/ if needed. The contents for disk 2 are in the directory ext_rescue/.

Original development platform used was RedHat 4.2. Refer to it if you want to add additional binaries into the distribution.

No new development has been done on lt1 after the end of 1999. But it is simple and based on Unix principles which are all still valid today. It is preserved here for historical value.

Operation

The default behavior of the distribution is to boot and automatically open telnet connections to the chosen servers on consoles 1, 2, 3, and 4.

Login into the local OS for maintenance is possible on consoles 8 and 9. This can be looked up or edited in /etc/inittab, as usual.

Contents

Lt1 is a 32-bit GNU/Linux terminal distribution consisting of one boot and one extra diskette.

It has no X support. It does not include SCSI support and lacks SCSI devices in /dev/. It uses telnet (not SSH).

Development platform used was RedHat 4.2. Refer to it if you want to add additional binaries into the distribution.

Like RedHat 4.2, lt1 uses libc5, ncurses3, and ELF binary format. Supported console fonts are cp850, cp852 and iso02.

Compiler shipped with RedHat 4.2, which is gcc 2.7.2.1, cannot compile the 2.0.38 kernel. It must be upgraded to 2.7.2.3.

If you want to add more terminfo entries, get terminfo source definitions, compile them with tic, and put them under the appropriate letters in /lib/terminfo/.

Most of the custom stuff is simple, and thus implemented in the bash scripting language.

Base / Boot Disk

First disk contains the Linux system itself and necessary binaries and libraries.

Boot disk contents are:

  • Kernel vmlinuz-2.0.38 (349456 kB)
  • Kernel modules (net) 8390.o, bsd_comp.o, ne.o, ne2k-pci.o, rtl8139.o, tulip.o, (misc) psaux.o
  • Libraries libc.so.5.4.44, ld-linux.so.1.9.9, libdl.so.1.7.14, libncurses.so.3
  • Terminfo ansi, linux, linux-m, linux-nic, qnx, qnx4, qnxm, qnxt, qnxt4, qnxtmono, qnxw, test, vs100, vs100s, vt100, vt100-am, vt102, vt102-am, vt102-plus, xterm, xterms
  • Fonts cp850-8x16, cp852-8x16, iso02.f16
  • Font maps croat.map, us.map
  • Binaries bash, cat, chmod, clear, cp, date, fdflush, ftp, gzip, kill, ln, loadkeys, loadunimap, login, ls, mkdir, mount, mv, open, ping, ps, pwd, rm, rmdir, setfont, sh, sleep, su, switchto, sync, telnet, traceroute, umount, (admin) autotelnet, depmod, gpm, halt, ifconfig, init, insmod, ksyms, lsmod, mingetty, mkswap, modprobe, reboot, request-route, rmmod, route, swapoff, swapon, update (This list is not accurate)
  • Devices XOR -> null, cdrom -> hdb, console -> tty0, fd -> /proc/self/fd, fd0-1, full, hda-8, hdb-8, hdc-8, hdd-8, kmem, loop0-7, mem, mouse -> psaux, nfsd -> socksys, null, port, psaux, ram-16, ramdisk -> ram1, random, rtc, stderr -> fd/2, stdin -> fd/0, stdout -> fd/1, tty0-12, ttyS0-1, urandom, zero

Extra Disk

The other disk is optional and has some addons.

If/when used, it should be mounted on top of /usr/ for automatic operation.

It just contains additional binaries:

  • Binaries chgrp, chown, dd, df, dmesg, false, grep, gzip, joe, tar, touch, true

Using editor joe will report a missing /etc/termcap and use ansi terminal. That is OK.

You could also make your custom additional disks, but they should have the usual {lib,bin}/ structure to operate correctly when mounted on /usr/.

Configuration

Lt1 is designed to boot and automatically start its work environment.

Everything is controlled via environment variables. The following ones are available:

  • -ETH0 network module (additional params with ‘+’)
  • -INETSRV one-for-all server address
  • -INETSRVx server address, where x is the virtual console number (1-4)
  • -INETADDR diskless client’s own IP address
  • -TERM terminal emulator (gets set with export TERM='xxxx')
  • -KBDFONT screen font
  • -KBDKEYS keymap

Image Building

The source directory contains 3 scripts for generation and adjustment of disks: Make, Clone, and Adjust.

It also contains 3 config files: conf.static, conf.dynamic and conf.lilo.

Size of the main disk must not exceed the destination media limit, so check on 1445 kB for 1.44MB diskettes is performed. Adjust the configured limit in scripts if needed.

On newer systems (kernel 2.2 and above) mke2fs will automatically turn on two additional options, and such filesystems will not be mountable with a 2.0 kernel. Thus, if you are building the image on a newer machine, but intend to run it on the 2.0 kernel, use mke2fs -O none.

Scripts

  • Make [ 1 | 2 | 3 ] script is a completely automated way to create your lt1 disk. The process itself is divided into 3 parts which can be invoked separately by specifying parameter 1, 2, or 3 to the script.

    • Make 1: ramdisk image creation (the lt1 itself)

    • Make 2: kernel filesystem (needed by LILO bootloader and kernel)

    • Make 3: disk creation, kernelFS and ramdisk image get copied to the destination media. Make with no options will generate the distribution image and write it to diskette device /dev/fd0

  • Clone [src=] [dest=] reads from src and copies contents to dest.

    • src=choose from list

    • dest=/dev/fd0

  • Adjust [ 1 | 2 | 3 ] adjusts previously built lt1 disks. Like Make, it accepts arguments 1, 2, or 3.

    • Adjust 1: creation of default LILO (Linux LOader) parameters

    • Adjust 2: dynamic params adjustment

    • Adjust 3: kernel change

    Default steps it executes are 1 and 2.

Config Files

  • conf.lilo Base LILO (LInux LOader) configuration

  • conf.static Network params, IP addresses for the client and server, font and terminal settings

  • conf.dynamic Additional LILO params, given to the kernel at every boot. Use this to make quick adjustment of already written lt1 disks. This file has the priority over conf.static definitions

Kernel

The Linux kernel used is version 2.0.38.

If you want to replace the kernel with newer/other version, copy the new compiled kernel image (./arch/i386/boot/zImage) over zImage in the lt1 source directory. For reference, the minimal size of a 2.2.x kernel image is 169 kB.

In addition to copying a new zImage, do make modules in the kernel source tree to compile modules. Then copy modules/{net,misc,fs}/*.o to /lib/modules/2.x.x/{net,misc,fs}/ in the lt1 source tree.

Examples

Build-time

Simple lt1 distribution creation process:

./Make

Just transfer the image to diskette:

./Make 3

Clone the disk, in this case from a diskette to file on disk:

./Clone src=/dev/fd0 dest=/tmp/disk_image.img

On a previously written lt1 disk, adjust client IP address to be 192.168.9.45, server IP to be 192.168.9.1, and set tulip network driver:

export PARAMS=''-INETADDR=192.168.9.45 -INETSRV=192.168.9.1 -ETH0=tulip''
./Adjust
unset PARAMS

On a previously written lt1 disk, use ISA ne2000 cards (driver ne) on IO address 0x240. IO address is passed as an additional argument with +, as mentioned previously.

export PARAMS=''-ETH0=ne +io=0x240''
./Adjust
unset PARAMS

If/when it is inconvenient to export PARAMS and then unset them, settings can be stored to conf.dynamic and Adjust called with no other options.

Run-time

All the parameters can also be passed to the kernel at boot time.

Boot loader used is LILO. LILO prompt appears by pressing shift. ctrl, or alt on the keyboard during boot.

Here’s an example of specifying the lilo entry to boot with additional parameters:

LILO Boot: lt1 -ETH0=tulip -INETADDR=192.168.9.45 -INETSRV=192.168.9.1
LILO Boot: lt1 -ETH0=ne +io=0x240 -INETADDR=192.168.9.45

Article Collection

This article is part of the following series:

1. Misc