ttyrpld [rusty colors]

 
Unpacking >

In the following code snippets, # denotes a root/superuser shell, while $ can be a user, or a root shell. Listed are only the commands you have to execute, their output is not shown in the boxes.

If you made it until here, I assume you already unpackaged the source tarball. If not, use:

$ tar -xvjf ttyrpld-VERSION.tbz2;

Of course, replace version with the correct string.

 
Patching the Kernel sources >

This is probably the step most of us will hate, because it involves a total recompile of the Kernel, or at least bzImage. However, I can't help this, as this is by design. Once you have it prepared with the RPL hooks, you will never need again (for that particular kernel)! When there is a new version of ttyrpld and your current Kernel still has the RPL hooks, no more patching is needed. That's one of the strengths.

You can find different Kernel patches in the kpatch folder, each targeting a different series and/or version. Currently, there is 2.4, 2.6.5 and 2.6.8. The 2.4 should be self-explanatory (tested with 2.4.21). The 2.6.5-patch one should be used to patch anything up to including 2.6.5, but also works with a 2.6.9 (with lines offset and a small fuzz). Recommended for 2.6.7 and up is of course the 2.6.8.diff.

OTOH, the 2.6.8.diff also works on the 2.6.5 with a little offset ;-)

Summary of procedure

$ cd /usr/src/linux-2.6.8/;
$ patch -p1 -i ~/ttyrpld/kpatch/2.6.8.diff;
$ make menuconfig;

Run `make menuconfig` or anything else that suits your needs to choose "TTY logging via RPL hooks" in the "Security options" menu. For 2.4 where this menu does not exist, kpatch/2.4.21.diff adds it. If something goes wrong, well, let's hope you are able to edit a few lines of text according to the reject file. (If not, ask.)

 
Compiling the Kernel module >

After having booted the new Kernel, run make kmod in the root of the source directory. (Please note that you will need GNU make, version 3.80 or later.) The kmod target tries to figure out the current Kernel version and builds the Kernel module. If a wrong Kernel version is reported (for whatever reason), you can also run make from within the kernel-2.6 (or kernel-2.4) subdirectory.

Be sure to have /lib/modules/`uname -r`/build point to a valid and proper Linux Kernel source tree.

To load the module at boot time, edit your distribution specific startup scripts. A hint for SuSE users: it is in /etc/sysconfig/kernel. If you do not know where, ask someone who knows or simply put a `modprobe rpldev` into /etc/init.d/boot.local.

 
Compiling the user-space applications >

To compile the user-space tools, run make without any arguments. This will build rpld and ttyreplay (the daemon and the log analyzer).

You will need libHX to use ttyrpld since it makes use of advanced data storage and OS-independent libc functions.

You also need popt (and popt-devel), a library for option parsing. It is usually distributed alongside Redhat's Package Manager "RPM". If you distro does not use RPM, you might still find it in a separate package. (SuSE (uses RPM): popt-1.7-176.3.i586.rpm for example.)

 
Installing >

A `make install` target is provided and will install rpld and rplctl in /usr/local/sbin/, ttyreplay gets into /usr/local/bin/. You can of course put the programs in another place, but might need to adjust /etc/init.d/ttyrpld then.

You normally do not to create a device node, since rpld will open /proc/misc to see at which minor number the module has been registered and dynamically creates a node in the current directory (which is deleted shortly afterwards).