SBUML -ScrapBook for User-Mode Linux-
Menu
»  ENGLISH
    »  About
    »  HowTo
    »  Techniques
    »  Reference
       »  Browser Helper Application
       »  Directory Layout
       »  The rh72c Distribution
       »  Restoring Old Snapshots
       »  Kernel/Scripts Interface
    »  FAQ
    »  Miscellaneous
    »  Contact
»  JAPANESE
»  Site Map



Kernel/Scripts Interface


The information on this page is mainly for UML developers. Users of SBUML do not have to know the following details, because the SBUML command scripts handle them.

SBUML runs a patched version of the kernel that simply takes one additional parameter: sndir. If that parameter is not on the command line, then the kernel should run exactly like the normal UML kernel. (If it does not then it is a bug that should be trivial to fix.) So if you have unpacked the core SBUML distribution, you can boot toms filesystem in the normal UML way like this:

[(sbumldemo subshell) sbumldemo]$ ./kernel/linux \
ubd0=/tmp/tom.cow,./bases/toms-dcbb7d918c4814b7184f90d1a846ecd5/tomsfs



The sndir parameter specifies the machine directory, which if empty boots a new machine. To use it, the current directory must first be changed to the directory of the base distribution.

[(sbumldemo subshell) sbumldemo]$ mkdir /tmp/test
[(sbumldemo subshell) sbumldemo]$ cd bases/toms-dcbb7d918c4814b7184f90d1a846ecd5/
[(sbumldemo subshell) toms-dcbb7d918c4814b7184f90d1a846ecd5]$ ../../kernel/linux ubd0=tomsfs sndir=/tmp/test


To suspend the machine, use another terminal to send it the "halteverything" command using a rather ad-hoc interface that miraculously still survives:

[(sbumldemo subshell) sbumldemo]$ echo halteverything >>/tmp/test/console
[(sbumldemo subshell) sbumldemo]$ kill -USR1 $(cat /tmp/test/ctpid)
This is equivalent to doing sbumlcmd /tmp/test halteverything or sbumlhibernate /tmp/test.

To resume, issue the same command used to boot the machine. Since there is already a status file in the directory, the machine is resumed from the existing state. But first, remove the mconsole socket, which will be recreated:

[(sbumldemo subshell) toms-dcbb7d918c4814b7184f90d1a846ecd5]$ rm /tmp/test/mconsole
[(sbumldemo subshell) toms-dcbb7d918c4814b7184f90d1a846ecd5]$ ../../kernel/linux ubd0=tomsfs sndir=/tmp/test


The machine is now frozen, so send it a continue command:

[(sbumldemo subshell) sbumldemo]$ echo continue >>/tmp/test/console
[(sbumldemo subshell) sbumldemo]$ kill -USR1 $(cat /tmp/test/ctpid)


The UML machine should now be restored and running normally.


 Printable Version