muLinux: floppy Linux, v11.x Plateau Rosa

© 1998-2000, Michele Andreoli, m.andreoli@tin.it

November 2000


This is the multi-patched documentation of muLinux, the microscopical Linux distribution developed by Michele Andreoli. Translation from Italian to English by Enrico Cavalli, enrico.cavalli@mi.nettuno.it. Well, it sounds like English but I hope it's clear enough.

1. What is muLinux?

muLinux (-Linux) is a full-configured, minimalistic, almost complete, application-centric tiny distribution of Linux made in Italy, fitted on a single 1722K floppy.

Its aim is to demonstrate the power and scalability of this operating system. The 2.0.36 kernel is compiled for the 386 (without co-processor) and modularized as much as possible. The binaries are taken from the dozens of distibutions and boot-floppies on my 3 big hard-disks. Are you wondering why I chose a particular binary, When I had two of them with the same name? I simply took the smallest and the one which needs only libc.so.5. I won't bother you telling about all the dirty hacks to save space: it's enough for you to know that I rewrote in C the expr command, because I couldn't understand why it takes 50328 bytes when I can do the same job with only 4586 bytes. I even substituted grep with sed and other similar stuff.

2. Who is muLinux for?

muLinux is not intended for the generic mouse-based user, who wouldn't be very Happy with its spartan interface, but for the Linux fan in general, or the curious person who wants to look inside scripts to understand why an hack as muLinux sendmail (only 1216 bytes) is really able to deliver mail with the correct return-address. Moreover, a portable Linux would be ideal in a number of situations: maintenance in different places, as a demonstration, as embeddable system or just to see it booting at times, for no particular reason.

3. Main goals of muLinux

4. Hardware Requirements

Most PC hardware will work fine. The very minimum is a 386 with 8MB of RAM: installing muLinux with only 4MB is russian roulette. A math coprocessor is NOT required since mulinuz has math emulation built in.

A hard-disk in not required. Of course, you can mount the existing partitions on your hard-disks if you want. SCSI disks are not directly supported because of the huge variety of controller cards. If you want SCSI support please read How can I personalize muLinux?

5. The setup command

In order to configure and control all resources , muLinux has a script (setup, see setup -h ) which is able to read (setup -r) and write (setup -s) muLinux profiles to and from the floppy, the type of keyboard, ethernet data, where the mouse and modem are located, which modules the kernel has to load at each boot, the phone number of your ISP, and so on. Thank God, you only have to bother with this profile the first time you boot the floppy. The user, however, is able to type a command like setup -f ppp or setup -f net each time he wants (-f means "force"). Or, if you want, you can type setup -f -a, where -a means "all". In order to use the floppy in various positions, the setup command manages a sort of "multi-configuration". You are able to switch from one profile to another one whenever you want. You can save different profiles with different names. For example, with setup -r "home" you can load a profile with only ppp support; with setup -r "pc12" you can load a profile for an ethernet card and the IP for PC #12. All this stuff resides in the /init directory of the BOOT segment, while the current profile resides in /setup.

When muLinux boot, setup ask you for a profile to load. Special config name are "NONE" and "lock": with NONE, setup skip any operation and if your last saved config is named "lock", setup load them without confirm.

With setup command, you can also load in memory a compressed modules: setup -m module_name and, starting from 10r0 release, it support also command line mode. See help.

6. muLinux and the sheep Dolly

Starting from version 2.0, muLinux is able to install itself not only in RAM, but permanently into a DOS directory (UMSDOS installation) or into a free partion of your hard-disk (EXT2 installations). You only need about 8-10M of free space somewhere on your hard-disk.

To perform this kind of installation, the muLinux kernel comes with UMSDOS and DOS support, and we added loadlin.exe to the floppy. In both cases, we use loadlin to boot muLinux, so it is necessary to start from the DOS prompt with the command linux.bat. The reason behind this choice is that muLinux was built to be used temporarly on PCs which we do not own: we must perform non-invasive and easily removable installations.

UMSDOS installation realizes this concept: you can share disk space between Linux and DOS; you do not have to repartition hard-disks and you can remove it without particular effort.

