OpenWrt Forum Archive

Topic: OpenWRT x86

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

I am working on a project on OpenWRT x86. The installation script I am trying to run requires the readlink command; however, I have been unable to find it in the OpenWRT build. I have attempted to install Linux-compatible coreutil packages to no avail. I saw one very old post on a forum found through Bing that talked about compiling a version of readlink for the OS, but it gave no instructions.

This is slightly beyond my level of expertise and any assistance would be appreciated.


Thank You

OpenWRT uses busybox, and busybox can supply readlink. So have a look in your busybox settings.

If that is no option, you can emulate readlink with a simple script:

#!/bin/sh
ls -l $1 | awk '{print $11}'

1. How would I go about verifying my busybox settings include the ability for readlink?

Edit: I have been able to figure out that my version of Busybox does not include readlink. - See #3.


2. How would I utilize your suggestion in place of a script command?

D1=$(readlink -f "$0")


Edit:

3. Now that I know I don't have readlink in my busybox install, what is the best way to replace my version with one that does? e.g. I know busybox can be compiled quite easily, but, what is the recommended way to replace the existing package?



Thank You

(Last edited by jcpt928 on 1 May 2014, 13:50)

Try "opkg update ; opkg install coreutils-readlink".

If your device is running AA, that should work.  If trunk, your kernel may or may not be out of sync with current files, so you might need to reflash with sysupgrade and then perform the above commands, or build your own with readlink checked in the "make menuconfig" busybox options.

(Last edited by lizby on 1 May 2014, 15:36)

That worked perfectly. Thank You

Now...onto the next problem.

Here is the script:

!/bin/sh

export LD_LIBRARY_PATH=".:$LD_LIBRARY_PATH"

D1=$(readlink -f "$0")
D2=$(dirname "${D1}")
cd "${D2}"

if [ -e ts3server_linux_x86 ]; then
        if [ -z "`uname | grep Linux`" -o ! -z "`uname -m | grep 64`" ]; then
                echo "Do you have the right TS3 Server package for your system? Yo
        fi
        ./ts3server_linux_x86 $@
elif [ -e ts3server_linux_amd64 ]; then
        if [ -z "`uname | grep Linux`" -o -z "`uname -m | grep 64`" ]; then
                echo "Do you have the right TS3 Server package for your system? Yo
        fi
        ./ts3server_linux_amd64 $@
elif [ -e ts3server_freebsd_x86 ]; then
        if [ ! -z "`uname | grep Linux`" -o ! -z "`uname -m | grep 64`" ]; then
                echo "Do you have the right TS3 Server package for your system? Yo
        fi
        ./ts3server_freebsd_x86 $@
elif [ -e ts3server_freebsd_amd64 ]; then
        if [ ! -z "`uname | grep Linux`" -o -z "`uname -m | grep 64`" ]; then
                echo "Do you have the right TS3 Server package for your system? Yo
        fi
        ./ts3server_freebsd_amd64 $@
else
        echo 'Could not find binary, aborting'
fi


Here is the error I receive when running the script: ./ts3server_minimal_runscript.sh: line 31: ./ts3server_linux_x86: not found

I used the proper command - tar xvfz teamspeak3-server_linux-xxx-xx-x-x-x.tar.gz - to unpack the package, and can see the "ts3server_linux_x86" file under the directory (it is shaded green in my Putty session), but, I can't run it manually from there either.

I am wondering if the tar command is not unpacking it properly or if I'm missing something else here.

Edit: I will also be posting about this latest issue on the Teamspeak forum; but, as this is OpenWRT, I figured there'd be a lot of good expertise here as well that might be able to help. smile

(Last edited by jcpt928 on 1 May 2014, 16:33)

When you get a 'not found' on a binary which is just available, I guess the binary is dependent on a library which isn't there. Possible libc, as OpenWRT uses uclibc.

The discussion might have continued from here.