> Chad Carr wrote:
> Good job sending it here.  I am working on it.  I have attempted to
> apply the alg patches and tried to compile them.


Hello,

Chad, thanks for letting me know I'm not alone with problems compiling
Super-Freeswan user-mode apps for Bering kernel :-)

After much of trouble I have finally managed to compile Super-Freeswan
kb2 user mode applications for Bering V1.0 system. It did require 
some nasty hacks, but for now I can live with them.

In case anyone else is planning to use Super-Freeswan-kb2 LRP package
instead of normal Freeswan IPSEC.LRP then here is what I had to do
to compile user-mode apps for Bering (ie. pluto, whack etc apps).

Steps below are what eventually worked. I don't even bother to write
about those numerous side steps I did before I had everything in place 
:-)

Warning, long post below.


(1) Downloaded and installed UML virtual Linux environment.

Here is the link I used to download UML linux and related
tools http://leaf.sourceforge.net/devel/jnilo/uml03.html

The instructions talk about how to use host machines network
connection within UML virtual environment, but I didn't bother
to configure it. It's not really needed just to compile apps.

I downloaded Linux UML 2.4.18-45 base system and 
UML-Utilities-2002-07-21 packages. This combination seems to work.


(2) Downloaded the Debian SLink disk image for UML

This is LIBC-2.0.7 environment based on Debian. You can download
it from the same same link shown above.

Please note that "Woody" disk image environment uses LIBC-2.2.2, so you 
can't use it to compile user mode apps. However, you can use Woody to 
compile Linux kernel for Bering. However, you could use your host
full-scale-Linux-distro to compile the kernel itself for Bering.
Kernel doesn't use LIBC which I learn during this "quest to compile
SF LRP for Bering" :-)


(3) Started up SLink UML Linux and made room for sources

SLink disk image has very limited disk size, so I had to delete lots
of stuff to make room for Linux kernel 2.4.19 and Super-Freeswan-kb2
sources. I deleted all man pages, docs, X11 libs, games and lots of
other unnecessary stuff.

Another option would be to create a new UML disk image with larger
disk size, but I didn't want to go through the trouble creating one.

Eventually I did run out of disk space anyway :-)   Well, I solved
this by mounting a host system directory as a place for Kernel sources
within UML disk. This had an added bonus that I could use my favourite
text editors within host system to edit files for UML.

As a default SLink UML has static directory in /usr/include/asm and
/usr/include/linux. Remember to delete these (or rename) and create
a sym link to your new linux source tree.

   ln -s /usr/src/linux-2.4.19/include/asm-i386/ asm
   ln -s /usr/src/linux-2.4.19/include/linux/ linux

Well, in practice I have /usr/src/linux/ sym link pointing to
/usr/src/linux-2.4.19/ directory and I use this /usr/src/linux/ as
target in all other sym links. It's easier to change a kernel source
tree later on.

I downloaded also OpenSSL-0.9.6g sources and installed its include dir
as /usr/include/openssl/.  Super-Freeswan Blowfish module needs this
(www.openssl.org).


(4) Downloaded and compiled GCC-2.95.3 compiler for SLink UML

The stock SLink disk image comes with GCC-2.7.x compiler. I updated
this to GCC-2.95.3 compiler. I downloaded gcc-core-2.95.3.tar.gz
package from GNU web site and compiled and installed it using
the instructions in the package. Went without any troubles to my
surprise :-)

Note! Compiled and installed GCC-2.95.3 WITHIN SLink UML Linux,
not in the host system.


(5) First try to compile Super-Freeswan within SLink UML

Well, first compilation didn't work well. Freeswan/Super-Freeswan
sources didn't like stock LIBC-2.0.7 header files. Certain include
files and data types are missing.

It complains about uint8_t, __x86 and various other missing data types.
It also complains about missing stdint.h header file.


(6) Fixing missing data types and stdint.h file

The fix for missing stdint.h header files is easy. Just create an empty
file in /usr/include/stdint.h  (touch /usr/include/stdint.h).

The fix for missing uint8_t and __x86 data types is a bit more "nasty"
hack. It turn out that almost every Freeswan *.C file needs these
data types. Well, freeswan.h seems to contains these defs but in many
files it is included _after_ some other header file requires those types.

I decided to go through the easiest way and not to modify every 
Freeswan *.C file. I edited /usr/include/stdio.h header file :-)  
Uuuh, I head you saying.  Well, in case of SLink UML environment 
I don't mind editing stdio.h because it is sandbox environment anyway
and it can't screw up my host RedHad system.

This was the easiest way to fix the problem, because stdio.h is included
in every Freeswan file before it uses those missing data types.

I added #include <superfreeswan_hack.h> line at the beginning of
/usr/include/stdio.h file. And the hack file looks like this:

File: superfreeswan_hack.h
#ifndef __SUPERFREESWAN_HACK_H__
#define __SUPERFREESWAN_HACK_H__

#include <asm/processor.h>   /* Missing __x86 data types */

#define uint8_t  u_int8_t    /* Missing uintxxx types */
#define uint16_t u_int16_t
#define uint32_t u_int32_t
#define uint64_t u_int64_t

#endif


After this Super-Freeswan compiled without much troubles in
SLink UML with LIBC-2.0.7 environment.


(7) Final finishing touches to Super-Freeswan sources

Few minor problems still existed in Super-Freeswan sources, but
those were easy to fix. This is what I had to do the complete
the quest.

- Removed "-Werror" CFLAGS option from super-freeswan-kb2/testing/
utils/ikeping/Makefile file.

- Modified "--suffix=.old" INSTALL option in 
super-freeswan-kb2/Makefile.inc
file to use "-S.old" option. Looks like the /usr/bin/install version
in SLink UML doesn't understand --suffix option but it does understand
-S option.


(8) The final compilation and everything went smoothly

make menugo in Super-Freeswan directory, configuring Kernel options
in the usual way and voila, everything went just fine. 

If kernel compilation stops in error then it doesn't matter. 
You can do "make" and "make install" in pluto, klips/util and utils
directories within Super-Freeswan-kb2 directory tree to compile 
just user-mode apps. You probably don't want to compile kernel in
SLink libc-2.0.7 environment anyway.


Now I have Super-Freeswan LRP package for Bering LIBC-2.0.7 environment.
I wanted to have Super-Freeswan because of NAT traversal and ALG AES
patches.

I hope this long post is helpful for someone else who is trying to
re-compile freeswan/Super-Freeswan for Bering kernel. Remember to use
Bering modified IPSEC start scripts, because those are modified to use
"ip addr" cmd instead of "ifconfig" cmd which is missing from stock 
Bering root system.

Best regards,
 Mike


-- 
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup

One click access to the Top Search Engines
http://www.exactsearchbar.com/mailcom



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
------------------------------------------------------------------------
leaf-user mailing list: [EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/leaf-user
SR FAQ: http://leaf-project.org/pub/doc/docmanager/docid_1891.html

Reply via email to