-sh /usr/local/sbin/wpa_supplicant no such file or directory - yocto

I have built the TI wilink utilities which then I have integrated in my rootfs. This done using petalinux 2016.4 and have created a install template app in yocto build to copy all the tools and libraries in the rootfs.
When I bring up the BOOT.bin and image.ub, I see the files and libraries but when I try to run for example wpa_supplicant it does not work
even wpa_supplicant -h wont work.
It shows me error:
-sh: /usr/local/sbin/wpa_supplicant: no such file or directory.
The file is present and also has executable permissions.
Do you have any idea why it is not able to run ?
Thanks

Typically, this means that executable file is built for the wrong architecture, i.e. there is a mismatch between the environment where are you running and environment for which you are building. This is how you can make sure they do match or not (execute on target):
# file /usr/local/sbin/wpa_supplicant
...
# uname -m
...
If you see mismatch, then it all boils down to how are you building TI wilink.

Related

How to define rule file in debian packaging of a project which have a make file to build from source?

I'm new to stackoverflow so correct me if I made any mistake in providing the details.
So I'm trying to make a deb file for Apache-Age, and going by the documentation, if we try to install AGE from source then we can simply do it by :
make install
I have setup the basic directory structure by dh_make and have made the control file with proper dependencies, then comes the rule file.
So I went through 2 different extensions of postgreSQL :
postgresql-q3c
Postgis
And tried to replicate the same for apache-age, and tried to build by following commands
dpkg-buildpackage -rfakeroot -b
dpkg-buildpackage -nc -i
the build was giving some errors and warning but a deb file was generated.
The deb file installed properly but age-extension was not installed in PostgreSQL.
It's probably because the age was not building properly from source using make command as specified in the rule file.
Is there any good resource or how to make rule file ?
I tried following this answer, but got stuck here.
I found a PDF but didn't understand the build process.
This might be a naive way but it works for me:
Clone the repo and cd to it
Run the dh_make_pgxs command to make the debian build directory structure.
The you need to make changes to pgversion, control/control.in, changelog, copyright and rule files.
If you are just trying to use the make file to build the package then the rule file can be as simple as:
#!/usr/bin/make -f
%:
dh $#
Then simply run the build command as before.

Build libraries in external folder of AOSP source code

I noticed that a simple
$ . build/envsetup.sh
$ lunch
$ aosp_hammerhead-eng
$ make -j16
Would not build also the external libraries in the ./external folder.
How am I supposed to build source code in such folder?
In particular, I am modifying source code in the libselinux in ./external/selinux/libselinux/src/
Thanks!
I found out that, by using the mm command, it is possible to build all of the modules in the current directory.
So, if you are in ./external/selinux/libselinux/ you can build all code inside such directory just by typing the command mm.
I also found that the same code I was modifying inside the ./external/selinux/libselinux/ is also located in ./external/libselinux/. However, this directory is linked to the make -j16 command.

Debug Error Occurred in Eclipse

I'm trying to debug an open source package, called libprotoident in Eclipse, Kepler version, within Debian. As it has the Makefile, I choose to make an empty Makefile project, and then add all the sources into the workspace. So after that the source compiled and run successfully as in the command line using the Makefile.
As it has 4 apps you can use, I choose to run lpi_protoident package in the run configuration window, as the following image shown.
So the Program ran successfully. Now I'm trying to debug it but it generates the following error.
How can I solve this error and debug the Project?
The file you are trying to debug is most likely a shell script created by automake that acts as a wrapper around the real executable, which has been built in a hidden directory.
Instead of telling Eclipse that tools/protoident/lpi_protoident is your application, try using tools/protoident/.libs/lpi_protoident instead.
General Answer about the error you are getting
What not in executable format: File format not reconized error means is that lpi_protoident is not an executable on the platform you are working on.
Are you sure that is an executable you can run (E.g. from the command line)?
There is also the small chance that the GDB you are using is somehow incompatible with the executable, but that is less likely.
Building libprotoident from source
(Assuming you are trying to build https://github.com/wanduow/libprotoident)
You are trying to build an automake project. The normal way to do that is by configuring to create Makefile, you shouldn't be making your own makefile. Please refer to the README in the project, but the key parts you need to do are:
Installation
After having installed the required libraries, running the following series of commands should install libprotoident
./bootstrap.sh (only if you've cloned the source from GitHub)
./configure
make
make install
By default, libprotoident installs to /usr/local - this can be changed
by appending the --prefix= option to ./configure.
The libprotoident tools are built by default - this can be changed by
using the
--with-tools=no option with ./configure.

Adding binaries to path with BOSH

This seems like it should be done in the packaging phase of a job, but the documentation does it in the job's control script.
However when I ssh into the machine the binaries I added to the path are not in the path anymore.
Your assumption is correct, I'm not sure what docs you reference, but binaries should be define in packages
The spec file tells director where in blobs to find the binary:
---
name: bamboo-agent
dependencies:
files:
- bamboo/atlassian-bamboo-5.9.7.tar.gz
And the packaging file tells it where to place those files on the job's vm.
# abort script on any command that exits with a non zero value
set -e
# agent jar is within the full installation tar, pull it out.
tar -xzf $BOSH_COMPILE_TARGET/bamboo/atlassian-bamboo-5.9.7.tar.gz
cp -a atlassian-bamboo-5.9.7/atlassian-bamboo/admin/agent/atlassian-bamboo-agent-installer-5.9.7.jar $BOSH_INSTALL_TARGET/
Control scripts might use those binaries, but should not manipulate them.
See https://bosh.io/docs/create-release.html#pkg-skeletons for an overview of how packages fit into BOSH releases.

Simple Unix question - Configure

I'm using Solaris 10, ksh. Whenever I do a ./configure, I get the error "ksh: ./configure: not found"
When I do a "where configure", nothing is found.
How do I "install configure"?
./configure means that you want to run an executable called configure in your current directory (signified by a .). I'm guessing you're trying to build and install from source, and the directions say to do the standard ./configure; make; make install. You should do that from the top-level directory of the source you downloaded and unpacked:
$ cd /path/to/source
$ ./configure
$ make
$ make install
"./configure" means "run the program configure from the current directory". That is, you need to cd to the directory that configure lives in before attempting to run it like that.
As for where configure might be found, it's usually at the root of whatever source package you're trying to build.
I'm not a Solaris guy, but the configure script should be within your current directory before you execute it. I am assuming you're trying to build something. If it's a project of your own, take a look at GNU autoconf. (I have no idea if this a part of Solaris or not.) It's part of M4.
If it's a project that you downloaded, untar/unzip/unpack it and then cd to its directory before running the configure script.
I had to run a command for another directory; and then that popped everything up :)
In case someone else comes across this specific issue, I'm trying to install the Perl-Php plugin on a Solaris machine. Initially, there is no configure file; instead you have to find where your "phpize" is located -- for me it was /opt/webstack/php/5.2/phpize, run it while you are still in the "perl-php-plugin" folder, and then configure will appear.
Then you can ./configure :)
Thanks to everyone who responded.