Requirements
| Component | Minimum | Recommended, or better |
|---|---|---|
| libHX | 1.15 | 1.17 |
| GNU C Compiler | 3.3? | 4.x |
| iconv/libiconv | any | |
| gettext/libintl | any | |
| If you want to recreate the documentation: | ||
| gmake (for doc) | 3.79 | 3.81 |
| perl (for doc) | - | 5.6+ |
| php (for doc) | - | 5.x |
| w3m (for doc) | 0.5.0 | 0.5.1 |
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. There is currently no other way. Once you have it prepared with the rpldev hooks, you will never need to do so again, when you either get a new kernel tree or if the kpatches change (which is rare). That way, you can upgrade ttyrpld (userspace) or the rpldev kernel module without a reboot.
You can find different kernel patches in the
kpatch directory, each targeting a different series and/or
version. You can patch your kernel source tree by issuing these commands:
$ cd ~/src/linux-2.6.25/;
$ patch -p1 -i ~/src/ttyrpld/k_linux-2.6/rpldhk-2.6.25.diff;
$ make menuconfig;
Run make menuconfig or anything else that suits
your needs to choose "TTY logging via rpldev" in the
"Security options" 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 ~/src/ttyrpld/k_freebsd-7.0/rpldhk.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 and NetBSD)
The process is not much different:
$ cd /usr/src/sys/;
$ patch -p1 -i ~/src/ttyrpld/k_openbsd-4.3/rpldhk_rpldev.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
OpenBSD users can skip this step, as they have a monolithic kernel.
After having booted the new kernel, change to the appropriate
k_ directory for your operating system and run
make.
You can tune the location of the kernel sources and module
installation path by passing KERNEL_DIR=xxx and/or
MODULES_DIR=xxx parameters to make, respectively. After
successful compilation, load the module.
To load the module at boot time, edit your distribution
specific startup scripts. A hint for openSUSE 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
ttyrpld uses autoconf/automake (the latter of which is not entirely suiting my developer's needs, but whatever), so compiling and installing the user-space applications is a matter of running the two-step procedure:
./configure
make
You can optionally run `make install`, but it is
not strictly required.
FreeBSD specific hacks
FreeBSD does not have /usr/local in its default
include and link search directory list. Meh.
./configure CFLAGS="-I/usr/local/include"
LDFLAGS="-L/usr/local/lib"
OpenBSD specific hacks
Like FreeBSD, /usr/local is missing.
Additionally, OpenBSD's libintl.so.3.0 is missing a reference to
libiconv.so so you have to explicitly specify it:
./configure CFLAGS="-I/usr/local/include"
LDFLAGS="-I/usr/local/lib -liconv"
Device node
Details are on the rpldev(4) manpage.
