Hi,
I've setup my crosscompiling toolchain and copy the hello executable to my vocore. File is chmoded +x but when I type ./hello it says command not found
Looks like busybox is playing with me.
How to exec external programs ?
I've installed nano, and I have the same problem with it
help for beginner
- noblepepper
- Posts: 240
- Joined: Sat Nov 29, 2014 3:22 pm
Re: help for beginner
Did you put hello in the root directory? i.e. what does
You may want to check out this post
- Code: Select all
ls -l /hello
You may want to check out this post
- lamenace
- Posts: 17
- Joined: Wed Mar 04, 2015 3:18 pm
Re: help for beginner
it shows
root@OpenWrt:~# ls -al
drwxr-xr-x 1 root root 0 Sep 7 14:47 .
drwxr-xr-x 1 root root 0 Jan 1 1970 ..
-rwxr-xr-x 1 root root 6522 Sep 7 09:16 hello
root@OpenWrt:~# ls -al
drwxr-xr-x 1 root root 0 Sep 7 14:47 .
drwxr-xr-x 1 root root 0 Jan 1 1970 ..
-rwxr-xr-x 1 root root 6522 Sep 7 09:16 hello
- noblepepper
- Posts: 240
- Joined: Sat Nov 29, 2014 3:22 pm
Re: help for beginner
Try
How did you install nano?
- Code: Select all
file hello
How did you install nano?
- lamenace
- Posts: 17
- Joined: Wed Mar 04, 2015 3:18 pm
Re: help for beginner
hello: ELF 32-bit LSB executable, MIPS, MIPS32 rel2 version 1, dynamically linked (uses shared libs), not stripped
I installed nano using : opkg install nano
I installed nano using : opkg install nano
- lamenace
- Posts: 17
- Joined: Wed Mar 04, 2015 3:18 pm
- noblepepper
- Posts: 240
- Joined: Sat Nov 29, 2014 3:22 pm
Re: help for beginner
I lost the CPU on my development box, couldn't compile anything, all better now
I just compiled a basic openwrt (released version of chaos calmer) and then followed Vonger's instructions.
file gives me this:
However, there are several file versions about, run this to see if you have the same as I do:
See if compiling with the --static flag gives you an executable that works, if it does there is something wrong with your libraries.
I just compiled a basic openwrt (released version of chaos calmer) and then followed Vonger's instructions.
file gives me this:
- Code: Select all
file hello
hello: ELF 32-bit LSB executable, MIPS, MIPS32 rel2 version 1, dynamically linked, interpreter /lib/ld-uClibc.so.0, not stripped
However, there are several file versions about, run this to see if you have the same as I do:
- Code: Select all
file -v
file-5.22
magic file from /etc/magic:/usr/share/misc/magic
See if compiling with the --static flag gives you an executable that works, if it does there is something wrong with your libraries.
- Code: Select all
./staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mipsel-openwrt-linux-gcc --static -g hello.c -o hello
mipsel-openwrt-linux-gcc: warning: environment variable 'STAGING_DIR' not defined
mipsel-openwrt-linux-gcc: warning: environment variable 'STAGING_DIR' not defined
mipsel-openwrt-linux-gcc: warning: environment variable 'STAGING_DIR' not defined
$ file hello
hello: ELF 32-bit LSB executable, MIPS, MIPS32 rel2 version 1, statically linked, not stripped
- lamenace
- Posts: 17
- Joined: Wed Mar 04, 2015 3:18 pm
Re: help for beginner
file-5.14
magic file from /etc/magic:/usr/share/misc/magic
I will try the static build, maybe it will take time, because I think I've fucked my system :/ need to reflash it
And how do you have uClibc toolchain ? I did a crosscompiling environment like on the wiki and I only have musl toolchain
magic file from /etc/magic:/usr/share/misc/magic
I will try the static build, maybe it will take time, because I think I've fucked my system :/ need to reflash it
And how do you have uClibc toolchain ? I did a crosscompiling environment like on the wiki and I only have musl toolchain
- noblepepper
- Posts: 240
- Joined: Sat Nov 29, 2014 3:22 pm
Re: help for beginner
The version or magic file is probably why file is not showing as much information as I get. I use debian 8.1 which installs file 5.22. In any case linking against a library that isn't on the target will definitely cause problems.
I think a more relevant question is how you got a musl toolchain. You are not the first, see this post
I started working on a topic about setting up a development environment from start to finish on my wiki but got sidetracked trying figure out how my hosting company hosed the icons.
Until I get that done I recommend using the new stable release of openwrt. If you install git on your development box you can get started with:
Change the firmware size in targets/linux/ramips/dts/VOCORE.dts from
then use make menuconfig to set everything up how you want it. The most important settings are
And how do you have uClibc toolchain ? I did a crosscompiling environment like on the wiki and I only have musl toolchain
I think a more relevant question is how you got a musl toolchain. You are not the first, see this post
I started working on a topic about setting up a development environment from start to finish on my wiki but got sidetracked trying figure out how my hosting company hosed the icons.
Until I get that done I recommend using the new stable release of openwrt. If you install git on your development box you can get started with:
- Code: Select all
git clone git://git.openwrt.org/15.05/openwrt.git
./scripts/feeds update -a
./scripts/feeds install -a
Change the firmware size in targets/linux/ramips/dts/VOCORE.dts from
- Code: Select all
partition@50000 {
label = "firmware";
reg = <0x50000 0x7b0000>;
};
- Code: Select all
partition@50000 {
label = "firmware";
reg = <0x50000 0xfb0000>;
};
then use make menuconfig to set everything up how you want it. The most important settings are
- Code: Select all
Target System (Ralink RT288x/RT3xxx)
Subtarget (RT3x5x/RT5350 based boards)
Target Profile (VoCore)
- lamenace
- Posts: 17
- Joined: Wed Mar 04, 2015 3:18 pm
Re: help for beginner
Ok so I did a test compiling the hello sample with musel-gcc using static lib. It's WORKING!!!
So default image is using musl library, that explain why all the package I installed did not work
So default image is using musl library, that explain why all the package I installed did not work
Who is online
Users browsing this forum: No registered users and 18 guests