Since linux runs on a bunch of the open source MIPS based routers, I thought I would look at ddwrt, tomato, and openwrt and settled on OpenWRT to get started.
So away we go:cd projects/Femto git clone https://git.openwrt.org/openwrt/openwrt.git mv openwrt Openwrt cd Openwrt git fetch --tags git tag -l (lists available tags) git checkout v19.07.3This version is the last tag listed and what is recommended in the "install build system" tutorial.
Then I type "make prereq" and after a bunch of checking I get presented with a GUI. This is the OpenWRT config dialog.
I select "MediaTek Ralink MIPS" as the target, "RT3x5x/RT5350 based boards" as the subtarget. I select "default profile".
And I type "make"
It makes a bunch of stuff in "tools" and then is on to the races. 2 hours later it is still going. I should have run make as "make -j8" or maybe even "make -j" which puts no limit on concurrency.
I do see "dropbear" getting compiled.
-sh: lua: not foundWell, this is not good and is clearly a bad error message (the file is right there). I try copying it to /bin and still the same message. This is probably some kind of shared library issue (but maybe I am tricking myself since I have expected that to be an issue all along). Maybe it is a bad file format. I see:
file lua lua: ELF 32-bit LSB executable, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-mipsel-sf.so.1, with debug_info, not stripped
I clearly don't have that library on the target system.
Compare that to:
file wizard wizard: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, strippedInterestingly, look at this:
ls -l ld-musl-mipsel-sf.so.1 lrwxrwxrwx 1 tom tom 7 Jul 23 17:59 ld-musl-mipsel-sf.so.1 -> libc.so ls -l libc.so -rwxr-xr-x 1 tom tom 626691 May 16 11:32 libc.so
Pretty big. But on the device itself:
cd /lib ls -l *libc* -rw-r--r-- 1 1000 1000 749580 libuClibc-0.9.28.so lrwxrwxrwx 1 1000 1000 19 libc.so.0 -> libuClibc-0.9.28.so lrwxrwxrwx 1 1000 1000 19 libc.so -> libuClibc-0.9.28.so -rwxr-xr-x 1 1000 1000 26472 ld-uClibc-0.9.28.so lrwxrwxrwx 1 1000 1000 19 ld-uClibc.so.0 -> ld-uClibc-0.9.28.so
Interestingly, there is no "mv" (or even "ln") on my target system. However there is cp, so I can copy then erase the original to achieve the same as "mv"
I find ld-musl-mipsel-sf.so.1 in Openwrt/build_dir/target-mipsel_24kc_musl/root-ramips/lib I copy the file to /var/lib/tftpboot/femto, then:
tftp -g -r femto 192.168.73.5 cp femto /lib/ld-musl-mipsel-sf.so.1Now the message changes to:
lua -sh: lua: Permission deniedThe file is owned by root (and root is trying to run it). No chown in the target system.
Have any comments? Questions? Drop me a line!Tom's electronics pages / tom@mmto.org