How to build a linux for Intel galileo gen 2? - linux

There're some files, provided by intel. It is set of linux images for Intel galileo. I tryed to build one of them with help of this thing, but it doesn't work, because image doesn't consist .bb file which is the target file for bitbake. Could you explain how to build one of those images? I need it to boot this on galileo.

A simple google search of "galileo gen 2 yocto" brought up many guides of how to build a Yocto image for what you are asking for.

Related

Zynq, Yocto Linux and Custom FPGA IP Block Workflow

I'm new to the Zynq devices and also to linux and the Yocto project.
I now have a project where I need to implement a custom FPGA IP block and use it from a yocto generated linux distribution.
Obviously I will have to write the linux drivers for that custom IP. But I'm not able to find a clear explanation how the workflow for such a project may look like.
I found some old tutorials but I'm not sure if they are still the way to go, so an up-to-date best practice workflow would be great.
What I did so far:
I created a test project in Vivado and created a small led example by passing through the FPGA block in a Microzed + carrier board.
Then I exported the HW from Vivado to get a BSP package I tested in a bare metal project with Vitis.
I installed Yocto and I build a reference distro for my microzed board with just a serial interface by following a tutorial online.All this comes more or less pre-backed from Xilinx.
But now I need to use a Yocto generated linux distro and enable it to use my custom (LED) IP.
My questions:
How does a detailed workflow in this case look like (at the end I
need a bootable SD card)?
More in detail:
How can I bring the mydevice_bsp generated from Vivado into the Yocto distro?
In which environment(how to write them i'll find out my self) do I write the
drivers for the yocto Linux and bring them into the distro?
How do I load the bitstream into the FPGA fabric when the Linux image has booted up?
Unfortunately I do not have to much time to get all this working, so it would be really cool to find a step by step tutorial from the start to the end.
Thanks in advance for your help.
Regards
Martin
I´m not sure if someone has written down a workflow for this, but I can tell you how I would handle it.
Create your IP code as hardware and use the IP packager to pack the code. You can also add some driver code too, so the SDK can use this to automatic generate the drivers. So you can use the regular workflow in Vitis to write your software.
Or you skip this part and use the hardware direct in your Linux. So you will create an IP core and add him to your system in Vivado. Export the hardware to get your BSP file. Then you need the Xilinx Device Tree Generator to generate your device tree. This tool uses some basic definitions (like the base adress) of your IP core to generate the device tree part for your hardware.
Then you create a normal bitstream and a bunch of tools to create your bootloader, kernel, device tree, bitstream file, etc. (all without Yocto). Copy all files to a SD card and boot up your device. You can take a look at my Linux project and the Wiki when you need some help. Now you can begin to write the driver for your device and test him on your real hardware. At last you can create a Yocto recipe to automatic include your driver to the kernel with KConfig.
After booting Linux you find a device /dev/devcfg which can be used to reprogram the FPGA. Please note that changing the FPGA with impact on the processing system (i. e. you add some interfaces to your PS) will cause in some errors (maybe that bug is gone over the last years, but I have to issue this problem a few years ago).
So according to your LED example you have to do the following steps:
Create the IP core
Create a basic processing system and add the IP core
Generate the bitstream
Export the hardware to Vitis
Open Vitis and create a new FSBL project
Add the Device Tree Generator to the Vitis repositories
Create a new device tree project
Build BOOT.bin, uImage, devicetree.dtb and copy them to your SD card
Boot your device
Check /proc/device-tree/ for your device
Begin with the driver development
Export your driver to Kconfig and Yocto (or use him as a loadable module)
You can find all the steps in my Wiki. Feel free to ask me.
But please note: The tutorial isn´t that new and unfortunately I don´t add a custom IP integration to that tutorial (maybe I will add it soon) but it should show you the way how you can do it.

Linux - boot in runlevel3 and add X11 components

I want to build a minimum Linux for embedded devices that comes with Firefox only.
Questions:
Is it ever possible to add X11 components to runlevel3 and
upgrade it to runlevel5?
Is it possible to setup a Linux in runlevel3 with minimum display support so that I be able to run
Firefox? (Not interested in text based browsers)
I gave it a go but I got lots of dependency errors trying to install X11-common with apt-get in runlevel3.
Linux From Scratch is a step-by-step instruction book for anyone who wants to gain a good understanding of how to build own custom Linux distro.
There is a dedicated topic about X Window System Environment
This includes the base LFS project and a bunch of extensions derived from it. For embedded systems Cross Linux From Scratch is of particular interest.
Another option - in case you want to do it faster but losing deep understanding - is using some Embedded Linux distro builder like Buildroot

How does Root File System works on embedded linux?

I'am learning about embedded systems, and i was able to compile and setup a SAM9x35 EK with buildroot, mounting the bootstrap, the U-Boot, the Linux and The rootfs (Buildroot's basic RFS[root file system]skeleton).
I have LOTS of questions, but one of the most important is:
Pre Question Statements, for context:
I already have a provided JFFS2 with and app inside that is made of several NetBeans (c++) projects.
These projects use kernel built in (if selected in buildroot's menu) libraries
How does it work?
How the rootfs and the netbeans (makefiles) connect to linux packages?
What I mean is, How the kernel manages the makefiles from the netbeans projects?
i.e.: If i create a project that shows a picture on the screen i add some needed packages to the rootfs and then this is flashed to the device. How the kernel knows how to read and run this app? What I have read after doing this question is that Kernel start some script in init.d folder. But I would like a more Conceptual explanation of the interaction between Kernel and Rootfs
Any Explanation could help me because i dont understand how exactly works. The application is a standalone application that is loaded at the start of the linux (power on) and is only that, it runs and uses hardware to go through its different functions.
Please feel free to use links or examples.
Thank you very Much.

How to create and deploy a customized embedded linux image

I have a customized Linux filesystem with some binaries and new folders in the root file system. This Linux filesystem is created for small board computer.
Currently, I compress the root folder of the customized filesystem to a tar.gz file. With this tar.gz file I can share it to my friends. Then this file have to be extracted to their SD card. With this method they can also update a libraries or binary for testing.
However, this mechanism (creating and deploying) takes a lot of time.
My questions are:
1. How can I improve the creating and deploying customized linux image?
2. If I see the linux distributions, they use .iso or .img format. What is the reason using .iso or .img instead of tar.gz or zip file?
Thanks.
You have two steps to speed up:
Create an image that is shareable with your friends
Deploy the image on the board to test it
1. Step
Automate as much as you can. You could even set up a Jenkins server which should be able to automate anything that looks like a repetitive job. (compiling, compressing, uploading or sending the image to friends)
Compress your image using all your cores. AFAIK gzip does only use one core. pigz should compress/decompress faster
2. Step: Run your rootfs from an NFS.
This is the real time saver because you don't need to copy your rootfs to a sdcard anymore:
If your bootloader supports it, use nfs/tftp boot. Your board then boots directly from a network mount instead of a sdcard. I dont know which bootloader you use, but u-boot supports it, and others probably do as well.
it depends from what exactly need to be updated. If this is entire filesystem that is always changing - then just distribute the compressed img (by xz for example). if this is some small part of the system - just use the package manager, i.e. extract this part to package, next create this new package using the standard distro tools and distribute only it.
So if your SD card image has the fixed size - you can use rsync/xdelta to distribute only changes, but their efficiency depends from the exact changes percentage.

How to compile the Linux kernel to be as small as possible?

I'm working on a side project which requires me to configure and compile a tiny Linux System based on Ubuntu.
The result should be a tiny OS with the following features:
A Bootloader
A Kernel
A Process
A Thread
Miscellaneous (if possible)
A File System
Virtual memory
A Console
I read lots of documents about it, one of them being: http://users.cecs.anu.edu.au/~okeefe/p2b/buildMin/buildMin.html#toc3
I deleted the file system, and recompiled the kernel using make xconfig. I tried to deactivate modules and configurations many times, but it's not working for me.
How can I configure the kernel for the OS with only the features I listed above? What options can I disable or enable while still having a working system?
Having the Kernel very small is not important for Ubuntu, so maybe choosing Ubuntu is part of your problem. I would use as starting point what OpenWRT does. They do a good work making the Kernel small and it is easy to get started. OpenWrt Buildroot – Usage
try Linux From Scratch. It is a step by step approach on building a minimal Linux system from which you can evolve later on. http://www.linuxfromscratch.org/.
Use Gentoo Linux distribution - it's great for practicing on creation of Linux systems. Gentoo has excellent setup documentation, for example about configuring the kernel.
And Gentoo is a little easier and faster to setup than Linux From Scratch (LFS). If you want to go deeper, then LFS may be a good learning step too.

Resources