OpenWrt Forum Archive

Topic: nas and OpewWrt trunk

The content of this topic has been archived on 17 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I could not run nas with OpenWrt trunk. I've got
# ./nas
ash: ./nas: not found
and
# wl
wl: can't resolve symbol '__uClibc_start_main'

use "nas" instead of "./nas"
but NAS needs parameters nvram ->  look into "/etc/ini.d/S45wpa"

ls -la /usr/bin/nas
-rwxr-xr-x    1 root     root       138358 Nov 19 04:39 /usr/bin/nas

nas -P /tmp/nas.lan.pid -l br0 -H 34954
ash: nas: not found

Try typing /usr/bin/nas -P /tmp/nas.lan.pid -l br0 -H 34954

#/usr/bin/nas -P /tmp/nas.lan.pid -l br0 -H 34954
-ash: /usr/bin/nas: not found

obscure linux trivia -

You have to understand what's actually going on to make sense of the error message. It's not complaining that nas can't be found; it's complaining that the interpreter required to run nas can't be found. A very simple example:

A normal shell script starts with

#!/bin/sh

If instead we change it to

#!/path/to/nonexistant/file

Attempting to execute that would result in a "file not found" error since the interpreter (/path/to/nonexistant/file) can't be found to execute the program. Although you won't find a "#!" line in nas since it's a binary application, the same concept still holds.

The interpreter in this case is actually ld.so, which is responsible for loading and linking all the libraries. On a normal system you'd find it as /lib/ld-linux.so.2 and you can actually force applications to run by doing obscure things like "/lib/ld-linux.so.2 /bin/ls". But since this is a uClibc embeded system you'll find it in a slightly different location (/lib/ld-uClibc.so?), and I really don't think it'll let you run it directly. The quick and dirty solution would be to run strings to see what nas is using as the interpreter (should be top line of the strings output) and make sure that file exists (or symlink it to something reasonable if it doesn't)

I think I've somehow broken uClibc.
wl: can't resolve symbol '__uClibc_start_main'

The discussion might have continued from here.