Hi Matthew,

Did you get an error even you compiled driver using gcc 3.4.3 which
comes with SUNWgcc?
What's cpu architecture of your machine?
Please let me know the outputs of 'isainfo -kv'.

  # /usr/bin/isainfo -kv

At least I've succeeded in building tun/tap driver with osol0906 on
'i386' and 'amd64'
architecture using gcc 3.4.3 which comes with SUNWgcc package.
And I didn't modify Makefile and configure script at all.
(See my command logs below)

But if configure.in and/or Makefile.in needs to be modified for
certain condition,  I will
update it and put it to my site.

Thanks,

Kazuyoshi

## i386 case ###
root at opensolaris:/var/tmp/tuntap# isainfo -kv
32-bit i386 kernel modules
root at opensolaris:/var/tmp/tuntap# cat /etc/release
                         OpenSolaris 2009.06 snv_111b X86
           Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
                        Use is subject to license terms.
                              Assembled 07 May 2009
root at opensolaris:~# gcc  --version
gcc (GCC) 3.4.3 (csl-sol210-3_4-20050802)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
root at opensolaris:/var/tmp/tuntap# make
gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\"
-DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DTUN_VER=\"1.1\
11/10/2009\" -g -O2 -Wall -D_KERNEL -I. -c tun.c -o tun.o -DTUNTAP_TUN
ld  -r -o tun tun.o
gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\"
-DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DTUN_VER=\"1.1\
11/10/2009\" -g -O2 -Wall -D_KERNEL -I. -c tun.c -o tap.o -DTUNTAP_TAP
ld  -r -o tap tap.o
root at opensolaris:/var/tmp/tuntap# make install
/usr/bin/ginstall -c -d -m 0755 -o root -g bin /usr/include/net
/usr/bin/ginstall -c -d -m 0755 -o root -g sys /usr/kernel/drv
/usr/bin/ginstall -c -m 644 -o root -g root if_tun.h /usr/include/net
/usr/bin/ginstall -c -m 644 -o root -g root tun /usr/kernel/drv
/usr/bin/ginstall -c -m 644 -o root -g root tap /usr/kernel/drv
/usr/bin/ginstall -c -m 644 -o root -g root tun.conf /usr/kernel/drv
/usr/bin/ginstall -c -m 644 -o root -g root tap.conf /usr/kernel/drv
[ -z "" ]&& /usr/sbin/rem_drv tun >/dev/null 2>&1
[ -z "" ]&& /usr/sbin/rem_drv tap >/dev/null 2>&1
[ -z "" ]&& /usr/sbin/add_drv tun
[ -z "" ]&& /usr/sbin/add_drv tap

## amd64 Case ###
root at osol0906:/var/tmp/tuntap# cat /etc/release
                         OpenSolaris 2009.06 snv_111b X86
           Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
                        Use is subject to license terms.
                              Assembled 07 May 2009
root at osol0906:/var/tmp/tuntap# isainfo -kv
64-bit amd64 kernel modules
root at osol0906:/var/tmp/tuntap# gcc --version
gcc (GCC) 3.4.3 (csl-sol210-3_4-20050802)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
root at osol0906:/var/tmp/tuntap# make
gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\"
-DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DTUN_VER=\"1.1\
11/10/2009\" -g -O2 -Wall -m64 -mcmodel=kernel -mno-red-zone -D_KERNEL
-I. -c tun.c -o tun.o -DTUNTAP_TUN
ld -melf_x86_64 -r -o tun tun.o
gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\"
-DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DTUN_VER=\"1.1\
11/10/2009\" -g -O2 -Wall -m64 -mcmodel=kernel -mno-red-zone -D_KERNEL
-I. -c tun.c -o tap.o -DTUNTAP_TAP
ld -melf_x86_64 -r -o tap tap.o
root at osol0906:/var/tmp/tuntap# make install
/usr/bin/ginstall -c -d -m 0755 -o root -g bin /usr/include/net
/usr/bin/ginstall -c -d -m 0755 -o root -g sys /usr/kernel/drv/amd64
/usr/bin/ginstall -c -m 644 -o root -g root if_tun.h /usr/include/net
/usr/bin/ginstall -c -m 644 -o root -g root tun /usr/kernel/drv/amd64
/usr/bin/ginstall -c -m 644 -o root -g root tap /usr/kernel/drv/amd64
/usr/bin/ginstall -c -m 644 -o root -g root tun.conf /usr/kernel/drv
/usr/bin/ginstall -c -m 644 -o root -g root tap.conf /usr/kernel/drv
[ -z "" ]&& /usr/sbin/rem_drv tun >/dev/null 2>&1
make: [install] Error 1 (ignored)
[ -z "" ]&& /usr/sbin/rem_drv tap >/dev/null 2>&1
make: [install] Error 1 (ignored)
[ -z "" ]&& /usr/sbin/add_drv tun
[ -z "" ]&& /usr/sbin/add_drv tap

