Need help to compile for MIPS
-
- Posts: 13
- Joined: Wed Jul 29, 2015 1:59 pm
Need help to compile for MIPS
Hello,
I need to compile SE vpn server for my Router "Fritz Box".
I uses a big endian system
uname -a tells "Linux fritz.box 2.6.32.61 #2 SMP Mon Oct 27 16:49:55 CET 2014 mips GNU/Linux"
I downloaded and built a toolchain and after some figuring it out (with much of help in another forum) I got it compiled. I needed to static-link ncurses and readline because fritz box does not offer them.
when I now compile it and put it into target system ./vpnserver start gives the following error:
# ./vpnserver
-- Alert: SoftEther VPN Kernel --
String Library Init Failed.
Please check your locale settings and iconv() libraries.
#
Now I found "/usr/bin/env LANG=en_US.UTF-8 /usr/bin/vpnserver start" but it gives the same error.
Is there something else I can change in some file to get it to work?
Thanks a lot
ChAoS
I need to compile SE vpn server for my Router "Fritz Box".
I uses a big endian system
uname -a tells "Linux fritz.box 2.6.32.61 #2 SMP Mon Oct 27 16:49:55 CET 2014 mips GNU/Linux"
I downloaded and built a toolchain and after some figuring it out (with much of help in another forum) I got it compiled. I needed to static-link ncurses and readline because fritz box does not offer them.
when I now compile it and put it into target system ./vpnserver start gives the following error:
# ./vpnserver
-- Alert: SoftEther VPN Kernel --
String Library Init Failed.
Please check your locale settings and iconv() libraries.
#
Now I found "/usr/bin/env LANG=en_US.UTF-8 /usr/bin/vpnserver start" but it gives the same error.
Is there something else I can change in some file to get it to work?
Thanks a lot
ChAoS
-
- Posts: 551
- Joined: Wed Jul 24, 2013 12:09 pm
Re: Need help to compile for MIPS
Please compile libiconv by yourself.
-
- Posts: 13
- Joined: Wed Jul 29, 2015 1:59 pm
Re: Need help to compile for MIPS
Hello,
thank you for the tip.
I am fiddling around with this file since some days.
the situation:
the box does not have libiconv included in /lib and this is a readonly filesystem so I can not compile and put it at this place.
the only writeable place in this box is /var with some subdirs
The only thing I can do is to put libiconv statically into the vpnserver executable.
At my first compile tries I found out that ncurses and readline is also not included in the box and I hat also to compile it statically into the executable. This increased the executable's file size, so I am sure these are built in statically.
But when I try to do the same with libiconv.a the executable's size does not increase. So for me it seems that the libiconv will not be included while compiling....
edit
with export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/var/media/ftp/add_lib
i extendet the library space.
with it I could compile vpnserver complete dynamically linked and copied the missing libncurses and libreadline into this path
I thought copying the libiconv.so to this place could help but also the same error occurs :(
thank you for the tip.
I am fiddling around with this file since some days.
the situation:
the box does not have libiconv included in /lib and this is a readonly filesystem so I can not compile and put it at this place.
the only writeable place in this box is /var with some subdirs
The only thing I can do is to put libiconv statically into the vpnserver executable.
At my first compile tries I found out that ncurses and readline is also not included in the box and I hat also to compile it statically into the executable. This increased the executable's file size, so I am sure these are built in statically.
But when I try to do the same with libiconv.a the executable's size does not increase. So for me it seems that the libiconv will not be included while compiling....
edit
with export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/var/media/ftp/add_lib
i extendet the library space.
with it I could compile vpnserver complete dynamically linked and copied the missing libncurses and libreadline into this path
I thought copying the libiconv.so to this place could help but also the same error occurs :(
-
- Posts: 551
- Joined: Wed Jul 24, 2013 12:09 pm
Re: Need help to compile for MIPS
Then that would be interesting, but I don't have MIPS device for the VPN Server. Actually, can you remount /lib and/or / as writable using commands?
-
- Posts: 13
- Joined: Wed Jul 29, 2015 1:59 pm
Re: Need help to compile for MIPS
Hello,
as I know there is no possibility to make it writeable. Now I installed a Mod "freetz". It is the genuine firmware packed with some modifications, extensions and some more features.
Before compiling freetz I can include the missing libs.
Installed on the box they are in a subfolder but they are not set default. I can add the folder to the export library path with export but the error is the same.
I found out in the precompiled linux version that libcharset is added statically to the vpnserver. I found some libcharset.so files and also put it in the 2nd ld_library_path in the box but also vpnserver does not start.
In conclusion I have only the compiled vpnserver executable and the hamcore.se2 in one folder. In the 2nd lib folder I have
root@fritz:/var/media/ftp/add_lib# ls -l
-rw-r--r-- 1 root root 77232 Aug 7 12:48 iconv.o
-rw-rw-rw- 1 root root 5640 Aug 9 20:55 libcharset.a
-rw-rw-rw- 1 root root 933 Aug 9 20:54 libcharset.la
-rw-rw-rw- 1 root root 934 Aug 9 20:55 libcharset.lai
-rw-rw-rw- 1 root root 10116 Aug 9 20:55 libcharset.so
-rw-rw-rw- 1 root root 10116 Aug 9 20:55 libcharset.so.1
-rw-rw-rw- 1 root root 10116 Aug 9 20:55 libcharset.so.1.0.0
-rw-r--r-- 1 root root 82442 Aug 7 12:48 libiconv.a
-rw-r--r-- 1 root root 919 Aug 7 12:48 libiconv.la
-rw-r--r-- 1 root root 920 Aug 7 12:48 libiconv.lai
-rw-r--r-- 1 root root 83180 Aug 7 12:48 libiconv.so
-rw-r--r-- 1 root root 83180 Aug 7 12:48 libiconv.so.2
-rw-r--r-- 1 root root 83180 Aug 7 12:48 libiconv.so.2.5.0
-rw-r--r-- 1 root root 277538 Aug 7 12:43 libncurses.so.5
-rw-r--r-- 1 root root 226044 Aug 7 12:43 libreadline.so.6
-rw-r--r-- 1 root root 3488 Aug 7 12:49 localcharset.o
-rw-r--r-- 1 root root 4452 Aug 7 12:49 relocatable.o
root@fritz:/var/media/ftp/add_lib#
and all other dyn linked libs are offered by the box.
Are there other files needed to execute the vpnserver file? I think the hamcore.se2 file can not be the error because, if I rename it, the error stays the same.
Thank you in advance for all help and support :)
as I know there is no possibility to make it writeable. Now I installed a Mod "freetz". It is the genuine firmware packed with some modifications, extensions and some more features.
Before compiling freetz I can include the missing libs.
Installed on the box they are in a subfolder but they are not set default. I can add the folder to the export library path with export but the error is the same.
I found out in the precompiled linux version that libcharset is added statically to the vpnserver. I found some libcharset.so files and also put it in the 2nd ld_library_path in the box but also vpnserver does not start.
In conclusion I have only the compiled vpnserver executable and the hamcore.se2 in one folder. In the 2nd lib folder I have
root@fritz:/var/media/ftp/add_lib# ls -l
-rw-r--r-- 1 root root 77232 Aug 7 12:48 iconv.o
-rw-rw-rw- 1 root root 5640 Aug 9 20:55 libcharset.a
-rw-rw-rw- 1 root root 933 Aug 9 20:54 libcharset.la
-rw-rw-rw- 1 root root 934 Aug 9 20:55 libcharset.lai
-rw-rw-rw- 1 root root 10116 Aug 9 20:55 libcharset.so
-rw-rw-rw- 1 root root 10116 Aug 9 20:55 libcharset.so.1
-rw-rw-rw- 1 root root 10116 Aug 9 20:55 libcharset.so.1.0.0
-rw-r--r-- 1 root root 82442 Aug 7 12:48 libiconv.a
-rw-r--r-- 1 root root 919 Aug 7 12:48 libiconv.la
-rw-r--r-- 1 root root 920 Aug 7 12:48 libiconv.lai
-rw-r--r-- 1 root root 83180 Aug 7 12:48 libiconv.so
-rw-r--r-- 1 root root 83180 Aug 7 12:48 libiconv.so.2
-rw-r--r-- 1 root root 83180 Aug 7 12:48 libiconv.so.2.5.0
-rw-r--r-- 1 root root 277538 Aug 7 12:43 libncurses.so.5
-rw-r--r-- 1 root root 226044 Aug 7 12:43 libreadline.so.6
-rw-r--r-- 1 root root 3488 Aug 7 12:49 localcharset.o
-rw-r--r-- 1 root root 4452 Aug 7 12:49 relocatable.o
root@fritz:/var/media/ftp/add_lib#
and all other dyn linked libs are offered by the box.
Are there other files needed to execute the vpnserver file? I think the hamcore.se2 file can not be the error because, if I rename it, the error stays the same.
Thank you in advance for all help and support :)
-
- Posts: 551
- Joined: Wed Jul 24, 2013 12:09 pm
Re: Need help to compile for MIPS
In conclusion, "/lib" and/or "/" cannot be remounted as writable by using "mount -o remount, rw /lib" and/or "mount -o remount, rw /". Then I have no idea.
Is there any mount utility in the busybox? For example, use "busybox mount -o remount, rw /" instead of "mount -o remount, rw /".
Is there any mount utility in the busybox? For example, use "busybox mount -o remount, rw /" instead of "mount -o remount, rw /".
-
- Posts: 13
- Joined: Wed Jul 29, 2015 1:59 pm
Re: Need help to compile for MIPS
Hello kh_tsang
so, you say, that I have not obviously forgotten some files?
As I know there is NO possibility to remount RW the filesystem. Does softether look into the absolute path /lib instead of checking the variable LD_LIBRARY_PATH???
The only thing I found is to overlay a filesystem. Here is the tutorial: https://www.64k-tec.de/2011/07/fritzbox ... lications/
When I have time I'll look to overlay only the /lib directory, my Idea is to keep (copy) the genuine fritz.box libs with the additonal libs together and overlay the /lib directory wit the merged directory.
Compared to the in the tutorial described Box (7270) the 7490 has a lot of more RAM and a 512 MB flash, so there must be more possibilities to get it run.
One question: does it matter in which directory the executable together with the hamcore.se2 lays? must it be in /usr/local/vpnserver or may it lay where I want?
Thank you in advance
so, you say, that I have not obviously forgotten some files?
As I know there is NO possibility to remount RW the filesystem. Does softether look into the absolute path /lib instead of checking the variable LD_LIBRARY_PATH???
The only thing I found is to overlay a filesystem. Here is the tutorial: https://www.64k-tec.de/2011/07/fritzbox ... lications/
When I have time I'll look to overlay only the /lib directory, my Idea is to keep (copy) the genuine fritz.box libs with the additonal libs together and overlay the /lib directory wit the merged directory.
Compared to the in the tutorial described Box (7270) the 7490 has a lot of more RAM and a 512 MB flash, so there must be more possibilities to get it run.
One question: does it matter in which directory the executable together with the hamcore.se2 lays? must it be in /usr/local/vpnserver or may it lay where I want?
Thank you in advance
-
- Posts: 551
- Joined: Wed Jul 24, 2013 12:09 pm
Re: Need help to compile for MIPS
I have no idea, but running vpnserver at the directory that it is generated from will work(without modifying other files), it does not need to be at /usr/local/.
-
- Posts: 13
- Joined: Wed Jul 29, 2015 1:59 pm
Re: Need help to compile for MIPS
Hello kh_tsang,
yesterday with some tips from a german forum user I got it (he also) to run on this box.
The tip was to take the files from buildroot environment.
I do not really understand what the differences between these both methods are but there must be big differences.
When I compile it myself I got vpnserver with round about 1 900 000 bytes and in buildroot the executable is only 34 000 bytes and I think the code is sourced out to some libs.
In general buildroot environment takes a git clone and has it's own makefile and some patches to compile softether vpn server.
After that I had to take the compiled rootfs image, put it in filesystem on the box, unpack it there in a writable subfolder and had to start a new shell with chroot. Within this chroot environment I could start vpnserver without any problem.
The only thing or problem is, as described in another post from another user, that the box itself is not reachable from vpn's side, The box is also not able to create a tun interface.
The only thing I can try is to make a virtual interface via the config file, give it an IP address and try to bridge it into the virtual hub.
Perhaps, if someone knows the difference of the two methods someone can explain it shortly here???
Thank you very very much
Dirk
yesterday with some tips from a german forum user I got it (he also) to run on this box.
The tip was to take the files from buildroot environment.
I do not really understand what the differences between these both methods are but there must be big differences.
When I compile it myself I got vpnserver with round about 1 900 000 bytes and in buildroot the executable is only 34 000 bytes and I think the code is sourced out to some libs.
In general buildroot environment takes a git clone and has it's own makefile and some patches to compile softether vpn server.
After that I had to take the compiled rootfs image, put it in filesystem on the box, unpack it there in a writable subfolder and had to start a new shell with chroot. Within this chroot environment I could start vpnserver without any problem.
The only thing or problem is, as described in another post from another user, that the box itself is not reachable from vpn's side, The box is also not able to create a tun interface.
The only thing I can try is to make a virtual interface via the config file, give it an IP address and try to bridge it into the virtual hub.
Perhaps, if someone knows the difference of the two methods someone can explain it shortly here???
Thank you very very much
Dirk
-
- Posts: 551
- Joined: Wed Jul 24, 2013 12:09 pm
Re: Need help to compile for MIPS
Using a tap device requires TUN/TAP driver module embedded in the kernel.
-
- Posts: 13
- Joined: Wed Jul 29, 2015 1:59 pm
Re: Need help to compile for MIPS
hello kh_tsang
I only wanted to give feedback.
In this Box there is a config file in /var/flash (ar7.cfg). There you can manage the handling of the bridges and the ethernet ports. The Box has 4 LAN ports within one bridge.
In the ar7.cfg I created a new bridge with a not important IP address. With this bridge I connected only the 4th ethernet port (eth3) and in softether I connected the local bridge with this new bridge. So eth3 is connected with softether and eth0 with the box. Externally I connected both (eth0 and eth3) with the same switch.
Now when you connect from outside and want to connect to the box (f.e. to the web interface, putty or SIP) then:
External PC---->VPN to SoftEther----->VirtualHub of SoftEther---->Bridge of SoftEther------>new created bridge in the box---->Phys. eth3----->external switch---->Phys. eth0---->box's internal bridge with the correct IP
It works like a charm. Because of the box gives the 2nd bridge the same mac as the first bridge it first didn't work but after some fiddling with the startup script I change the mac of the bridge to an own mac and after that SoftEther starts
Hope it helps also to other forum users
Thanks also to all helping people here :)
Greetings
Dirk
I only wanted to give feedback.
In this Box there is a config file in /var/flash (ar7.cfg). There you can manage the handling of the bridges and the ethernet ports. The Box has 4 LAN ports within one bridge.
In the ar7.cfg I created a new bridge with a not important IP address. With this bridge I connected only the 4th ethernet port (eth3) and in softether I connected the local bridge with this new bridge. So eth3 is connected with softether and eth0 with the box. Externally I connected both (eth0 and eth3) with the same switch.
Now when you connect from outside and want to connect to the box (f.e. to the web interface, putty or SIP) then:
External PC---->VPN to SoftEther----->VirtualHub of SoftEther---->Bridge of SoftEther------>new created bridge in the box---->Phys. eth3----->external switch---->Phys. eth0---->box's internal bridge with the correct IP
It works like a charm. Because of the box gives the 2nd bridge the same mac as the first bridge it first didn't work but after some fiddling with the startup script I change the mac of the bridge to an own mac and after that SoftEther starts
Hope it helps also to other forum users
Thanks also to all helping people here :)
Greetings
Dirk