Instrumented Test Kernel

Installation of the instrumented kernel

These instructions assume you have already installed Fedora 11, and can successfully run the normal kernel version (2.6.30.9-102.fc11) on your system.

1. Installing from binary packages

Download and install the appropriate modified RPMs for your hardware. Generally, you need only install the kernel and firmware RPMs. The devel and/or header RPMs may be needed if you have device drivers or other kernel extensions that need to be rebuilt. (For the curious, there are no actual changes in the firmware, devel or header RPMs, but to satisfy RPM dependency tracking, they are supplied here.)

Please be aware that this is early code, which is still undergoing testing and debugging. Expect some updates to this code over the next few weeks.

To install these packages, it is advisable to use "install" rather than "update," so that the unmodified versions are still available in case of need. Thus, for example:
sudo rpm -ivh kernel-PAE-2.6.30.9-102.usgtest.2.fc11.i686.rpm kernel-firmware-2.6.30.9-102.usgtest.2.fc11.i686.rpm

2. Installing from source

If your hardware falls out of the categories above, you will have to build the appropriate kernel from source. Here is the source package:

kernel-2.6.30.9-102.usgtest.2.fc11.src.rpm
To build and install the kernel, complete instructions are available here:
http://fedoraproject.org/wiki/Docs/CustomKernel
but in most cases, this brief summary should suffice:
  1. Do the build as an ordinary user rather than root; this ensures you don't change system files accidentally.
  2. Install necessary tools and set up the build tree:
    sudo yum install yum-utils rpmdevtools
    rpmdev-setuptree
  3. Download the source RPM above and install it:
    (download kernel-2.6.30.9-102.usgtest.2.fc11.src.rpm)
    sudo yum-builddep kernel-2.6.30.9-102.usgtest.2.fc11.src.rpm
    (install any needed packages)
    rpm -Uvh kernel-2.6.30.9-102.usgtest.2.fc11.src.rpm
  4. Build the binary RPM for your hardware configuration:
    cd ~/rpmbuild/SPECS
    rpmbuild -bb --with baseonly --with firmware --without debuginfo --target=`uname -m` kernel.spec
  5. Install the kernel RPM
    cd ~/rpmbuild/RPMS/(arch)
    sudo rpm -ivh kernel*usgtest*rpm
    (You can be more selective, if desired.)
Note: while, so far as we know, there are no architectural dependencies in the changes introduced, we have not tried any of this code on architectures other than those listed in the previous section.

3. Installing on other kernel versions

If for some reason you cannot or do not want to use the kernel version here, it may be possible to apply the usgtest patches to other versions. For this, you will need the source RPM for your kernel version and the following files from the usgtest source RPM:
SOURCES/linux-2.6-ipv6-usgtest.patch
SOURCES/config-generic
SPECS/kernel.spec
More precisely, you need the linux-2.6-ipv6-usgtest.patch set in its entirety, while for config-generic, you need only apply this patch:
*** config-generic.orig Fri Dec 11 09:20:24 2009
--- config-generic      Thu Dec 10 14:04:05 2009
***************
*** 797,802 ****
--- 797,803 ----
  CONFIG_IPV6_MULTIPLE_TABLES=y
  CONFIG_IPV6_MROUTE=y
  CONFIG_IPV6_PIMSM_V2=y
+ CONFIG_IPV6_USGTEST=y

  CONFIG_RDS=m
  # CONFIG_RDS_DEBUG is not set
And for the kernel.spec, you need only apply these patches:
*** kernel.spec.orig    Fri Dec 11 09:24:11 2009
--- kernel.spec Fri Dec 11 08:07:13 2009
***************
*** 15,21 ****
  # that the kernel isn't the stock distribution kernel, for example,
  # by setting the define to ".local" or ".bz123456"
  #
! #% define buildid .local

  # fedora_build defines which build revision of this kernel version we're
  # building. Rather than incrementing forever, as with the prior versioning
--- 15,21 ----
  # that the kernel isn't the stock distribution kernel, for example,
  # by setting the define to ".local" or ".bz123456"
  #
! %define buildid .usgtest.2

  # fedora_build defines which build revision of this kernel version we're
  # building. Rather than incrementing forever, as with the prior versioning
***************
*** 844,849 ****
--- 844,852 ----
  # rhbz#544144 [bbf31bf18d34caa87dd01f08bf713635593697f2]
  Patch16472: ipv4-fix-null-ptr-deref-in-ip_fragment.patch

+ # ipv6 usgtest testing hooks
+ Patch66666: linux-2.6-ipv6-usgtest.patch
+
  %endif

  BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root
***************
*** 1586,1591 ****
--- 1589,1597 ----
  # rhbz#544144
  ApplyPatch ipv4-fix-null-ptr-deref-in-ip_fragment.patch

+ # ipv6 usgtest testing hooks
+ ApplyPatch linux-2.6-ipv6-usgtest.patch
+
  # END OF PATCH APPLICATIONS

  %endif
Be advised that some work will no doubt be required to get these patches properly applied to other kernel versions. The more distant your version is from the source version (2.6.30.9-102), the more problems you can anticipate.

4. Set up grub to boot the desired kernel

Edit /boot/grub/grub.conf. Change as desired, though you'll probably want to change the timeout to some non-zero value (say, 5) and comment out the hiddenmenu line.

5. Reboot, choose the usgtest kernel, and check

After rebooting, open up a shell, and do the following:

$ uname -a
This should return a line with "usgtest" in the kernel version.
$ cd /proc/sys/net/ipv6/usgtest
$ ls
This should work :) and the directory should have a number of entries in it:
	bad_version             icmp_code_solicitation  multiple_options
	icmp_code_dad_neighbor  icmp_type_frag_length   odd_frag_lengths
	icmp_code_redirect      icmphdr_alt             prefix_lifetime
You now can (as root) alter these values as needed for testing. For the meaning of these entries, see the design documentation.