Main page | Install | ttyreplay(1) | rpldev(4) | rpl(5) | ttyrpld(7) | rplctl(8) | rpld(8) | Netlogging | Support


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. Non-GNU users might need some additional steps or different ways to unpack tar-bzip2 archives.

 
Patching the Kernel sources (Linux) >

This is probably the step most of you will hate, because it involves a recompile of the Kernel, or at least bzImage. However, I can't help this, as this is necessary. Once you have it prepared with the rpldev hooks, you will never need to do so again, until either you get a new Kernel tree or if the kpatches change. That way, you can upgrade ttyrpld, even rpldev(!) without a reboot.

The AS Kernel Patchset also contains the kpatch for Linux (same filesize), but may not be up to date with the one from ttyrpld, so please check that first if you use the AS_kernel.

You can find different Kernel patches in the kpatch folder, each targeting a different series and/or version. You can patch your Kernel source tree by issuing these commands:

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

Run `make menuconfig` or anything else that suits your needs to choose "TTY logging via rpldev" in the "Security options" menu.

Note: For Linux Kernels 2.4.x, the "TTY logging via rpldev" option is available in the "Character devices" menu.

 
Patching the Kernel sources (FreeBSD) >

The procedure is similar to the one needed for the Linux Kernel. The kpatch for FreeBSD is a little bigger than the one for Linux, since it has to add a close-per-fd method and coherent hooks for these. As such, not all of the exotic tty devices might be supported under FreeBSD.

$ cd /usr/src/sys/;
$ patch -p1 -i /usr/src/ttyrpld/kpatch/freebsd-5.3.diff;

... and rebuild the kernel image. No option needs to be enabled in conf. The procedure on how to build the Kernel under FreeBSD might vary from person to person, but I generally prefer to install all the src packages, and use:

$ cd /usr/src/;
$ make kernel

 
Patching the Kernel sources (OpenBSD) >

The process is not much different:

$ cd /usr/src/sys/;
$ patch -p1 -i /usr/src/ttyrpld/kpatch/openbsd-3.6.diff;

Rebuild as described in afterboot(8):

$ cd /usr/src/sys/arch/i386/conf/;
$ config GENERIC
$ cd ../compile/GENERIC
$ make depend
$ make
---
$ cp bsd /bsd && reboot

 
Compiling the Kernel module >

After having booted the new Kernel, run `make kmod` in the root of the source directory. Note that you will need GNU make, version 3.80 or later. It will try to compile, load and install the module.

You can tune the location of the Kernel sources and module installation path by using KERNEL_DIR=xxx and/or MODULES_DIR=xxx options to make, respectively.

BSD users have to use gmake; KERNEL_DIR and MODULES_DIR is not applicable for BSD, but you may cd into freebsd-5.3 by hand and run (bsd) make with any options you need. The kmod target will not install the module on FreeBSD.

OpenBSD users can skip this step, as they have a monolithic kernel.

To load the module at boot time, edit your distribution specific startup scripts. A hint for SUSE users: it is in /etc/sysconfig/kernel in MODULES_LOADED_ON_BOOT. If you do not know where, ask someone who knows or simply put a `modprobe rpldev` into /etc/init.d/boot.local. However, the supplied etc-init.d-rpld script (to be put as /etc/init.d/rpld) (for Linux/LSB) will be so kind to automatically load it.

There is currently a start script for rpld for Linux only.

 
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 string functions not present in libc.

You also need popt (and popt-devel) (version 1.7 or later), a library for option parsing. If your distro does not provide it, you may extract it from the tarball of Redhat's package manager "RPM". Furthermore, you also need libintl (aka gettext), which usually comes with glibc on Linux.

*BSD users are encouraged to use their ports archive.

It is recommended that you use gcc3. However, gcc2 can also be used with the following modifications under OpenBSD 3.6: put gcc instead of egcc in .Makefile.std.OpenBSD and remove the include .autodeps.inc line in GNUmakefile. Expect warnings due to bad-coded libc header files.

 
Installing >

A `make install` target is provided and will install ttyrpld into various places in ${ROOT}${PREFIX}. This probably needs some explanation: ROOT is a make variable which is prepended to all copy operations, etc., so you can use for example `make install ROOT=/var/netboot` to have everything installed under this alternative root directory.

The PREFIX make variable works almost the same, but is also used when constructing files. That is, if you run `make install PREFIX=/altdisk`, the init script will be adjusted to contain /altdisk/usr/sbin/rpld. By default, PREFIX contains /usr/local, so that binaries are installed to /usr/local/sbin. If you passed PREFIX=/usr instead, binaries would go into /usr/sbin/.

Locations are:
rpld, rplctl => ${ROOT}${PREFIX}/sbin/rpld
ttyreplay => ${ROOT}${PREFIX}/bin
Locale data => ${ROOT}${PREFIX}/share/locale

The configuration file will always get installed to ${ROOT}/etc/rpld.conf! If it already exists, it is not overwritten.

The init script (only Linux) will always get installed to ${ROOT}/etc/init.d/! However, it is not automatically activated to be run on bootup. Check your distribution's manual on how to do this. SUSE users get away with `insserv rpld`.

 
Device node >

Details are on the rpldev(4) manpage.

 

by Jan Engelhardt