Building Yocto Linux Image with my own program inside of Image - linux

I've successfully built Yocto and can run the Linux enviroment on my embedded hardware. However, I am stuck on where how to place my program into the Image so that when I run the Linux environment on the embedded hardware, I can run my program. I've been trying to find the answer at https://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html , but so far I am either missing something or not fully understanding the documentation. Does anyone have any ideas or examples to guide me to the correct path?

You need to write your own bitbake recipe for building and including the application in the image. See a hello world example here.

Yeah to install your own program binary into the OS image you need to write your own recipe and helloworld is best example to refer.
You can get more additional info like create own layer, create own image and install own code binary into OS image please have a look at https://github.com/prashantdivate/meta-sirius

Related

Node.js - Writing an image to a USB/SD on Windows

So I've written a program in Electron that will download the latest version of our image and then write it to the selected device.
I've got this working fine for Linux and OSX as I'm able to call a sub process and just run the dd command directly.
My issues come when trying to make this work on Windows, I've not been able to find a node package that does dd or something similar, and natively writing it for Windows doesn't want to work due to the chaining of commands etc.
Does anyone have any suggestions? My next idea would be to write a .bat script that is called by the sub process and try to do it that way. However if there is a platform universal approach with node that would be ideal! Thanks.
I wouldn't start rolling my own approach for this using Node.
Rufus is the current go-to app on Windows for burning images to various media. It has limited command line support – the author says you should try rufus -h to see what's possible.
There's also Etcher CLI, which is "experimental, proceed with caution and report issues". (Also, the Etcher GUI is actually an Electron app, so you might want to peek into what it's doing. https://github.com/resin-io/etcher)
Hope these help.

Deploy a Qt project on linux

This may be a noob question, but I have been stuck trying to work out how to statically build my qt project on linux. I tried doing what it said on http://doc.qt.io/qt-5/linux-deployment.html , but I do not understand the 1st step. When I cd to the location of my qt project and run
cd /path/to/Qt
./configure -static -prefix /path/to/Qt <otherparameters>
make
it says no such file or directory. Am I misunderstanding what paths I need to use? I want to make my qt project a stand alone executable which doesnt require the computer it is on to have qt. I have read about dynamically linking the libraries, but I dont really know what to do with that either. The deploy option is greyed out in qtcreator, is there a way to use this?
Thanks
/path/to/Qt should be the path to Qt's sources, not your project's. That section of the documentation is about building Qt statically, which you must do before trying to statically link your application to Qt. For example, if you downloaded/cloned the sources to /home/jxb458/qt5, then you'd replace /path/to/Qt with that:
cd /home/jxb458/qt5
./configure -static -prefix /home/jxb458/qt5/qtbase
make
Static linking is great when it works, but it can be an effort - I have found especially when using GUI. As Mitch said you need to actually re-build the Qt source code
I made some notes back when I was building statically quite a bit here: Notes on static building (derived from many sources) they should at least point you in the right direction - you can probably ignore the part about installing Ubuntu - the notes assume a new install.
However I have more recently returned to the dynamic linking deployment since I feel this is a better way to deploy now. You don't need to install Qt on the target machine you just need to collect the qt dlls and copy them with your application (using ldd executable-name which produces a list of dlls you need - but just take the Qt ones not the system/generic ones). For plugins you need to do a bit more (but its fairly simple). I even wrote a bash script to do this automatically (i'll send it to you if you need it), in windows there is a qt script called windeployqt (not sure why there is not a linux variant).
If I where to start again looking into deployment I would go for dynamic linking. Maybe try with a simple project to start with (like a hello world proj).

When using someone else's application code do I need to run Cmake to get the project structure for my operating system.

I am getting into a position where I have to use other people code for projects, for example openTLD. I want to change some of the code to give it more functionality and use it in a diffrent way. What I have found is that many people have packaged their files in such a way that you are supposed to use
cmake
and then
make
and sometimes after that
make install
I don't want to install the software on my system. What I am looking to do is get these peoples code to a point where I can add to it in Eclipse or even just using Nano and then compile it.
At what point is the code in a workable/usable state. Can I use it after doing cmake or do I need to also call make? Is my thinking correct that it would be better to edit the code after calling cmake as opposed to before? I am not going to want my finished code to be cross platform supported, it will only be on Linux. Is it easer to learn cmake and edit the code befor running cmake as opposed to not learning cmake and using the code afterwards, if that is possible?
You question is a little open ended.
Looking at the opentld project, there is a binary and a library available for use. If you are interested in using the binary in your code, you need to download the executables(Linux executables are not posted). If you are planning to use the library, you have two options. Either you use the pre-built library or build it during your build process. You would include the header files in your custom application and link with the library.
If you add more details, probably others can pitch in with new answers or refine the older ones.

Linux application project for zynq7000 in the Xilinx SDK

I'm trying to create a Linux application to run on my Zynq7020. However I don't understand how the Xilinx SDK generate the executable file.
When I create a hello world, for instance, it creates one .elf file and under the debug it creates one object (.o) and one dependency (.d). I want to run it under the Linux that is running on my board, how do I do it?
Thank you very much.
I want to run it under the Linux that is running on my board, how do I do it?
Most likely, you just need to copy/download the .elf file to your target board and run it.
If that doesn't work, try editing your question to supply more info. In particular, what commands "create a hello world" actually executes?
When creating the project in the Xilinx SDK, select that it runs on linux rather than standalone. See this official tutorial for an in-depth explanation.

Device Driver Development in Linux

I plan to learn embedded linux and writing linux device drivers.
After reading about device drivers and walking through some tutorials, I'm a little confused about the kernel-source that to be used for compilation.
I am using ubuntu 11.04 and in my /usr/src/ me find the following:
tijin#tijin-Vostro-460:/usr/src$ ls
gcc-4.4 linux-headers-2.6.38-10-generic-pae
linux-headers-2.6.38-10 linux-headers-2.6.38-8
my questions:
1)do I need a kernel-source to compile the driver code or the headers are enough?
2)where can I get the kernel source code and what is the procedure to install the source code. Please let me know the details.
Headers is enough
from kernel.org - or for Ubuntu specific kernels, follow the documentation
For module compilation instructions, see this question
Yes. You need not only the source but a "make"d source (a compiled kernel source).
The main location to get the kernel source is: http://www.kernel.org
As you're using Ubuntu you can just download the source from the repositories.
Here's the page indicated at Ubuntu's help as a guide for compiling a kernel from source on Natty (11.04):
http://blog.avirtualhome.com/2011/08/03/how-to-compile-a-new-ubuntu-11-04-natty-kernel/
For a fresher to device driver coding the "hello world" driver code reference is here :
http://www.linuxquestions.org/questions/linux-kernel-70/simple-makefile-error-all-nothing-need-to-be-done-600403/ .
This link also discussing the issues related to the Makefile. Important idea that i got from the reference is: Never ever copy-paste the content of a document for creating Makefile.
If you are getting trouble with seeing logs then please refer the link :
http://www.cyberciti.biz/faq/linux-log-files-location-and-how-do-i-view-logs-files/
thanks.

Resources