Installation ============ These installation instructions are written with a standard Linux kernel from kernel.org in mind. Albert Pauw kindly provided installation instructions for Red Hat Linux. See the README.RedHat file for details. SuSE refused to give me information about their kernel free of charge but Stefan Onken and Thomas Hertweck provided some advice on the SuSE Linux mailing list. The right way to compile this package is: 1. The build process requires the kernel source and the C compiler that were used to build your Linux kernel. You must make sure that the kernel source is installed and you must make sure that the configuration of the kernel source matches the configuration of your kernel. Your kernel has to be configured to accept loadable modules. The following command, that you can run in a terminal window, outputs your kernel version: uname -r By default, the `configure' script searches in the following places for the kernel source: /lib/modules/`uname -r`/build /usr/src/linux /usr/src/linux-`uname -r` /usr/src/kernel-source-`uname -r` The shell replaces `uname -r` with the actual kernel version. One user reported problems when building the `pcfclock' driver with GCC 3.0 for a kernel that was built with GCC 2.95. Please make sure that the driver is built with the same GCC release, i.e. the same C compiler, that was used to build your Linux kernel. On SuSE Linux systems, the kernel source can be found in a package named kernel-source-2.x.y-z.i586.rpm where x and y must match your kernel version. Thomas Hertweck recommends to always use the kernel source package from the medium, e.g. the DVD, that was used to install your system, to avoid problems. See http://www.thomashertweck.de/kernel.html, for more information (in German and Italian). Red Hat seems to distribute a modified kernel source that adds a "custom" suffix to the variable EXTRAVERSION in the kernel makefile. You might have to remove or replace this suffix depending on your kernel configuration. Please see README.RedHat for details. Information about the standard Linux kernel is available at http://www.kernel.org/. Another source of information is the `Linux Kernel HOWTO' which is available at http://www.tldp.org/HOWTO/Kernel-HOWTO/. If the file /proc/config.gz exists you can use that file to configure your kernel source. Otherwise, you have to look for the kernel configuration. Often, the configuration is stored in a file named /boot/config-`uname -r`. Here are two examples that show how to configure the kernel source. In the first example, which is for Linux 2.6, the configuration is copied from /proc/config.gz to the kernel source directory. cd /usr/src/linux-2.6.5 zcat /proc/config.gz >.config make oldconfig make prepare The second example uses a configuration file named /boot/config-2.4.26 instead of /proc/config.gz to configure a Linux 2.4 kernel source: cd /usr/src/linux-2.4.26 cp /boot/config-2.4.26 .config make oldconfig make dep Please consult the documentation that comes with your GNU/Linux distribution or ask your vendor if you don't know how to get the kernel source that matches your kernel or if you don't know which version of GCC to use. 2. `cd' to the directory containing the `pcfclock' source code and type `sh configure' to configure the package for your system. Since the `pcfdate' utility is usually run at boot time, you might want to install `pcfdate' in `/sbin' by giving `configure' the option `--sbindir=/sbin'. `configure' recognizes the following non-standard options that you may have to specify if your kernel source is in an unusual place or if you don't want to build the `pcfclock' driver. `--with-linux=DIR' Use the kernel source in the given directory. `--without-linux' Do not build the `pcfclock' driver. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. In particular, verify that `configure' detects your kernel source directory. The Linux version detected by `configure' should match the output of the `uname -r' command. Example output: checking for Linux kernel source... /lib/modules/2.6.5/build checking Linux version... 2.6.5 3. Type `make' to compile the package. 4. Become super-user and type `make install' to install the `pcfclock' driver, the `pcfdate' utility and the manual pages. Read the manual pages by issuing the commands `man pcfclock' and `man pcfdate'. 5. Add the line `alias char-major-181 pcfclock' to `/etc/modules.conf' if the kernel module loader is enabled. Otherwise, make sure that the `pcfclock' driver is loaded at boot time. On Debian systems, the names of modules that are to be loaded at boot time can be stored in the '/etc/modules' file. 6. Type `depmod -ae'. 7. Type `modprobe pcfclock' to load the device driver. 8. If the Linux Device Filesystem is mounted the device files are available in the `pcfclocks' subdirectory of the device filesystem. The old-style device files may be created with: mknod -m 444 /dev/pcfclock0 c 181 0 mknod -m 444 /dev/pcfclock1 c 181 1 mknod -m 444 /dev/pcfclock2 c 181 2 9. Run `pcfdate' to verify that the device driver works. 10. Create an init script that runs `pcfdate -s'. Usually there's a template in /etc/init.d that you can copy. A minimal init script: #!/bin/sh test -x /sbin/pcfdate || exit 0 set -e case "$1" in start) /sbin/pcfdate -q -s ;; esac exit 0 Make sure that the init script is run after the hardware clock has been read but before `ntpd' is started. Never run `pcfdate' via cron to set the system time. `pcfdate' causes a sudden jump forwards or backwards, which can cause a variety of problems in a system. On Debian systems, the command `update-rc.d' can be used to enable init scripts. For example, an init script named `/etc/init.d/pcfdate' can be enabled with: update-rc.d pcfdate start 51 S . 11. You might want to add your radio clock to `/etc/ntp.conf' to synchronise your computer's clock with the radio clock: server 127.127.35.0 By default, the radio clock is only used as a reference clock if the last attempt to receive the time signal succeeded. Add the following line to `/etc/ntp.conf' if the reception fails often in your environment: fudge 127.127.35.0 flag2 1 NTP can usually be restarted with a command such as /etc/init.d/ntp restart /etc/init.d/ntpd restart /etc/init.d/xntpd restart Wait a couple of minutes and check NTP by running the command ntpq -p Note that the parallel port radio clock's internal quartz clock isn't very precise. As a consequence, NTP may regularly write the following message to the syslog: Nov 29 11:47:10 homer ntpd[110]: synchronisation lost Nov 29 12:43:15 homer ntpd[110]: time reset -0.185182 s If you have a permant connection to the Internet, e.g. a DSL connection, I recommend to use a public NTP server instead of the parallel port radio clock to synchronise your computer's clock. 12. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. If you don't want to build the pcfclock driver as a loadable kernel module you can add the driver to the Linux 2.6 kernel source: 1. Copy `linux/pcfclock.c' to `/usr/src/linux/drivers/char/'. 2. `Cd' to `/usr/src/linux/drivers/char/'. 3. Edit `Makefile'. Insert the following line just before the line containing `CONFIG_PPDEV'. obj-$(CONFIG_PCFCLOCK) += pcfclock.o 4. Edit the `Kconfig' file. Insert the following text just before the line starting with `config PPDEV'. config PCFCLOCK tristate "Conrad parallel port radio clock support" depends on PARPORT ---help--- Saying Y to this adds support for the parallel port radio clock sold by Conrad Electronic under order number 967602. See for more information. If unsure, say N. 5. `Cd' to `/usr/src/linux/'. Run `make menuconfig'. Go to `Device Drivers --> Character Devices' and enable the Conrad parallel port radio clock. Save the kernel configuration. Build and install your new kernel.