Re: Installing IMQ on Redhat 9 (Kernel version 2.4.20)

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I also use RH9 and ran into the same problem. Here are my fragments notes
and thoughts about how I got to work on my system which by the way, IMQ is
running great for me. :) Some of these notes I copied from other websites,
some I wrote myself. I hope the following notes help you out.

Walt Wyndroski

Adding IMQ support to RH9 kernel and iptables AND LAYER7 support to kernel
and iproute2:

rpm -q iptables
rpm -e iptables-<<version>>

download & decompress latest version of iptables
download & decompress latest version of patch-o-matic

copy the imq diff patch to the patch-o-matic directory
run -> patch -p1 < <<imq diff patch>> (in patch-o-matic directory)
    NOW FOLLOW THIS CLOSELY BEFORE DOING ANY PATCH-O-MATIC STUFF!!!:
        1. apply the patch imq2-2.4.21.diff to Linux source tree
        2. extract the patch-o-matic-20030107 source tree on the same
physical
           partition where your kernel source resides
        3. within patch-o-matic-20030107, extract this tarball
        4. extract the iptables-1.2.8 source tree in the same directory
prefix as
           patch-o-matic-20030107
        5. rename iptables-1.2.8 toplevel directory to 'userspace'

        Now, proceed with the standard patch-o-matic patch-installation
instructions.
        Note, this tarball offers two NETFILTER patches, both within the
'userspace'
        suite (since they also patch userland source - iptables):
'IMQ.patch'
        and 'IMQ2.patch'. So, for example, if you need to install them
        non-interactively, then from within the 'patch-o-matic-20030107'
toplevel
        directory, issue:

                USE FOR KERNEL_DIR:  /usr/src/linux-<kernel-version> WHEN
ASKED FOR KERNEL_DIR!!!
        ./runme --batch userspace/IMQ.patch
        ./runme --batch userspace/IMQ.ipv6.patch

        After that, please be sure to do the following (unfortunately,
patch-o-matic
        does not handle this itself):

        chmod 0755 ../userspace/extensions/.IMQ*

run -> KERNEL_DIR=<<your kernel_dir>> ./runme userspace/IMQ.patch
    --this places ipt_IMQ.so in
/usr/src/linux-2.4.20-20.9/net/ipv4/netfilter
    --will need to copy this file to /usr/src/redhat/BUILD/
run -> KERNEL_DIR=<<your kernel_dir>> ./runme base (this will allow addition
of any other iptables patches)

Copy the config matching your kernel from /boot to
/usr/src/linux/2.4.20-20.9/configs
Append the following lines to the config you copied over

CONFIG_NET_CLS_LAYER7=m
CONFIG_IMQ=m
CONFIG_IP_NF_TARGET_IMQ=m



RPM Kernel Compiling Instructions: (Forget it! - see below)

NOTE: I successfully got the kernel patched when using the rpmbuild method,
but could never get the netfilter modules to build correctly after
everything was said and done. So I opted to take someone else's advice and
use the manual method while maintaining a stock RH kernel. See below.
On Redhat, instead of using 'make' commands you can use rpm command to build
kernel. If you want to build binary RPMs (kernel*.i386.rpm), do this:

  1.. Install kernel*.src.rpm
  2.. cd /usr/src/redhat/SPECS
  3.. Copy the IMQ patch and Layer7 patches to the /usr/src/redhat/SOURCES
directory
  4.. Edit the kernel*.spec file to include the following:
      place the patch definition entries in the 5200 section, follow the
syntax and use the patch filename for the entry
          place the "patch command" further down in the file also following
the surrounding syntax
  5.. rpmbuild -ba kernel*.spec # or rpm -ba kernel*.spec # for old systems
  6.. cd /usr/src/redhat/i386; rpm -ivh kernel*.rpm (you may have to
use --force --nodeps)
Manual Compiling Instructions:

First patch your kernel with the imq kernel patch and layer7 patch
Now copy the config of the kernel (which you boot with) from /boot to
/usr/src/linux-x.x.x.x/configs
Just make sure to load that specific config when you run make xconfig.

1) cd /usr/src/linux/<kernel-version>
2) edit Makefile, pick a good name for your kernel with the EXTRAVERSION
var.
3) make mrproper && make clean  # start fresh
4) cp configs/kernel-2.4.20-athlon.config .config  # (I have an athlon)
    this step didn't work for me. I simply moved all the configs to another
directory and
    copied the one I wanted from /boot to the configs dir. That way I only
had one config
    to worry with.
5) make xconfig
    make sure to manually load the config you copied over from /boot
6) make dep && make clean && make bzImage
7) make modules && make modules_install && make install
8) cp .config /boot/config-2.4.20-8_YOUR_KERNEL_NAME

The "make install" step might be controversial because I don't see it
mentioned much.  It might be new (?).  It worked for me, however, neatly
updating /boot with the image and system map, as well as updating
/etc/lilo.conf

The "make clean" after "make dep" may be unnecessary but it doesn't seem
to hurt.

Note that the resulting image fails to binary-compare to the stock image,
so strictly speaking I haven't recreated the image.  Not sure of reasons
for the differences - possibilities include a different environment at
RedHat, timestamps within the image, and kernel name within the image.
But it seems to boot the same.


Download, compile, and install the layer7 patched version of iproute2 ( more
specifically, tc)

    also get the latest layer7 definitions download


Walt Wyndroski

----- Original Message ----- 
From: "rAcHeL ^cY" <rachelcy@xxxxxxxxxxx>
To: <lartc@xxxxxxxxxxxxxxx>
Sent: Tuesday, October 21, 2003 4:25 AM
Subject:  Installing IMQ on Redhat 9 (Kernel version 2.4.20)


> Hi,
>
> I need some help from everyone.
>
> How can i install the IMQ on redhat 9?
> I downloaded the patch from
http://trash.net/~kaber/imq/index.html#sources,
> which include :
> IMQ patch - http://trash.net/~kaber/imq/linux-2.4.21-imq-1.diff
> Patch against netfilter - http://trash.net/~kaber/imq/pom-20030625.diff
>
> I try to get the src.rpm of kernel-2.4.20 and run it (rpm -i
> kernel-2.4.20.20-9.src.rpm) and i added both patches i downloaded earlier
> into the /usr/src/redhat/SPEC/kernel-2.4.spec.
>
> Then i run rpmbuild -ba kernel-2.4.spec, and i got the new rpm files under
> /usr/src/redhat/RPMS folder.
>
> I had install the new kernel rpm in that folder, but seems still can't get
> IMQ to work, please help!
>
> Is there any easier way to make the IMQ work on Redhat 9?
>
> I will appreciate if someone can help me on this, thank you very much!!!!!
>
>
> Rachel
>
> _________________________________________________________________
> Using a handphone prepaid card? Reload your credit online!
> http://www.msn.com.my/reloadredir/default.asp
>
> _______________________________________________
> LARTC mailing list / LARTC@xxxxxxxxxxxxxxx
> http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
>
>
****************************************************************************
******************
> * This message has been scanned by CityNET's email scanner for viruses and
dangerous content *
> * and is believed to be clean.  CityNET is proud to use MailScanner.  For
more information   *
> * concerning MailScanner, visit http://www.mailscanner.info
*
>
****************************************************************************
******************
>



**********************************************************************************************
* This message has been scanned by CityNET's email scanner for viruses and dangerous content *
* and is believed to be clean.  CityNET is proud to use MailScanner.  For more information   *
* concerning MailScanner, visit http://www.mailscanner.info                                  *
**********************************************************************************************

_______________________________________________
LARTC mailing list / LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux