If you already know how to make a file distribution and boot it in User-Mode Linux (see building filesystems), then packaging it into a base distribution for SBUML is easy. Simply take all the file systems and put them into one directory. Then add a file named basecmdline that has all the necessary parameters to pass to UML for a successful boot except for the tun/tap networking parameter. Here is the basecmdline for the toms distribution, for example:
The one for rh72c is a bit longer, but still identical to what UML would use on its command line:
umid=rh72a ubd0=rootfs200megs root=/dev/ubd0 ubd4=onegig_fs ubd1=usr_fs ubd5=fiftymeg_fs ubd6=halfgig_fs ubd7=swapfs
Here are a few hints:
- Build the command line assuming that the directory that holds basecmdline will be the current working directory when SBUML starts booting. In other words, none of the file names of the block devices should have paths.
- COW file names will be ignored, since SBUML automatically puts all COW files in the machine directory.
- Be sure the booting does not open any devices whose state SBUML cannot save yet. For example, at the time of writing this, SBUML does not handle serial devices.
- A file named use-stdio in the directory will tell SBUML to open up an xterm for input and output of UML's stdio. The contents of the file don't matter. If this file does not exist, then stdio output is sent to a file named stdout in the machine directory.
- Make all the files read only! And also back up the new base distribution, because all snapshots based on it will require that it remain unchanged.
- The name of the base distribution will be the name of the directory that contains basecmdline.
In addition, it is possible to put a dash followed by an arbitrary hexadecimal string at the end of the base distribution name. The purpose of this is merely to ward off name clashes for cases where two people give a distribution the same obvious name (e.g. "debian" or "redhat"). My convention has been to start appending the md5sum of all the files in the base distribution. Thus if you do the following, you can have some confidence that the toms distribution is intact:
[(sbumldemo subshell) sbumldemo]$ cd bases/toms-dcbb7d918c4814b7184f90d1a846ecd5/
[(sbumldemo subshell) toms-dcbb7d918c4814b7184f90d1a846ecd5]$ cat * | md5sum