pptp client
 overview
 license
 getting started
 features
 try it
 download
 links
 documentation 
 index
 debian
 fedora core 1
 fedora core 2
 fedora core 3
 fedora core 4
 fedora core 5
 fedora core 6
 gentoo
 knoppix
 mandrake 9.0
 mandrake 10.0
 mandrake 10.1
 netbsd
 red hat 9
 red hat 8.0
 red hat 7.3
 suse 10.0
 suse 9.2
 suse 9.1
 suse 8.2
 ubuntu
 diagnosis
 support faq
 diagrams
 routing
 security
team
 developers
 cvs
 contact us
 

PPTP Client


Fedora Core 2 MPPE Kernel Build HOWTO
by James Cameron and John BouAntoun
30th May 2004


This describes how to rebuild the kernel on Fedora Core 2 to include MPPE support, for using PPTP. These instructions were taken from the Redhat 8 MPPE enabled kernel howto. It was tested on a system installed from CD-ROM, without updates. You will need software engineering build skills or lots of patience.

Strategy

  • use the kernel and PPP sources to make a source code patch relative to the kernel release,
  • apply the patch to the official kernel source RPM, and;
  • build a new binary RPM, install, reboot, and test.

Process Diagram

This diagram shows the process that is to be followed. The numbers in the yellow boxes correspond to steps in these instructions, but not all the steps are shown. Flat boxes are files or directories. Lines show the flow of data. The colours have been chosen to indicate various attributes:

  • provided file - a file that you obtain from this web site, Red Hat's web site, or from the Red Hat distribution CDs,
  • local directory - a directory on your system that will hold temporary files,
  • generated local file - a file that will be generated as a result of doing a process,
  • process - a command, or set of commands that you do.


