Entware/Optware on MODERN Fractal/Brainslayer builds

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Author Message
coolVariable
DD-WRT Novice


Joined: 12 Mar 2015
Posts: 42

PostPosted: Sun Apr 05, 2015 18:27    Post subject: Entware/Optware on MODERN Fractal/Brainslayer builds Reply with quote
Is it possible?
My router doesn't have any of the old builds compatible with OTRW2 ...

Using an EA6500v1 router, I found the following Entware which seems to be compatible with MIPS chips:
https://github.com/Entware/entware/wiki/FAQ
I used mipselsf — for MIPSEL soft-float based devices

USB stick is formatted and successfully mounted:
365MB /jffs (ext2)
540MB /opt (ext2)

Installing the above Entware seems to work but simple programs (e.g. nano) do NOT work.

Code:
DD-WRT v24-sp2 giga (c) 2015 NewMedia-NET GmbH
Release: 03/19/15 (SVN revision: 26490M)

DD-WRT login: root
Password:
==========================================================

 ____  ___    __        ______ _____         ____  _  _
 | _ \| _ \   \ \      / /  _ \_   _| __   _|___ \| || |
 || | || ||____\ \ /\ / /| |_) || |   \ \ / / __) | || |_
 ||_| ||_||_____\ V  V / |  _ < | |    \ V / / __/|__   _|
 |___/|___/      \_/\_/  |_| \_\|_|     \_/ |_____|  |_|

                       DD-WRT v24-sp2
                   http://www.dd-wrt.com

==========================================================


BusyBox v1.23.1 (2015-03-19 09:02:40 CET) built-in shell (ash)

root@DD-WRT:/# cd /jffs
root@DD-WRT:/jffs# mkdir scripts
root@DD-WRT:/jffs# ls
scripts
root@DD-WRT:/jffs# wget -c -O entware_install.sh http://entware.wl500g.info/bina
ries/mipselsf/installer/entware_install.sh
Connecting to entware.wl500g.info (81.4.122.163:80)
entware_install.sh   100% |*******************************|  1143   0:00:00 ETA
root@DD-WRT:/jffs# chmod +x ./entware_install.sh
root@DD-WRT:/jffs# ./entware_install.sh
Info: Checking for prerequisites and creating folders...
Info: Opkg package manager deployment...
Connecting to entware.wl500g.info (81.4.122.163:80)
opkg                 100% |*******************************|   461k  0:00:00 ETA
Connecting to entware.wl500g.info (81.4.122.163:80)
opkg.conf            100% |*******************************|   106   0:00:00 ETA
Info: Basic packages installation...
Downloading http://entware.wl500g.info/binaries/mipselsf/Packages.gz.
Updated list of available packages in /opt/var/opkg-lists/openwrt.
Installing uclibc-opt (0.9.32-5) to root...
Downloading http://entware.wl500g.info/binaries/mipselsf/uclibc-opt_0.9.32-5_mip
selsf.ipk.
Installing libc (0.9.32-1) to root...
Downloading http://entware.wl500g.info/binaries/mipselsf/libc_0.9.32-1_mipselsf.
ipk.
Installing libgcc (4.6.4-1) to root...
Downloading http://entware.wl500g.info/binaries/mipselsf/libgcc_4.6.4-1_mipselsf
.ipk.
Installing libstdcpp (4.6.4-1) to root...
Downloading http://entware.wl500g.info/binaries/mipselsf/libstdcpp_4.6.4-1_mipse
lsf.ipk.
Installing libpthread (0.9.32-1) to root...
Downloading http://entware.wl500g.info/binaries/mipselsf/libpthread_0.9.32-1_mip
selsf.ipk.
Installing librt (0.9.32-1) to root...
Downloading http://entware.wl500g.info/binaries/mipselsf/librt_0.9.32-1_mipselsf
.ipk.
Installing ldconfig (0.9.32-1) to root...
Downloading http://entware.wl500g.info/binaries/mipselsf/ldconfig_0.9.32-1_mipse
lsf.ipk.
Installing findutils (4.5.14-1) to root...
Downloading http://entware.wl500g.info/binaries/mipselsf/findutils_4.5.14-1_mips
elsf.ipk.
Configuring ldconfig.
Configuring libgcc.
Configuring libc.
Configuring libpthread.
Configuring libstdcpp.
Configuring librt.
Configuring findutils.
Configuring uclibc-opt.
Updating /opt/etc/ld.so.cache... done.
Changing feed URL in /opt/etc/opkg.conf if necessary... done.
Info: Cleanup...
Info: Congratulations!
Info: If there are no errors above then Entware successfully initialized.
Info: Found a Bug? Please report at https://github.com/Entware/entware/issues
root@DD-WRT:/jffs# cd /opt
root@DD-WRT:/opt# ls
bin      etc      include  lib      sbin     share    tmp      usr      var
root@DD-WRT:/opt# opkg update
Downloading http://entware.wl500g.info/binaries/mipselsf/Packages.gz.
Updated list of available packages in /opt/var/opkg-lists/openwrt.
root@DD-WRT:/opt# opkg upgrade
root@DD-WRT:/opt# opkg install nano
Installing nano (2.3.6-1) to root...
Downloading http://entware.wl500g.info/binaries/mipselsf/nano_2.3.6-1_mipselsf.i
pk.
Installing libncurses (5.9-1a) to root...
Downloading http://entware.wl500g.info/binaries/mipselsf/libncurses_5.9-1a_mipse
lsf.ipk.
Installing terminfo (5.9-1a) to root...
Downloading http://entware.wl500g.info/binaries/mipselsf/terminfo_5.9-1a_mipsels
f.ipk.
Configuring terminfo.
Configuring libncurses.
Configuring nano.
root@DD-WRT:/opt# nano /opt/etc/asterisk/modules.conf
[b]Segmentation fault[/b]
root@DD-WRT:/opt# nano
[b]Segmentation fault[/b]
root@DD-WRT:/opt# cd ..
root@DD-WRT:/# nano
[b]Segmentation fault[/b]


