I’m trying to go through the Raspbian Info instructions for installing Legato on a raspberry pi. I’m building on a Ubuntu 16.04 VM and installing on a Raspberry Pi 1B. I seem to have no problems compiling both the kernel and Legato on the host machine but when I mount the squashfs to the pi and try to run sudo /./mnt/legato/start I get this error.
./system/bin/startSystem: error while loading shared libraries: liblegato.so: cannot open shared object file: No such file or directory
Any ideas? I did some searching and haven’t been able to find any answers. I’m using the legato toolchain for compiling.
I haven’t tried using it on RasPi myself yet, but this sort of thing happens when the dynamic linker can’t find a library that the executable needs. In this case, the startSystem program needs liblegato, and liblegato is not anywhere that the dynamic linker is looking for it.
The first thing to check is that liblegato.so is properly installed on your target. If it’s not installed in one of the standard places that the linker looks for libraries (like /lib or /usr/lib), then you need to tell the linker where to find it. There are lots of ways to do that. One that’s good for troubleshooting is adding the directory path to the LD_LIBRARY_PATH environment variable
export LD_LIBRARY_PATH=/mnt/legato/system/lib
Another (more persistent) way is to add the library to your linker’s cache. To do this,
open up /etc/ld.so.conf (in an editor using sudo) and add a line containing the path to the directory containing the library
run ‘sudo ldconfig’
NOTE: You can check where the linker is looking using strace.
sudo strace -f /mnt/legato/start
You’ll see it trying (and failing) to open liblegato.so in a bunch of different directories.
Thanks for replying. I’ve managed to work around this, and I’m not completely sure but I think that the Legato toolchain does not support the Pi version 1 as well as not supporting version 3. I managed to get a build up and running using the raspi toolchain.
That said I am still having general stability issues. I have a Pi 1 and 3 for testing. On the 3, when I start legato it appears to start up normally for about 15 seconds or so but then something triggers a linux magic reboot everytime so I’m unable to actually interact with it.
On the 1, legato will start up and I can interact with it. I’ve installed and run the wifiApTest but the wireless network never appears and I can’t find any logs with information about what the issue might be. I’ve also compiled the sample httpServer but when I install the package the system seems to hang and I start getting errors from the watchdog.
So anyways, lots of issues to work through I’ll report back if I manage to work through any of them. Any tips are always welcome.
Hi @mike919,
I have the same problem with the raspberry pi 3. It’s seem working but the raspberry reboot after 30s without any log in journalctl or dmesg or in the tty. Did you solve the problem ?
I have not been able to solve the problem yet. Looks like everyone’s given up on the raspberry pi 3. In case you are able to solve it, please post your solution here.
Hi @jchitty,
I am using kernel 4.9.35-v7+. I followed the instructions to cross compile the kernel using a Ubuntu 16.04. When I tried building legato, I faced some issues with the devmode for the releases > 16.10.2. Just to clarify that my target is Raspi3.
There is some on-going issue with kernel >4.8 because of SMACK.
Is the issue that you’re facing with devMode similar to the one in this thread? Any logs?
Here is the devMode error I was referring about which occurs while building legato latest repository build. I have only been successful in building legato 16.10.2.
I see, that’s unrelated to the topic and a new topic would have been best.
The issue is that there is an assumption that a cross-built ‘gdbserver’ is provided by the toolchain, and if that’s not the case it doesn’t build.
If you edit apps/tools/devMode.adef and comment out the gdbserver line it should build although it won’t be possible to attach gdbserver to an application through gdbCfg.
@CoRfr Thanks for guiding me and yes comment the gdserver line works and I could successfully build legato 17.05.0. Now coming back to the original discussion that raspberry pi is rebooting a few secs after attempting to /./mnt/legato/start I am bit clueless here on how can I collect the logs which could help you understand the problem. Can you guide me?