Process Steps

  1. install the kernel source package (from CD #?? on Fedora Core 2):

    rpm -ivh kernel-source-2.6.5-1.358.i386.rpm

    Note: if you have a /usr/src/linux-2.6.5-1.358 directory already from a previous kernel build on this system, remove it or change the name. These instructions depend on the directory being created from the source RPM without any previous changes.

  2. duplicate source prior to generating the patch:

    cd /usr/src
    mkdir linux-2.6.5-1.358.orig
    cd linux-2.6.5-1.358
    tar cf - .|(cd ../linux-2.6.5-1.358.orig/;tar xf -)

  3. fetch PPP source kit (using anon cvs):

    cd /usr/src
    cvs -d :pserver:cvs@pserver.samba.org:/cvsroot co ppp/linux/mppe

  4. apply kernel patches:

    cd /usr/src/ppp/linux/mppe
    chmod +x mppeinstall.sh
    ./mppeinstall.sh /usr/src/linux-2.6.5-1.358

  5. optional method to determine changed file list:

    cd /usr/src
    rsync -av --dry-run linux-2.6.5-1.358/* linux-2.6.5-1.358.orig/

  6. generate patch relative to distributed source:

    cd /usr/src/
    find linux-2.6.5-1.358 -name "*.orig" -exec rm {} \;
    rm -f linux-2.6.5-ppp-2.4.2.patch
    diff --new-file --recursive --unified \
    linux-2.6.5-1.358.orig/drivers/net \
    linux-2.6.5-1.358/drivers/net > \
    linux-2.6.5-ppp-2.4.2.patch
    diff --new-file --recursive --unified \
    linux-2.6.5-1.358.orig/include/linux \
    linux-2.6.5-1.358/include/linux >> \
    linux-2.6.5-ppp-2.4.2.patch

  7. optional review of the patch:

    grep +++ linux-2.6.5-ppp-2.4.2.patch
    more linux-2.6.5-ppp-2.4.2.patch

    The patch affects the files listed below.

    drivers/net/arcfour.c drivers/net/arcfour.h drivers/net/Config.in drivers/net/Kconfig drivers/net/Makefile drivers/net/ppp_generic.c drivers/net/ppp_mppe_compress.c drivers/net/sha1.c drivers/net/sha1.h include/linux/ppp-comp.h

    The file ppp-comp.h is included by other kernel modules, but the patch only adds new text used by the other files patched. It may be possible to distribute the kernel modules only. Advice from others is welcome!

  8. install source kit for kernel (from CD #??):

    rpm -i kernel-2.6.5-1.358.src.rpm

  9. copy patch to SOURCES:

    cp linux-2.6.5-ppp-2.4.2.patch /usr/src/redhat/SOURCES/

  10. adjust kernel-2.6.spec, change release version, include patch:

    cd /usr/src/redhat/SPECS
    cp kernel-2.6.spec kernel-2.6.spec.orig
    patch << EOF
    --- kernel-2.6.spec.orig	2004-05-08 22:34:31.000000000 +1000
    +++ kernel-2.6.spec	2004-05-27 16:06:26.000000000 +1000
    @@ -20,7 +20,8 @@
     %define kversion 2.6.%{sublevel}
     %define rpmversion 2.6.%{sublevel}
     %define rhbsys  %([ -r /etc/beehive-root ] && echo  || echo .`whoami`)
    -%define release %(R="$Revision: 1.358 $"; RR="${R##: }"; echo ${RR%%?})%{rhbsys}
    +%define release %(R="$Revision: 1.358 $"; RR="${R##: }"; echo ${RR%%?})mppe
     
     %define KVERREL %{PACKAGE_VERSION}-%{PACKAGE_RELEASE}
     
    @@ -258,6 +260,8 @@
     Patch10000: linux-2.6.0-compile.patch
     # Patch10010: linux-2.6.0-module-license.patch
     
    +# added by jba for ppp mppe patch
    +Patch10100: linux-2.6.5-ppp-2.4.2.patch
     # END OF PATCH DEFINITIONS
     
     BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root
    @@ -529,11 +533,17 @@
     #
     %patch10000 -p1
     
    +
     #
     # Add MODULE_LICENSE() where it's missing
     #
     # %patch10010 -p1
     
    +#
    +# PPP MPPE support
    +#
    +%patch10100 -p1
    +
     
     # END OF PATCH APPLICATIONS
     
    @@ -660,7 +670,8 @@
     
         # detect missing or incorrect license tags
         for i in `find $RPM_BUILD_ROOT/lib/modules/$KernelVer -name "*.ko" ` ; do echo -n "$i " ; /sbin/modinfo -l $i >> modinfo ; done
    -    cat modinfo | grep -v "^GPL" | grep -v "^Dual BSD/GPL" | grep -v "^Dual MPL/GPL" | grep -v "^GPL and additional rights" | grep -v "^GPL v2" && exit 1 
    +    # added "BSD without advertisement clause" to licenses allowed
    +    cat modinfo | grep -v "^GPL" | grep -v "^Dual BSD/GPL" | grep -v "^Dual MPL/GPL" | grep -v "^GPL and additional rights" | grep -v "^GPL v2" | grep -v "BSD without advertisement clause" && exit 1 
         rm -f modinfo
         # remove files that will be auto generated by depmod at rpm -i time
         rm -f $RPM_BUILD_ROOT/lib/modules/$KernelVer/modules.*
    EOF
    

    Packaging issue, can't figure out how to patch for config change that adds CONFIG_PPP_MPPE.

    • ppp 2.4.2 patches only drivers/net/Makefile and drivers/net/Config.in

    • kernel 2.6.5 red hat kernel-source.rpm CONFIG_PPP_DEFLATE appears in Documentation/Configure.help configs drivers/net/Config.in drivers/net/Makefile include/linux/autoconf.h lib/Config.in and .config

    • interim rpmbuild BUILD tree at point of patch failure has CONFIG_PPP_DEFLATE appearing in lib/Config.in drivers/net/Makefile drivers/net/Config.in various defconfig files Documentation/Configure.help

    So we guess we just patch the config file!

  11. patch the configuration files for the kernel version:

    cd /usr/src/redhat/SOURCES
    for kcfg in kernel-2.6.5-i686*.config
    do
    patch << EOF
    --- $kcfg.orig
    +++ $kcfg
    @@ -674,6 +674,7 @@
     CONFIG_PPP_ASYNC=m
     CONFIG_PPP_SYNC_TTY=m
     CONFIG_PPP_DEFLATE=m
    +CONFIG_PPP_MPPE=m
     # CONFIG_PPP_BSDCOMP is not set
     # CONFIG_PPPOE is not set
     CONFIG_SLIP=m
    
    EOF
    done
    

  12. build the kernel:

    cd /usr/src/redhat/SPECS
    time \
    rpmbuild -ba --target=i686 kernel-2.6.spec

    Note: we've assumed i686 processor type in these instructions. You may need another processor type. Change the references accordingly.

  13. install the kernel:

    rpm -ivh /usr/src/redhat/RPMS/i586/kernel-2.6.5-1.358mppe.i586.rpm

  14. if this system has previously had an MPPE kernel module set installed, ensure that /etc/modules.conf is correct ... tests so far suggest that these lines are no longer required:

    alias ppp-compress-18 ppp_mppe
    alias ppp-compress-21 bsd_comp
    alias ppp-compress-24 ppp_deflate
    alias ppp-compress-26 ppp_deflate
    alias char-major-108 ppp_generic

    Note: we are not aware of anything that actually needs to be in the modules.conf file. The association between ppp-compress-18 and the ppp_mppe module is already integrated into the kernel module utilities. There are many old web sites that don't take this into account.

  15. reboot:

    reboot

  16. test that the module loads:

    modprobe ppp-compress-18

    The expected output is:

    Warning: loading /lib/modules/2.6.5-1.358mppe/kernel/drivers/net/ppp_mppe.o will taint the kernel: non-GPL license - BSD without advertisement clause
    See http://www.tux.org/lkml/#export-tainted for information about tainted modules
    Module ppp_mppe loaded, with warnings

    Notes:

  1. return to the prebuilt RPM document; you have now completed steps 1a, 1b, and 1c on that document, you should now proceed from step 1d and install PPP.

Comments

If you have comments on this document, please send them to the author at james.cameron at hp.com.

ChangeLog

DateChange
2004-10-27 Better explain the non-requirement to edit the modules.conf file, reported by Eric V. Smith.

2004-09-24 Fix link typo reported by Eric V. Smith.

2004-05-30 First draft taken from Red Hat 8 kernel build howto.