
The Realtime LSM can be built separately from the Linux kernel, but
still requires the sources for the kernel with which it will run.
That method has fallen into disuse and is not recommended.  

******************************************************************
** Most people find it easier to patch the kernel directly.  To do
** that, apply the rt-lsm-${version}-kernel.patch in the usual way.
******************************************************************

Those who still wish to build the LSM separately can follow hese
earlier directions for building with linux-2.6.6.  Let me know what
happens if you try this, it has not been tested recently.

******************************************************************
** WARNING!  These instructions are untested and out-of-date:
******************************************************************

These examples are written for linux-2.6.6.  For earlier versions
please consult the "Earlier Kernel Versions" notes below.  For Debian-
specific instructions, see the "Building Debian Kernels" section.

These instructions assume you know how to configure, build and install
Linux kernels.  If not, please consult the README and Documentation
files in your kernel sources.  There is also a good Kernel-Build-HOWTO
available on the web.

The first step is unpacking the LSM sources somewhere convenient.

  $ tar xvzf realtime-lsm-${version}
  $ cd realtime-lsm-${version}

The Makefile assumes your kernel sources are in /usr/src/linux.  If
this symbolic link does not exist, you should either create it, edit
the definition of KERNEL_DIR in the Makefile, or pass the correct
location to make as a parameter.  The examples below all assume the
kernel sources are in `/usr/src/linux-2.6.6' and show how to pass this
value explicitly.

Next, configure and build the kernel in its own directory.

  $ cd /usr/src/linux-2.6.6
  $ make config

You may prefer to use one of the other config targets: `menuconfig',
`xconfig', `gconfig, or `oldconfig'.  You need at least these options.

  CONFIG_MODULES=y
  CONFIG_MODULE_UNLOAD=y
  CONFIG_SECURITY=y
  CONFIG_SECURITY_CAPABILITIES=m

It is very important that CONFIG_SECURITY_CAPABILITIES be configured
as a module, or the Realtime LSM will not load.

Compile the kernel and its modules in the usual way.  This need not be
done as `root', but does require write access to the kernel build
tree.

  $ make bzImage
  $ make modules

Now build the LSM as a kernel module.  This can be done by any user,
but the install requires root authority.

  $ cd realtime-lsm-${version}
  $ make KERNEL_DIR=/usr/src/linux-2.6.6
  $ sudo make install KERNEL_DIR=/usr/src/linux-2.6.6

Finally, go back to the kernel directory and install everything.

  $ cd /usr/src/linux-2.6.6
  $ sudo make modules_install

Don't forget (as root) to install the kernel `bzImage' in some
appropriate place, update /etc/lilo.conf, and run `lilo' or perform
the equivalent updates if you use `grub' instead.


Earlier Kernel Versions (<= 2.6.5)
----------------------------------

There are some differences in the makefiles of 2.6.5 and earlier
kernels that affect the way the LSM is built and installed.

  * The LSM `make' requires write access to the kernel build tree.

  * The LSM `make install' installs all the kernel modules as a side-effect.

Some early 2.6 kernel versions are no longer supported.  If possible,
upgrade to a newer kernel, they work much better.  Otherwise, use the
realtime-lsm-0.1.1 version.


Building Debian Kernel Packages
-------------------------------

For Debian users, the preferred tool for generating new kernel
packages is make-kpkg.  By default, it builds only those modules in
the kernel tree.  But, with the --added_modules option, it will look
for the realtime module in /usr/src/modules, compile it and include it
in the installable .DEB package.

  $ make-kpkg kernel_image --added_modules realtime
