(This post is a revision of this one for Solaris 64bits, and in accordance with new source code versions).
It is possible to get LZO, OpenVPN and TUN under Solaris, compiling the source code.
Because of some compatibility issues, it is not as easy as it can be thought.
You can follow those steps to get openvpn executable under Solaris:
- ensure GNU gcc and make are installed
pkg install SUNWgcc
- download the LZO source code and uncompress it under [LZO_DIRECTORY],
- download the TUN source code and uncompress it under [TUN_DIRECTORY],
- download the openVPN source code and uncompress it under [OPENVPN_DIRECTORY],
- update the path for all needed tools (gcc, gmake, install, ar ...) to be available
export PATH=/usr/sfw/bin:/usr/ucb/:/usr/ccs/bin:/usr/sbin:/usr/bin:$PATH
- compile LZO
cd [LZO_DIRECTORY]
./configure --libdir=/usr/local/lib
make
make install
- configure TUN
cd [TUN_DIRECTORY]
./configure
- edit solaris/Makefile to add options as followed
CFLAGS = -m64 -mcmodel=kernel -mno-red-zone -ffreestanding $(DEFS) -O2 -Wall -D_KERNEL -I.
- compile TUN (ignore the error "Warning: 64-bit version of driver found at /usr/kernel/drv/tun")
make
make install
- move the created tun file (to be regarded as 64bits)
mv /usr/kernel/drv/tun /usr/kernel/drv/amd64/
- load it
devfsadm -i tun
- compile OpenVPN
cd [OPENVPN_DIRECTORY]
./configure --with-lzo-lib=/usr/local/lib --with-lzo-headers=/usr/local/include --prefix=/usr
make
make install
It is now possible to use LZO, OpenVPN and TUN under Solaris.
sharing knowledge earned into design/development/technical delicate and/or difficult situations ...
Labels
Gnu/Linux
(95)
Administration
(83)
StorageHardware
(17)
Programming
(16)
WebBrowser
(15)
General
(11)
GNU/Bash
(7)
Solaris
(7)
Virtualization
(7)
C
(6)
Domotics
(6)
Musics
(5)
Raspberry
(5)
Desktop
(4)
Java
(4)
VersionControlSystems
(4)
ArtificialIntelligence
(2)
Optimization
(2)
multimedia
(2)
Arduino
(1)
Electronics
(1)
LTS
(1)
MacOS
(1)
Mechanics
(1)
Processing
(1)
Robotics
(1)
Ubuntu
(1)
Upgrade
(1)
ez-robot
(1)
Subscribe to:
Post Comments (Atom)
i tried to compile TUN using the CFLAGS options that you mention for Makefile, but I get an invalid option error.
ReplyDeletebash-3.00$ which make
/usr/ccs/bin/make
bash-3.00$ make
cd solaris; make all
gcc -m64 -mcmodel=kernel -mno-red-zone -ffreestanding -DTUN_VER=\"1.1\ 08/04/2009\" -O2 -Wall -D_KERNEL -I. -c tun.c
cc1: error: invalid option `no-red-zone'
tun.c:1: error: bad value (kernel) for -mcmodel= switch
*** Error code 1
make: Fatal error: Command failed for target `tun.o'
Current working directory /export/home/azrin/Desktop/tun-1.1/solaris
*** Error code 1
make: Fatal error: Command failed for target `module'
Are you sure to have installed GNU gcc, and to have updated the PATH environment variable, BEFORE launching ./configure ?
ReplyDeleteSorry, I found out what I did wrong.
ReplyDeleteThe flags you used were for 64 bit x86, but I am on a 64 bit SPARC. So I used:
CFLAGS = -m64 -mcpu=v9 -mcmodel=medlow -fno-pic -mno-fpu -ffreestanding -nodefaultlibs $(DEFS) -O2 -Wall -D_KERNEL -I.
This solved all my problems. Great blog post by the way. :)
hello,
ReplyDeleteI have:
bash-3.00# uname -X
System = SunOS
Node = develop
Release = 5.10
KernelID = Generic_141415-05
Machine = i86pc
BusType =
Serial =
Users =
OEM# = 0
Origin# = 1
NumCPU = 8
and did all the steps but i cant attach tun:
bash-3.00# devfsadm -i tun
devfsadm: driver failed to attach: tun
Are you sure you moved to the [TUN_DIRECTORY] ? It's mandatory before using devfsadm.
ReplyDeleteYou can use the -v option to get more information.
I've just tried this on OpenIndiana oi-148. It fails to load the tun driver:
ReplyDeletematt@vault:~/Downloads/tun-1.1$ pfexec devfsadm -v -i tun
devfsadm: driver failed to attach: tun
exit status = 1
The -v option doesn't provide much useful information :(
What is your architecture ?
ReplyDeleteCheck if the tun driver has well been install either under /usr/kernel/drv/tun or the sub-directory corresponding to your architecture (e.G. /usr/kernel/drv/amd64/).
Thanks, Thanks again.
ReplyDelete