2009/11/10 Matthew Carras <matthew.carras at gmail.com>:
> First off, I'm new to OpenSolaris so I don't know where best to send
> this email, so I'm sending it to opensolaris-help at opensolaris.org.
>
> Problem: OpenSolaris 2009.06/Indiana does not come with vtun
> (http://vtun.sourceforge.net/tun/index.html) and has no mainstream
> package for it (The packages on Blastwave were insufficient). This is
> needed to properly use OpenVPN. I couldn't exactly find the solution
> on the web, as they all gave a "failed to attach" from devfsadm -i tun
> with my 64-bit kernel. Here's the solution I finally figured out, done
> on a fresh install of OpenSolaris 2009.06:
>
> $ pfexec pkg install SUNWgcc
> $ cd $HOME
> $ wget http://www.oberhumer.com/opensource/lzo/download/lzo-2.03.tar.gz
> $ tar xzvf lzo-2.03.tar.gz
> $ cd lzo-2.03
> $ ./configure
> $ make
> $ pfexec make install
> $ cd $HOME
> $ wget http://www.whiteboard.ne.jp/~admin2/tuntap/source/tuntap/tuntap.tar.gz
> $ tar zxvf tuntap.tar.gz
> $ cd tuntap
>
> Now you need to change the configure.in and Makefile.in file to make
> sure the drivers are also loaded onto the /platform directory, and add
> module compilation support.
>
> ** change this part of configure.in file:
> ---------------------------------------------------
> case $KARCH in
> ? ? 'sparc' | 'i386')
> ? ? ? ?DRV_DIR="/usr/kernel/drv"
> ? ? ? ?PLAT_DRV_DIR="/platform/`uname -m`/kernel/drv"
> ? ? ? ?;;
> ? ? ?'sparcv9')
> ? ? ? ?CFLAGS="$CFLAGS -m64"
> ? ? ? ?DRV_DIR="/usr/kernel/drv/sparcv9"
> ? ? ? ?PLAT_DRV_DIR="/platform/`uname -m`/kernel/drv/sparcv9"
> ? ? ? ?if test -n "$IS_GNU_LD";
> ? ? ? ?then
> ? ? ? ? ? ? ? ?LD_OPT="-melf64_sparc"
> ? ? ? ?fi
> ? ? ? ?;;
> ? ? ?'amd64')
> ? ? ? ?if test "$GCC" = yes; then
> ? ? ? ? ? ? ? ?CFLAGS="$CFLAGS -m64 -mcmodel=kernel -mno-red-zone"
> ? ? ? ?else
> ? ? ? ? ? ? ? ?CFLAGS="$CFLAGS -m64 -xmodel=kernel"
> ? ? ? ?fi
> ? ? ? ?DRV_DIR="/usr/kernel/drv/amd64"
> ? ? ? ?PLAT_DRV_DIR="/platform/`uname -m`/kernel/drv/amd64"
> ? ? ? ?if test -n "$IS_GNU_LD";
> ? ? ? ?then
> ? ? ? ? ? ? ? ?LD_OPT="-melf_x86_64"
> ? ? ? ?fi
> ? ? ? ?;;
> esac
> ---------------------------------------------------
>
> ** change these parts of the Makefile.in file:
> ---------------------------------------------------
> DRV_DIR = @DRV_DIR@
> DRV_CONF_DIR = /usr/kernel/drv
> PLAT_DRV_DIR = @PLAT_DRV_DIR@
> PLAT_DRV_CONF_DIR = "/platform/`uname -m`/kernel/drv"
>
> ....
>
> modules: tun.o tap.o
> ? ? ? ?$(LD) $(LD_FLAGS) -r -o tun tun.o
> ? ? ? ?$(LD) $(LD_FLAGS) -r -o tap tap.o
>
> ....
>
> install: tun tap
> ? ? ? ?$(INSTALL) -d -m 0755 -o root -g bin $(DESTDIR)/usr/include/net
> ? ? ? ?$(INSTALL) -d -m 0755 -o root -g sys $(DESTDIR)$(DRV_DIR)
> ? ? ? ?$(INSTALL) -d -m 0755 -o root -g sys $(DESTDIR)$(PLAT_DRV_DIR)
> ? ? ? ?$(INSTALL) -m 644 -o root -g root if_tun.h $(DESTDIR)/usr/include/net
> ? ? ? ?$(INSTALL) -m 644 -o root -g root tun $(DESTDIR)$(DRV_DIR)
> ? ? ? ?$(INSTALL) -m 644 -o root -g root tap $(DESTDIR)$(DRV_DIR)
> ? ? ? ?$(INSTALL) -m 644 -o root -g root tun $(DESTDIR)$(PLAT_DRV_DIR)
> ? ? ? ?$(INSTALL) -m 644 -o root -g root tap $(DESTDIR)$(PLAT_DRV_DIR)
> ? ? ? ?$(INSTALL) -m 644 -o root -g root tun.conf $(DESTDIR)$(DRV_CONF_DIR)
> ? ? ? ?$(INSTALL) -m 644 -o root -g root tap.conf $(DESTDIR)$(DRV_CONF_DIR)
> ? ? ? ?$(INSTALL) -m 644 -o root -g root tun.conf
> $(DESTDIR)$(PLAT_DRV_CONF_DIR)
> ? ? ? ?$(INSTALL) -m 644 -o root -g root tap.conf
> $(DESTDIR)$(PLAT_DRV_CONF_DIR)
> ? ? ? ?-[ -z "$(DESTDIR)" ]&& $(REM_DRV) tun >/dev/null 2>&1
> ? ? ? ?-[ -z "$(DESTDIR)" ]&& $(REM_DRV) tap >/dev/null 2>&1
> ? ? ? ?-[ -z "$(DESTDIR)" ]&& $(ADD_DRV) tun
> ? ? ? ?-[ -z "$(DESTDIR)" ]&& $(ADD_DRV) tap
>
> uninstall:
> ? ? ? ?-[ -z "$(DESTDIR)" ]&& $(REM_DRV) tun >/dev/null 2>&1
> ? ? ? ?-[ -z "$(DESTDIR)" ]&& $(REM_DRV) tap >/dev/null 2>&1
> ? ? ? ?-[ -z "$(DESTDIR)" ]&& $(RM) $(DESTDIR)$(DRV_CONF_DIR)/tun.conf
> ? ? ? ?-[ -z "$(DESTDIR)" ]&& $(RM) $(DESTDIR)$(DRV_CONF_DIR)/tap.conf
> ? ? ? ?-[ -z "$(DESTDIR)" ]&& $(RM) $(DESTDIR)$(PLAT_DRV_CONF_DIR)/tun.conf
> ? ? ? ?-[ -z "$(DESTDIR)" ]&& $(RM) $(DESTDIR)$(PLAT_DRV_CONF_DIR)/tap.conf
> ? ? ? ?-[ -z "$(DESTDIR)" ]&& $(RM) $(DESTDIR)$(DRV_DIR)/tun
> ? ? ? ?-[ -z "$(DESTDIR)" ]&& $(RM) $(DESTDIR)$(DRV_DIR)/tap
> ? ? ? ?-[ -z "$(DESTDIR)" ]&& $(RM) $(DESTDIR)$(PLAT_DRV_DIR)/tun
> ? ? ? ?-[ -z "$(DESTDIR)" ]&& $(RM) $(DESTDIR)$(PLAT_DRV_DIR)/tap
> ---------------------------------------------------
>
> Now we can do:
>
> $ ./configure
> $ make
> $ pfexec make install
> $ cd $HOME
> $ wget http://www.openvpn.net/release/openvpn-2.1_rc20.tar.gz
> $ tar xvzf openvpn-2.1_rc20.tar.gz
> $ cd openvpn-2.1_rc20
> $ wget 
> http://www.whiteboard.ne.jp/~admin2/tuntap/source/openvpn/2.1/patch.openvpn.2.1_rc16.tun.c
> $ patch tun.c patch.openvpn.2.1_rc16.tun.c
> $ ./configure -with-lzo-lib=/usr/local/lib
> $ make
> $ pfexec make install
> $ pfexec ln -s /usr/local/share/man/man8/openvpn.8 
> /usr/share/man/man8/openvpn.8
>
> And you can find the openvpn binary installed in
> /usr/local/sbin/openvpn. Note this is not part of the default PATH env
> variable.
>
> I'd also like to thank Stefan Reuter from
> http://blogs.reucon.com/srt/2008/12/17/installing_openvpn_on_opensolaris_2008_11.html.
>
> Cheers,
>
> Matthew Carras
> aka "Thrae"
>
> PS: Here's a little /etc/init.d script I'm using until I can figure
> out how to make a scvs configuration:
>
> ---------------------------------------------------
> #!/sbin/sh
> #openvpn.client
>
> case "$1" in
> 'start')
> ? ? ? ?echo 'Starting daemonized OpenVPN client'
> ? ? ? ?/usr/local/sbin/openvpn --daemon --writepid
> /tmp/openvpn.client.pid --cd /etc/openvpn/ --config
> /etc/openvpn/client.conf
> ? ? ? ?;;
>
> 'stop')
> ? ? ? ?echo 'Killing daemonized OpenVPN client'
> ? ? ? ?kill `cat /tmp/openvpn.client.pid`
> ? ? ? ?;;
>
> *)
> ? ? ? ?echo "Usage: $0 { start | stop }"
> ? ? ? ?exit 1
> ? ? ? ?;;
> esac
> ---------------------------------------------------
>
>

Reply via email to