Last edited by coolVariable on Tue Apr 07, 2015 16:05; edited 1 time in total
Sponsor
zyxmon
DD-WRT User


Joined: 07 Sep 2011
Posts: 139

PostPosted: Mon Apr 06, 2015 5:45    Post subject: Reply with quote
Code:
root@DD-WRT:~# cd /jffs
root@DD-WRT:/jffs# ls
root@DD-WRT:/jffs# mkdir scripts
mkdir: can't create directory 'scripts': Read-only file system

Even if Entware is installed - it will not start after reboot. jffs seems to be disabled.
Have you read installation instructions?

_________________
My forum.
coolVariable
DD-WRT Novice


Joined: 12 Mar 2015
Posts: 42

PostPosted: Tue Apr 07, 2015 2:39    Post subject: Reply with quote
zyxmon wrote:
Code:
root@DD-WRT:~# cd /jffs
root@DD-WRT:/jffs# ls
root@DD-WRT:/jffs# mkdir scripts
mkdir: can't create directory 'scripts': Read-only file system

Even if Entware is installed - it will not start after reboot. jffs seems to be disabled.
Have you read installation instructions?


Read further.
I mistakenly tried it before mounting jffs, ie JFFS is properly mounted and working.
coolVariable
DD-WRT Novice


Joined: 12 Mar 2015
Posts: 42

PostPosted: Tue Apr 07, 2015 16:07    Post subject: Reply with quote
Fixed the original post so it doesn't show that first attempt.

According to the prompts, Entware installed fine, OPKG updated fine, NANO installed fine ... but then nano doesn't run.
WHY?
zyxmon
DD-WRT User


Joined: 07 Sep 2011
Posts: 139

PostPosted: Wed Apr 08, 2015 4:55    Post subject: Reply with quote
You need to logout (ssh) and login again for profile environment variables to be set correctly (Tomato, AsusWRT). I cannot say for DDWRT.
Check that TERMINFO and TERM variables are set correctly.

_________________
My forum.
tsynik
DD-WRT User


Joined: 18 Apr 2014
Posts: 151

