Building embedded GNU/Linux distribution for Raspberry Pi using the Yocto Project
HTML-код
- Опубликовано: 16 сен 2024
- Step by step tutorial for building a command line interface image of a custom embedded GNU/Linux distribution for Raspberry Pi 2 using the Yocto Project and Openembedded. Exact steps:
www.instructabl...
Exactly what I needed for a head start. Thanks Leon!
Hi Andrej, I am glad that you like the video :) Stay in touch :)
Thanks man, this totally helped with my first build.
Cool :) You are welcome :)
Thanks also for the instructables page!
Glad it was helpful! Keep in mind that nowadays you should use the latest stable or long-term support release of the Yocto Project.
Thanks man this totally helped me.
Happy to hear this tutorial is still useful :) Thanks for the feedback.
thanks a lot, it really helped us getting started
Glad to hear the video is still useful. It has been a while since the video was published so Yocto and OpenEmbedded evolved in the mean time. Thanks for the feedback!
Hi
How do you enable the camera interface in such customized OS? Do you have an image to share?
Using VIDEO_CAMERA = "1" Please check the details in meta-raspberrypi README.
Hi man... i'm building a raspberrypi 1 image, but when i'm compiling the image, i got an error: binutils-2.34-r0 do_compile: oe_runmake failed. How could i fix that error?
The error log should contain details to debug the problem. Which Yocto release are you using? The video is a bit old therefore I suggest using an up to date long-term support release.
Hi Leon.
It's possible to emulate the raspberry pi image using QEMU(Quick Emulator)? I have dealing with this for a long time!
I built the image and it boots perfectly on the raspberry pi.
Thanks!
yes you can
Does these steps work with new yacto release 2.4.2 (rocko)
Yes, the basic steps with Yocto/OE and meta-raspberrypi are the same. Yocto has a release twice per year. As of the moment the current stable is 3.2 with codename Gatesgarth:
wiki.yoctoproject.org/wiki/Releases
Hello, I am trying to build the smallest possible linux image using the Yocto project. While i was searching on net , i found some solutions like using busybox instead of systemV or systemd , using uClibc instead of glibc, Thumb2 instructions instead of 32 Arm instructions .. Do you have any idea how and where i can make this changes ? Do you have any other solutions to make smaller image and rootfs size ?
The Yocto Project Mega manual contains all the information needed to customize the image according to your needs. Depending on your exact requirements it could be a complex procedure. Here is the manual: www.yoctoproject.org/docs/current/mega-manual/mega-manual.html
I need my device to boot straight to the console (without requiring the user to enter in a username and password, since my project uses a touchscreen only and no keyboard so logging in manually is impossible) and run a certain Qt program I wrote. How would I do this? Is this possible to configure in Debian or openSUSE or do I need to roll my own distro?
yes, you can do this but the solution depends on the exact technical details. Is the Qt app running on X11, Wayland or just framebuffer? Which console do you have in mind, serial? I am not sure what is your end-gola but I guess you are looking for a kiosk mode that automatically launched a specific app on start-up.
@@LeonAnavi Yes, a kiosk mode is what I need. It's running on X11. Getting the app to run on startup is no problem: all I need to do is make it so it requires no user input to log in and run the app.
@@LeonAnavi *and for serial, I just have the raspberry pi connected to the touchscreen via the display cable if that's what your asking
@@christianitis which window manager for X11 are you using?
@@LeonAnavi i3
Hell Leon Anavi, I have tried to build an image for raspberry pi 3. But i had an issue, my image can not jump command line interface. It had a screen like an image at 4:57 in your video. Please help me to fix it.
In the video, I didn't understand why you need an ethernet cable to connect internet ?
Thank you.
Please note that the video is for Raspberry Pi 2. If you are building an image or Raspberry Pi 3 or another version please set it at conf/local.conf. I need an ethernet cable because Raspberry Pi 2 does not have built-in WiFi.
of course, I have configured MACHINE by "raspberrypi3" in local.conf file. I only want to know why my image that is builded successful, but it is stopped the same image at 4:57 in your video. I can not go to command line interface. If you know, please tell me your solution to fix it. Thank you.
hi i want to create an android tv 9 image for rpi3
Android is a different story. Have a look at this article at MagPi about running Android on Raspberry Pi: magpi.raspberrypi.org/articles/android-raspberry-pi
You can also consider running Kodi on top of Poky, the reference distribution of the Yocto Project on Raspberry Pi. I am maintaining such a Yocto/OE distro as a small hobby project for my personal needs here: github.com/leon-anavi/media-hub/releases
hello Leon
Its really a great insight for the beginners.
I have followed the same steps that you had mentioned, but i am facing a error:
[ bitbake rpi-basic-image
ERROR: Unable to parse /home/sandeepch/yocto/poky/bitbake/lib/bb/parse/parse_py/ConfHandler.py
Traceback (most recent call last):
File "/home/sandeepch/yocto/poky/bitbake/lib/bb/parse/parse_py/ConfHandler.py", line 188, in feeder(lineno=40, s='DEFAULT_TEST_SUITES:append:rpi = " parselogs_rpi"', tements=[, , , , , , , ]):
> raise ParseError("unparsed line: '%s'" % s, fn, lineno);
ParseError: ParseError at /home/sandeepch/yocto/poky/meta-raspberrypi/conf/layer.conf:40: unparsed line: 'DEFAULT_TEST_SUITES:append:rpi = " parselogs_rpi"' ]
I am using raspberrypi3.
Could you help me out with that error?
Please note that this tutorial is for older release of Yocto Project and OpenEmbedded. Although in general the approach is still the same, recently there were some syntax changes in the main branches (replacing _ with : in append/preppend) which are causing errors like the one you see. I recommend you to use a long-term Yocto release like Dunfell which is based on the old syntax (the same used in the video).
@@LeonAnavi Thanks, i will try with Dunfell
Which is the best linux distro for embedded system development??
With Yocto and OpenEmbedded you can build exactly what distribution you need for your embedded systems. This will definitely be the best end result because it will fit your exact needs.
The one fitting your exact requirements...
Hi thanks for your videos. I have compiled for the rpi3 , but I have issues with the wifi. I followed the steps of your video.
This tutorial is for Raspberry Pi 2. You have to change the machine name in conf/local.conf for other versions. It is recommended to use the latest stable release of Poky.
+Leon Anavi thanks for your reply!. I have changed my local.conf and I used the last version "Krogoth" . But I have the same results.
What exactly is the issue that you are having? Could you please provide details?
Well,I recompiled one more time and this time I have lucky... I can see my wlan0. Thanks man!
Hi! I’m having problems to connect the USB keyboard … I don’t know why it’s happening this … can you help me, please ? :(
Hm... what kind of a keyboard is it and what problems do you have? Which version of Yocto are you using? In general USB keyboards are human interface devices (HID) that are "plug and play" thanks to the Linux kernel that you are building as part of the the whole image that bitbake produces.
@@LeonAnavi it's a common USB keyboard and the problem is that when I initialize the system and try to introduce the password it doesn't work... I don't know if it's for the Yocto version (I'm trying with Zeus) do you recommend me to change it?
@@paolarayatolentino7684 I haven't experience such an issue. Is the same keyboard an rpi working fine with Raspberry Pi OS?
Release zeus is not supported anymore. In general I recommend using the latest stable version of the Yocto Project or the LTS release: wiki.yoctoproject.org/wiki/Releases
Hi..great thanks for uploading..May I know what will be Linux flavour which will be booted onto the raspberry from sd card??Is there any options to add Ui?How can I add Qt framework on to tht Linux..thanks..
With Yocto and Openembedded you can build any kind of custom GNU/Linux distribution for your Raspberry Pi. No problem to add GUI. There are drivers for hardware graphical acceleration in both X11 and Wayland. Use layer meta-qt5 to bring Qt to your image.
Hi Leon,
Could you please explain how to do same for beaglebone black revision C hardware??
It is the same approach. Just change the machine. Poky contains a machine configuration for beaglebone. Keep in mind that it is always recommended to use the latest stable release of the Yocto Project, which at the moment is warrior.
when i open linux by raspberry pi several commands are not found
So I can not build the linux kernel module to activate the jtag pins.
i need apt-get, apt, make ..
are there packages that I can add to use them or another solution?
In general the whole idea of the Yocto project and OpenEmbedded is to build an image for a particular device will packages that it needs. However it is possible to create package feed and use the smart package manager. Have a look at the Yocto Mega Manual for details.
@@LeonAnavi can you give me the packages of apt-get and make
@@fekihazem2195 you probably need packagegroup-core-buildessential that provides essential build dependencies. Have a look at the OpenEmbedded Layer Index: layers.openembedded.org/layerindex/branch/master/recipes/
Hi Leon,
Nice video. I am following your video but i m getting gstreamer error as follows:
ERROR: No recipes available for:
/home/rahul/poky/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.10%.bbappend
Things in Yocto/OE layers change over the time so you need to adjust a little bit. It seems that recipe gstreamer1.0-omx is not found and the bbappend file cannot extend it. Make sure that you are using the latest release of the Yocto Project. Probably this error won't affect you with the latest stable version. As of the moment it is Morty.
My raspberry pi is successfully booted.I have logged in as root.But now I am not able to login as pi.I am not able to use sudo command when logged in as root.So what command should I use to install new packages directly on Raspberry pi monitor interface when logged in as root??
By default you don't have pi user in Poky. Running package management in Yocto/OE is kind of an advanced tasks. Please refer to tutorials how to achieve it. In the past I wrote an article for on of the distributions based on Yocto/OE that might be useful but it is a bit outdated and you need to adapt it to your particular case: wiki.tizen.org/Runtime_package_management_in_Tizen_on_Yocto_with_Smart
Thanks for the reply,are there any commands which I can use to install new things(not necessarily packages) and use startx on our system on raspberry pi interface built on yocto (same as when we use putty in windows for installation?)
you can enable ssh to login remotely. If you want X11 you should build appropriate image with GUI.
Is there any of your video on using wiringpi in order to work with some sensors using root as a username??
Yes have a look at this one as well as the one for HTU21D:
ruclips.net/video/pyg27uj0Xns/видео.html
Can we remove (or comment out ) meta-yocto-bsp in bblayers.conf because we use BSP from Raspberry (meta-raspberrypi)?
I don't think this is a good idea.
Why not? meta-yocto-bsp doesn't contain any BSP stuff related to Raspberry. In my case i removed it and all was compiled well and works on pi3 (moreover images are the same with meta-yocto-bsp and without, I guess it says that such layer is not involved in build process for Raspberry).
Layer meta-yocto-bsp brings BSP for Yocto Project reference hardware. This was you can eventually build the same images not only for Raspberry Pi but also for Beaglebone or Intel x86/x86-64 devices. It doesn't interfere your rpi images. What is the point to remove it?
The reason is that I wanted to clarify what exactly involved in build process for pi3 target. And I don't like to collect an additional stuff which not used in the project I guess it's more clear for understanding (e.g. like you comment out the unused stuff for qemu). And BTW: thanks for the video!
Have a look at bitbake -g option for generating dependency graphs. It is a great tool to clarify what is in the image and what are the dependencies between the different packages: www.yoctoproject.org/docs/2.2/bitbake-user-manual/bitbake-user-manual.html#bitbake-user-manual-command
Hi
I would like to build a custom kernel for the RPI2? I tried the cross compilation method but was not successful. Could you please help me.
Follow the instructions at eLinux wiki for building a kernel for Raspberry Pi elinux.org/Raspberry_Pi_Kernel_Compilation
hi, how do i add c make nano editor thanks,
Add to local/local.conf a line with: IMAGE_INSTALL_append=" nano "
how about gnu c compiler, thank you so much
It the same procedure for any package. Read the details about IMAGE_INSTALL_append in the Yocto Mega Manual, search for layers that bring the required package in OpenEmbedded Layer Index.
Tu ne serais pas francais par hazard ?
No, sorry, I am fluent only in Bulgarian and English :)
אנה ואלזה
Hm, I am not sure how is this comment related to the video. Hope you like it though :)