[OpenWRT] packages not running

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

Api13
Posts: 6
Joined: Tue May 05, 2020 1:06 am

[OpenWRT] packages not running

Tue May 05, 2020 2:36 pm

Dear All,

Using the demo image of openWRT, after a sucessful boot, I face a few issues :

when I install *any* package, whether it be from LuCi or command line (opkg), I cannot start the package executable.

I always get :

Code: Select all

/bin/ash: ./my_package_name: not found
(and, Yes, package is installed w/o any error, and located (with right executable permissions) under /usr/bin.

I have read a few post on the issue - looks like some libs would not be the right ones ? But I cannot imagine that this would be the case on an official build from microchip ?
any ideas ? shall I rebuild everything ? (which is a long consumming task for a noob like me, with a low chance of success)

thank you for your help

cheers

François
blue_z
Location: USA
Posts: 2150
Joined: Thu Apr 19, 2007 10:15 pm

Re: [OpenWRT] packages not running

Tue May 05, 2020 8:32 pm

Api13 wrote: I have read a few post on the issue - looks like some libs would not be the right ones ?
Then you found some very helpful posts.
Did those posts provide information on how to determine which dependency is not available?

Api13 wrote: But I cannot imagine that this would be the case on an official build from microchip ?
Is your imagination going to determine what is true or not?

AFAICT the Openwrt images and its packages prefer to use musl as the C library, whereas the Linux4SAM builds are configured to use glibc.

Regards
Api13
Posts: 6
Joined: Tue May 05, 2020 1:06 am

Re: [OpenWRT] packages not running

Tue May 05, 2020 11:41 pm

Dear blue_z,

Thank you for your feedback.
Did those posts provide information on how to determine which dependency is not available?
I am afraid that I do not have enough knowledge to determine this. Are you talking about the package dependency on other libraries ?

Example for Python3 :

root@OpenWrt:/# opkg info python3
Package: python3
Version: 3.6.10-1
Depends: libc, python3-light, python3-unittest, python3-ncurses, python3-ctypes, python3-pydoc, python3-logging, python3-decimal, python3-multiprocessing, python3-codecs, python3-xml, python3-sqlite3, python3-gdbm, python3-email, python3-distutils, python3-openssl, python3-cgi, python3-cgitb, python3-dbm, python3-lzma, python3-asyncio
Status: install user installed
Architecture: arm_cortex-a5_neon-vfpv4
Installed-Time: 1588631902



AFAICT the Openwrt images and its packages prefer to use musl as the C library, whereas the Linux4SAM builds are configured to use glibc.
Well...does this mean that the openwrt packages for other A5 designs (the ones that are on the openwrt repositoy for this ARM architecture) use other libraries, and cannot be used directly ?

And, as a consequence, that I should recompile and include all the packages that I need in my image (using https://github.com/linux4sam/openwrt-at ... _defconfig) , in order to have them compiled with the right library (glibc) ?

What could be the best option you would recommend to make them run smoothly ?

Thank you.

Regards

François
blue_z
Location: USA
Posts: 2150
Joined: Thu Apr 19, 2007 10:15 pm

Re: [OpenWRT] packages not running

Wed May 06, 2020 3:25 am

Api13 wrote: I am afraid that I do not have enough knowledge to determine this. Are you talking about the package dependency on other libraries ?
No, I am referring to what dependencies the (ELF) executable file that you're trying to run requires.
These runtime dependencies could be a linker/loader and libraries.
When one of those dependencies cannot be located in the expected places, the shell responds with the "not found" error message.

"Package dependency" is an administrative issue.
The typical embedded Linux system is not administered like a desktop PC, and installing packages may not be a capability.
"Package dependencies" can be resolved when using Buildroot to configure the root filesystem . (The OpenWrt build system is based on Buildroot.)

Before you go off building stuff, shouldn't you determine what the OpenWrt-built executable expects that the Linux4SAM-built rootfs cannot satisfy?

There are utilities that will tell you everything about an ELF executable, but typically they're not available on an embedded system.
If you have `strace` on the target, then you can generate a report that will pinpoint the open() syscall that failed.
Otherwise the simplest method to extract the dependencies is the piped commands:

Code: Select all

$ strings <executable_file> | less 
The first line should identify the linker/loader.
That's followed by sets of lines, each set is a line for a library name, and lines for each entry-point expected from that library.
Since libraries tend to have names like libxxx.so.n, they are easy to differentiate from entry-point names.
When the strings turn into nonsense text, you've gone past the list of dependencies.
Gather the list of dependencies, and compare them to what is in the target's rootfs.

Regards
at91user
Posts: 1
Joined: Wed Dec 30, 2020 4:48 pm

Re: [OpenWRT] packages not running

Thu Feb 04, 2021 5:58 pm

Really wondering if there was a resolution to this issue. I also cannot do opkg update or install. Please can someone advise.

Return to “LINUX”

Who is online

Users browsing this forum: Google [Bot] and 5 guests