SBUML -ScrapBook for User-Mode Linux-
    »  About
    »  HowTo
    »  Techniques
       »  Web Page Snapshots
       »  Creating New Base Distributions
       »  Posting Snapshots
       »  Compiling and Debugging SBUML
    »  Reference
    »  FAQ
    »  Miscellaneous
    »  Contact
»  Site Map

Creating New Base Distributions

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:
  1. 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.

  2. COW file names will be ignored, since SBUML automatically puts all COW files in the machine directory.

  3. 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.

  4. 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.

  5. 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.

  6. 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
    dcbb7d918c4814b7184f90d1a846ecd5 -

 Printable Version