EXT2 installation, on the contrary, is just a curiosity and it is the only intrinsecally dangerous one: muLinux will have to format the chosen partition (like every Linux installation floppy) and it is possible For a novice user to chose the wrong partition. By the way, if you really have a spare partition sufficiently big, why don't you install a true Linux?

Release > 5.1 support also another kind of DOS-based installation: the loop filesystem. This feature uses the so-called "loop Linux device", a whole filesystem embedded in a normal DOS file, located in c:\linux.

At this point you will be asking about the title of this section. Actually, what we described until now are not real installations but actually a cloning process. The entire muLinux filesystem (even mounted devices) is copied (with cp -a, that's true!) into the chosen destination.

Just a few word of advice: do not leave your cd-rom or any NFS volume mounted while cloning mulinux if you do not want the entire universe being replicated into your DOS partition!

Cloned muLinux systems work just as normal systems mounted in RAM. Setup and autoconfiguration procedures are consistent between the three installation modalities. The user will not notice any difference. This feature makes muLinux different from similar floppy-Linux offerings, which have a stronger link with the floppy.

7. Read-only cloning and removable devices

Starting from 7r4 release, a new kind of cloning (via /bin/roclone) is provided. This is primarily for to embed a frozen copy of active filesystem in a (maybe read-only, bootable) media, with DOS campatible formatting. Usefull for clone on Iomega ZIP, CD-R (El-Torrito mechanism) and other removable media (SCSI devices supported).

From a technical point of view, all happen in usually way, but after booting muLinux try to mount own USR segment from a removable device, probing in turn CDROM IDE, CDROM Scsi, ZIP floppy and other. If succeded, muLinux mount the USR image (a normal file in the boot/ directory) using the loopback Linux device and uses a mixed filesystem arrangement: RAMDISKs and read-only media togheter.

SRV addon mounted is required, for this functionality. Tested on IOMEGA Zip and HP CD-Writer M820 devices by myself.

8. muLinux and systems with low memory

The cloning process (see muLinux and the sheep Dolly), which can be run by the user with the clone command at any time, will automatically start when the system recognizes that there is insufficient RAM available (<4M).

In this case, muLinux stays at "runlevel 3" (only the /bin commands available), immediately creates a swap file in the DOS partition, and starts cloning itself without delay.

When you see the message Automatic reboot in progress, extract the floppy and start DOS. At the dos prompt cd into c:\linux and start linux.bat: the cloned muLinux will soon be up and running.

The first boot of this new system is exhausting like the pains of a childbirth: if muLinux realizes that some components are missing (typically /usr and X11), it starts copying them from floppy to HD. If instead you manually cloned muLinux starting from a RAM-mounted system already configured, the cloned system will already be complete.

Beware that on a 386 with 4M the entire cloning process and "re-animation" can take more than 15 minutes the very first time, but you will then be able to see XWindow starting on your 386!

9. muLinux as NFS-root diskless client

Starting from version 3.0, code-name "Hammameth", muLinux is able to install its root filesystem via NFS (Network File System), provided you have a working LAN-server supporting this traditional TCP/IP protocol.

The nfsroot-service is configured with the usual setup procedure (see The setup command): muLinux will ask to configure the Ethernet parameters and to specify the nfs_root, i.e. the remote directory containing a Linux system (which can also be a copy of muLinux).

muLinux kernel was slightly modified in order to mount the "real root" only after the configuration of the variuos network drivers: muLinux kernel is modular, so it is not possible to configure these drivers via the usual boot parameters (nfsroot= and nfsaddrs=). The patch is so tiny (just one line) that it can be the subject of an email or it can be written on a stamp!

For example, suppose your muLinux clients have IP addresses given by (in dot-notation) 192.168.1.x, and that the nfs_root is /remote/root. The /etc/exports on the server could be something like

        #/etc/exports
        /remote/root    192.168.1.0/255.255.255.0(rw,no_root_squash)

Once you saved the profile on the floppy (with your favourite name, for example "nfs"), the next time muLinux is booted you only have to request this "nfs" profile: muLinux will configure the network drivers and mount the nfs_root.

If the remote system is itself a muLinux system, it is possible that at the first boot the "remote" muLinux will ask you to restart the setup one more time. Forgive him: how can he know that you already answered all those questions?

In order to prepare the remote system it is enough copying the entire muLinux tree into the server's /remote/root. Another solution is exporting the entire server's root (THIS SOLUTION IS NOT SAFE).

If you have a spare EXT2 partition on the server (/dev/hdb1 for instance), you can also prepare it with a working Linux distribution and export it to the workstations. In this case it is enough to mount this partition at boot time (place the line "mount -t ext2 /dev/hdb1 /remote/root" into one of the server's boot scripts) in order to make it available to the clients. The clients' /etc/fstab should contain something like

        /dev/nfs        /       ext2    defaults 1 1

If the client needs swap space, it must use a local disk: muLinux kernel is not able (at this time) to swap via NFS.

For machines with low memory (less than 4M of ram), the boot process is slightly changed: muLinux will immediately ask if you want to clone the system to disk (like previous versions), or if you want to mount root via NFS. With little effort it is possible to transform your 386 into a diskless workstation based on Linux+XWindow. This solution is very cheap and efficient for many schools with obsolete computer labs (like many Technical Institues you can find in Italy).

10. IP filtering with muLinux

______________________________
 __|__                  ___|___
|     | local network  |       |   ______  PPP-link to provider
| PC  |  192.168.1.0   | Linux |--|modem |------------------>
|     |                | Router|  |______|      x.x.x.x
|_____|                |_______|          (dynamic IP-address)
                         pppd

IP filtering firewall is designed to control the flow of packets based the source, destination, port and packet type. In muLinux (version > 2.7, setup ipfwadm) You can enable IP masquerade feature and IP generic protection on a Linux server, allowing connected computers (running TCP/IP, but without registered Internet address) to connect to the Internet through your muLinux box.

11. What happens at boot time?

The floppy is made up of 1722 blocks of size 1024K. It is logically divided into three parts:

BOOT

An ext2 non-compressed (i.e. mountable) file-system. It will be mounted under /startup;

ROOT

A gzipped ext2 file-system image, obviously mounted under /;

USR

A bzipped ext2 file-system image. It will be mounted under /usr.

The X11 floppy addon (1772K) is, instead, in tarred+bzipped (tbz) format.

The kernel is loaded, as usual, via LILO. When the kernel is loaded, it executes /sbin/init. BOOT is mounted from the floppy under /startup, while USR is mounted under /usr as ramdisk. Accessing /startup we are able to permanently save to floppy our muLinux profile: see section The setup command.

Startup scripts take also care about creating a fourth partition into RAM, loaded under /tmp.

12. Boot prompt parameters

The Linux kernel has a limited capability to accept information at boot in ther form of var=value entry. In general, this is used to supply the kernel with information about hardware parameters.

Boot-prompt arguments typically only apply to hardware drivers that are compiled directly into kernel, so in muLinux this feature is rarely useful.

If You, at "boot:" prompt, press [SHIFT] or [TAB] key, LILO waits for the name of a boot image (in our case: mulinux) and pass command-line options to the kernel. Example:

                boot: mulinux root=/dev/hdb2 vga=extended 

This is a brief list usable with muLinux kernel:

vga=mode

specifcs the VGA text mode: normal (80x25), extended (80x50), or "ask".

root=device

mount this device as root partition.

init=program

specifics the name of init program to execute, ex. /bin/sh, or /bin/rc.1,etc. This is useful for recovery purpose.

mem=size

specifics the amount of installed memory (if BIOS report is bad).

load_ramdisk=0

avoid muLinux root loading.

If You want to supply an alternate mountable root floppy, instead of muLinux standard ramdisk (low-memory system) you can type:

                boot: mulinux load_ramdisk=0

The kernel ask you "Insert ROOT floppy ..."

If You want mount an existing EXT2 root partition, type:

                boot: mulinux root=/dev/hd...

13. What you will find on the floppy

This list is always a work in progress: whenever I free space on the floppy the list will grow.

Mini Applications

Release >4.2 comes with a set of mini-apps, based on "muless", a less-like programmable ncurses interface:

Shell.

/bin/ash: I know it's ugly, but it is much smaller than bash and it's the same as far as scripts are concerned. "Command history" approximated support with ile.

Man pages

None really. help interactive command (VAX style) is available. Some true man pages are in GCC floppy addon.

Editor.

elvis tiny (standard UNIX vi clone) and ae Antony Editor (but this on X11 floppy).

Keyboard support.

Many national keyboard mappings. Codepages: 437,850.

Mouse support.

Serial mouse. Bus Mouse: PS/2 (aux port style): /dev/psaux; Logitech BUS Mouse: /dev/logibm; Microsoft BUS Mouse: /dev/inportbm. gpm mouse server (v>6.0, SRV).

File-systems access.

Dos, UMSDOS, Windows, vfat, NFS (nfs.o module), WfW/NT fs share Samba/SMB (smbfs.o module), cdrom (isofs.o module). Commands like mount, smbmount, umount, fdisk, fdformat, df, free, mkfs.ext2, [e2fsck].

Generic commands

ls, cp, mv, gzip, gunzip, bzip2, bunzip2, more, less, stty, zless, zcat, cmp, find (emulated), grep,fgrep (emulated), sed, tr (rewritten), date, basename (emulated), dirname (emulated), pidof (emulated), ee editor, dd, od (emulated), file (emulated), pr (emulated), du (emulated), expr (rewritten), setserial, tar, insmod, rmmod, lsmod, m4 macro processor, bc calculator (emulated with awk) etc.

Release > 4.2 comes with awk language and a set of new classical UNIX command based on them, like: sort, uniq, tail, etc.

I dreamt of not including gzip and using the z option of tar. But tar only gunzips...

You won't find either zip or unzip: these are rather big. Maybe in the future.

Printer support

lp.o module, by request plus a simple lpr with escape codes (no spooler). muLinux support only ASCII, POSTSCRIPT (i.e. Apple Laserwriter) and HP-PCL (i.e. Laserjet) printer, but print only this format: ascii, pgm, tiff (g3,fax). Starting from 4.0 release, muLinux support also remote UNIX printers, BSD style (contributed by Tom Poindexter (tpoindex@nyx.net). Starting from 6r3 release muLinux support an LPD server, contributed by Steve Flynn (smflynn@ozemail.com.au): a little C program which understand the traditional BSD lpd printer protocol (RFC1179). Enabling this daemon, your host may act as a simple Print Server or Print Sharer for UNIX machines, for WinNT ( using "Microsoft TCP/IP Printing" driver) or for Windows 95/98 (using a FREE program, called ACITS LPR )

Standby (spindown) timeout for the HD drives

Timeout is used by the drive to determine how long to wait (with no disk activity) before turning off the spindle motor to save power.

TCP/IP tools

Ethernet.

Cards supported: 3c509, ne (NE1000, NE2000, and many clones), ne2k-pci (PCI ne2000 clones), wd (WD8003, WD8013), smc-ultra, 3c59x ( the 3Com "Vortex" and "Boomerang" series ethercards,Fast EtherLink 3c590/3c592/3c595/3c597, XL 3c900 and 3c905 cards), ..., but the modules are on the floppy. You just have to gzip your own module, and put it on the floppy. See section How can I personalize muLinux? for further details.

DHCP

Dynamic Host Configuration Protocol; muLinux (>4.2) support a dhcpcd configured client. DHCP allows hosts on a TCP/IP network to request and be assigned IP addresses, and also to discover information about the net- work to which they are attached.

PPP.

ppp.o, serial.o and slhc.o modules; chat and pppd commands. Configuration is automatic and you start PPP typing pppd or ppp-on, ppp-off. PPP mulinux setup also provide a way to link together two PCs (or a local network to the Internet), via null-modem serial cable.

diald

muLinux (hyper-rustic) diald is a daemon based on an IP accounting's hack. Enabling diald, muLinux detected outgoing DNS request to some remote NAMESERVER (port 53) and start PPP (or what you want, of course)

cron

the traditional UNIX command scheduler.

Fetching mail.

A fetchmail only a few K, perfectly working, with the -F (flush) option, but also a true fetchpop.

Sending and reading mail.

A sendmail compatible with the real one, wich support smarthost and offline processing. I tested it with pine from my "big" Linux. You can use the From: field you prefer (-f option). Mail processing with RNA Messenger, symlink `mail` (offline supported).

News.

RNA, newsreader mode + suck (pull small newsfeed from usenet; emulated with scripts).

Traditional Internet Daemons

Starting from 7.0, mulinux support inetd, wu-ftpd, in.rlogind. Multi-user is now enabled, with login and password.

PCMCIA support

Starting from 7.0 release, muLinux support PCMCIA card (SRV addon). Tested on IBM Thinkpad with 3c589 card and ACER Extensa 5027, with ne2000 compatible card.

Modem connectivity.

Fax management.

A fax script allows You to make,send,receive and print fax files, with efax packages (C) Ed. Casas. Tested with USR Sportster 3.66, but will work with any modem, I hope.

Music and sound.

The Web.

The server side

Starting from release 2.3, muLinux comes with some rustic "servers and daemons" support. A muLinux server is, generally, a shell script (often netcad based) running via init(8) at "runlevel 5", without inetd. Servers shutdown with "init s" and restarts with "init 5"; "init q" update the init(8) status. This list will grow, I hope.

Games

fortune (classical Linux fortunes, in latino), paganini, piano (sound games) reverse, blue (solitaires). carbo (crypto games) TicTacToe , forza4 (solitaires).

14. How much free space is there on the floppy?

No comment.

15. Floppy models

The mu -i command supports creation of various floppy models, of size 1440K or 1770K. For example, the two floppy model BOOT+ROOT(1722K) and USR(1722K), allows to increment the number of binaries put in ROOT (/bin) and in USR (/usr/bin).

The model BOOT+ROOT(1440K) and USR(1722K) boots much more rapidly. mu -i has a drawback: DOS-installers cannot choose the model but they must accept the default BOOT+ROOT+USR on a single 1722K floopy. This is because LILO is not available as a DOS program. Tecnically, building a floppy is just a command similar to cat BOOT ROOT > /dev/fd0, but LILO is necessary to modify the MBR. I do not know a simple way to do this under DOS (without LILO). Finally I don't think that distributing a BOOT.1440 and a BOOT.1722 would be a good idea.

16. How can I personalize muLinux?

See also the file doc/custom.txt in dist archive.

16.1 Prerequisites

Neccessary kernel functionality to do 'mu -r':

- loopback device support

The right versions of 'fdformat', 'lilo' and 'bzip2' are included.

16.2 Modules

The root partition resides on the floppy, split into two parts (see section What happens at boot time?): The first part (ROOT) just contains the directory structure (/bin, /lib, etc.)

The first thing to do if you want to build a custom muLinux is to unpack the BOOT,ROOT,USR and X11 images with the command mu -u. It will unpack the BOOT partition under subdirectory tree/startup and ROOT+USR+X11 under subdirectory tree/.

Now, add, wipe, replace commands as you like.

If you want to change the kernel, compile it with make zImage and copy it under tree/startup/boot/mulinuz. The necessary modules must be gzipped and copied in tree/startup/modules/archive.tbz (see tree/startup/modules/README, for details).

It is often necessary to specify parameters like io, irq and so on when you load a module. If your X.o module needs extra parameters just write them into tree/startup/modules/X.param, remembering that muLinux loads modules with a command equivalent to this

insmod X.o `cat X.param`

Please note that you have to compile ext2, DOS, UMSDOS file-system support and ramdisk support directly into the kernel because they are needed at boot time for UMSDOS muLinux models.

If you look into the mu script you will find a variable called BOOT_FREE: with it you can tune the free space you want on the BOOT partition, where all configurations are saved permanently and where you may want to save you emails for instance.

16.3 Keymaps

Custom keymaps are located under tree/startup/init, in keymap.tgz. See tree/startup/init/README for customization instructions.

16.4 Personal stuff

You can save a mailrc and/or a bookmars.html into tree/startup/init.

16.5 The /usr/bin directory

You will find the contents of this directory under tree/usr/bin. You may change this directory without restrictions. If you ran out of space this is the place to look if you want to purge commands. Remember that lynx is the biggest executable on the floppy.

16.6 Rebuilding the floppy

When you finished customizing muLinux just type

mu -r
mu -x   # this if for X11 subsection
to rebuild the floppy-image. Pay attention to error messages! If everything works fine reboot now your brand new muLinux!

17. The muLinux XWindow addon

This addon consists, basically, of the VGA-16 XServer, the fvwm95-2, Afterstep and wm2 Window-Manager and the XFM Application & File Manager. muLinux mounts the content of this floppy (approximately 4.2M not compressed) under /usr/X11R6. You will find the new binaries and libraries into /usr/X11R6/bin and /usr/X11R6/lib.

Configuration files are located under /usr/X11R6/lib/X11, the initial choice of X11R6 developers. Maybe you want to take a look at the following files:

The XKB feature is disabled: national keyboards are directly exported into X. Finally, a lot of fonts were simply deleted.

Anyway, you will find these X programs: xcalc, xclock, xload, xhost, xmodmap, xsetroot, xinit, xcal, xmixer, pyro, xsnow and xterm (rxvt). xterm can be used to run every text-mode muLinux command (lynx, minicom, workbone, etc...). xhost is interesting because it allows the local X server to display applications running on a remote workstation.

If you have 16-32M of avalaible RAM, X will run at a terrific speed!!!!

18. The muLinux SRV and WKS add-ons

Approximative list:

        - full PCMCIA support
        - multiuser support
        - lilo & syslinux bootmanager
        - the UPX compressor
        - thttpd Web Server
        - inetd, ftpd, telnetd, rshd and other daemons
        - rdate (set date from a remote server)
        - Smail: a sendmail replacement
        - The Samba Suite, v1.9.18a (smbd, nmbd, smbclient)
        - Lynx 2.6, the popular UNIX web browser
        - MC, the Midnight Commander
        - Mutt, a small and powerfull text-based Mail user agent
        - PGP 2.6.3i RSA/IDEA encryption system
        - multimedia: mkisofs, cdrecord, cdda2wav,sox
        - generic: su, id, ftp(client),zip/unzip, diff/patch
        - ssh: the secure shell

19. The muLinux VNC addon

XVnc X-Server (from Virtual Network Computing) and relative clients; SVGA-lib; zgv thumbnail image viewer. X11 required.

20. The muLinux TCL addon

An add-on floppy for muLinux to add a healthy mix of application programs written in Tcl/Tk. Requires the muLinux X11 add-on, as most Tcl programs included are X11 based. Author: Tom Poindexter, tpoindex@nyx.net.

21. The muLinux TEX addon

LaTex: TeX typesetting system for UNIX-like systems, with AMSTex (from American Mathematical Society) package, dvips, xdvi, etc. The addon contains also Lyx: the popular X frontend to LaTex.

This addon can be used as tool for emergency professional typesetting, if you work as sturm-reporter in some war-zone, around the world, and wish urgently to rewrote the "Book 8th, Conic's Section" of Apollonio di Perga (never found; I'm curiousus).

22. The muLinux GCC addon

In this 1722K floppy, coming with 4.0 release, some utitily for C developers.

(Release > 11) This add-on contains also NASM v0.98, the popular Assembler for 80x86, and the disassembler NDISASM. It is able to compile Linux ELF and aout, but also .com and .exe suitable for DOS.

(Release > 11) It is now possible to compile kernel modules for the serie 2.0.*. I tested using sample modules form 1) "Linux Kernel Module Prog. Guide", by Ori Pomerantz and 2) "Linux Device Drivers", by A. Rubini.

Demo sources in /gcc/usr/src.

23. The muLinux EMU addon

This is the muLinux EMU(lators) addon. It contains:

-- DOSEMU v0.66, the Linux DOS Emulator -- WINE v981018, the Linux Windows Emulator -- mtools v3.8, DOS commands in the Linux box

Because most of this programs requires libc6 and libX11 to works, this addon depend from the PERL and X11 addons. Wine, on the other hand, requires XWindow up and running; DOSEMU, doesn't.

The addon is mounted on /usr/emu. Please, look in the directories /usr/doc/help and /usr/emu/doc for more info.

-- DOSEMU starts typing 'dos' (see dos -h) -- WINE starts typing 'wine' (see wine -h) -- swap is strongly suggested running WINE

Alert! DOSEMU and WINE are alpha software; they can crash/destroy your DOS/WIN9x installations: handle with care.

24. TODO

25. About this document

This document was written in SGML, and then rendered using the sgml-tools package.

You can find the latest version of this document at http://sunsite.auc.dk/mulinux/.

26. Download muLinux

Click here.

End of the MuLinux README. (You can stop reading here.)

Сайт создан в системе uCoz