PostPosted: Wed Apr 08, 2015 18:37    Post subject: Reply with quote
For MIPS, you need export LD_LIBRARY_PATH=/opt/lib:$PATH
(or source Entware's etc/profile) and Entware will work fine. Startup/opt mount scripts can be placed in GUI (nvram) or in /jffs/etc/config
coolVariable
DD-WRT Novice


Joined: 12 Mar 2015
Posts: 42

PostPosted: Thu Apr 09, 2015 0:02    Post subject: Reply with quote
zyxmon wrote:
You need to logout (ssh) and login again for profile environment variables to be set correctly (Tomato, AsusWRT). I cannot say for DDWRT.
Check that TERMINFO and TERM variables are set correctly.


What should the TERMINFO be?
How can I ensure that this gets set properly on every boot?


tsynik wrote:
For MIPS, you need export LD_LIBRARY_PATH=/opt/lib:$PATH
(or source Entware's etc/profile) and Entware will work fine. Startup/opt mount scripts can be placed in GUI (nvram) or in /jffs/etc/config


So just put "LD_LIBRARY_PATH=/opt/lib:$PATH" into the startup script in the GUI?
zyxmon
DD-WRT User


Joined: 07 Sep 2011
Posts: 139

PostPosted: Thu Apr 09, 2015 4:55    Post subject: Reply with quote
coolVariable wrote:
....
How can I ensure that this gets set properly on every boot?
....

You must check that environment from /opt/etc/profile is applied on login.
Services setup in /opt/etc/init.d should start on every boot.

_________________
My forum.
alllexx
DD-WRT Novice


Joined: 03 Aug 2014
Posts: 41
Location: Kyiv, Ukraine

PostPosted: Thu Apr 09, 2015 5:22    Post subject: Reply with quote
tsynik wrote:
For MIPS, you need export LD_LIBRARY_PATH=/opt/lib:$PATH
...


You probably meant
Code:
export LD_LIBRARY_PATH=/opt/lib:${LD_LIBRARY_PATH}


Also, Entware should not need LD_LIBRARY_PATH variable. uClibc is patched to look in '/opt/lib' instead '/lib' if this variable isn't set. If it is set, it first looks there, so what can go wrong is if LD_LIBRARY_PATH variable contains path(s) to some conflicting libraries. Unsetting the variable manually in the shell should work:
Code:
export LD_LIBRARY_PATH=

(of course, this will have effect for your current interactive shell session only)

Also, to find out which library is being wrongly picked up, you can use ldd utility. Do this before unsetting/changing
LD_LIBRARY_PATH variable:
Code:
opkg update
opkg install binutils
ldd /opt/bin/nano

The last command should print which shared libraries are being picked up.
zyxmon
DD-WRT User


Joined: 07 Sep 2011
Posts: 139

PostPosted: Thu Apr 09, 2015 5:43    Post subject: Reply with quote
alllexx wrote:
....uClibc is patched to look in '/opt/lib' instead '/lib' if this variable isn't set. ....

No, no, no! Entware (and Optware) use hardcoded RPATH in binaries.
See
https://github.com/Entware/entware/blob/master/buildroot/patches/rules.patch
line 22

_________________
My forum.
alllexx
DD-WRT Novice


Joined: 03 Aug 2014
Posts: 41
Location: Kyiv, Ukraine

PostPosted: Thu Apr 09, 2015 5:51    Post subject: Reply with quote
zyxmon wrote:
alllexx wrote:
....uClibc is patched to look in '/opt/lib' instead '/lib' if this variable isn't set. ....

No, no, no! Entware (and Optware) use hardcoded RPATH in binaries.
See
https://github.com/Entware/entware/blob/master/buildroot/patches/rules.patch
line 22


Laughing Of course, I know that. And it works with everything, except the libc. So Entware's uClibc (and uClibc in my feed) is patched to fall back to '/opt/lib' instead of '/lib'. In short this is the locations order that shared libraries are looked into:
-rpath dirs
-LD_LIBRARY_PATH dirs
-fallback to default locations (usually '/lib:/usr/lib:/usr/X11R6/lib', Entware's uClibc is patched to look in '/opt/lib:/opt/X11R6/lib')

So what may be wrong here in OP's setup is that there's a bug in Entware with -rpat linker flag not set for nano, resulting in firmware's libncurses being picked up instead of Entware's. Just a theory, and this is why I wanted to see the output of 'ldd /opt/bin/nano'
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum