Introduction to Embedded Linux Part 4 - Yocto Custom Image and Layer | Digi-Key Electronics
HTML-код
- Опубликовано: 16 сен 2024
- Linux is a powerful operating system that can be compiled for a number of platforms and architectures. One of the biggest draws is its ability to be customized for an application. Tools like Buildroot, OpenWRT, and Yocto Project help us create custom Linux distributions for embedded systems.
In this video series, we will explore Buildroot and the Yocto Project. We also demonstrate how you might develop applications for embedded Linux. We will not dive into the specifics of how each of these systems work but give you a good starting place so you can read or watch more advanced material about working with embedded Linux.
See this written tutorial if you would like to review the commands issued in this tutorial for the Yocto Project: www.digikey.co...
In the previous episode ( • Introduction to Embedd... ), we flashed our core-image-minimal image to an SD card and booted into Linux on our STM32MP157D-DK1.
In this episode, we see how to create a custom layer in the Yocto Project. Bitbake works by looking through various recipe files found in the different layers specified by bblayers.conf. By creating our own layer, we can control what aspects of the image gets changed, and we can keep the layer under version control to make building and flashing images easier (especially during production).
We use the bitbake-layers command to create a template layer for us, which we modify to generate a custom image. We copy the main recipe for generating core-image-minimal and use it as a starting point. We make a few changes to core-image-minimal.bb and rename it to custom-image.bb. These changes include expanding the root filesystem (rootfs) as well as setting a default root password.
We then include our custom layer (named meta-custom) in our build project (conf/bblayers.conf). This causes bitbake to read through the recipes in our layer and include them in the build process.
We build our custom image (by calling “bitbake custom-image”). When it’s done, we flash the output bootfs and rootfs onto our SD card. From there, we boot our ST32MP157D-DK1 and test the new root password and rootfs size (which should be around 200 MiB).
Product Links:
www.digikey.co...
Related Videos:
• STM32MP1 workshop - 1 ...
Related Project Links:
www.digikey.co...
Related Articles:
forum.digikey....
Learn more:
Maker.io - www.digikey.co...
Digi-Key’s Blog - TheCircuit www.digikey.co...
Connect with Digi-Key on Facebook / digikey.electronics
And follow us on Twitter / digikey - Наука
As usual, super amazing...🤟
Looking forward to having the entire series of the Yocto just like your previous FreeRTOS series ✌
Useful stuff, even if not widely viewed.
Ok . I swore off low level coding tutorials for a while u sir got me excited to try this stuff again . I mean the explanation of mounting the rootfs after the clock init (fsbl1 layer) is literally 🔥 . I always found it wired that there where loads of coding tutorials on high level concepts, but not low level like this where u really feel as if u know what’s goin on if u should encounter any errors . Kudos 💯
By now, I am used to press like before watching the video in this series :-)
Shawn is awesome. Extremely valuable resource...explains things in such an easy to understand way.
Just can't thank you enough
Very true
This is quite helpful ! Thank you
Great video!! Just the one I needed. Thanks a lot.
Free knowledge. Wow!
I wish all universities taught students like that 😁🤣😂
I guess the busybox that have the argument -P instead of -p when set the password.
To change the boot partition, you can use the sed(1) command, as you know what to change.
To redo the same command, you can try C-r to reverse search command line. Like C-r dd, and you can type C-r to continue search.
Is it the same thing when working with the Raspberry Pi ??
Shawn, thank you a lot, you are awesome
What a amazing session. Impressive content you cover.
Thanks for it.
I want to install docker into rugged board imx6ul
How can I install it ?
Great videos!
Not sure why, but setting the password with -P in plain text would not compile for me. I have to create an encrypted password and use the -p flag instead.
how to add library to yocto ...so that we can use that library in application and run in qemu??
I tried but It's saying wrong password.. I also removed the debug-tweaks as well. but I used -p rather then -P. If I use - P it's giving me error.
ERROR: custom-image-1.0-r0 do_rootfs: custom-image: usermod command did not succeed.
below command I'm using
EXTRA_USERS_PARAMS = "usermod -P 'toor' root"
for me lower -p worked
Here is the solution:
#Creating and setting password using kirkstone
#run in terminal
openssl passwd -6
Password: typeyourpassword
Verifying - Password: typeyourpassword
$6$CvYxu.4fiswa9Gah$xkiM8wJMb0Y49Op49aPjucbJSvMIePcO54JfMusKGP24GahxOKVnCUjyRCoH.sH6pQXuQ1SA.sIZ0E9szHjTY/
#Now add these lines in .bb file of local.conf file.
#use '\' before each $ sign in the encrypted passwd
inherit extrausers
EXTRA_USERS_PARAMS = "usermod -p '\$6\$CvYxu.4fiswa9Gah\$xkiM8wJMb0Y49Op49aPjucbJSvMIePcO54JfMusKGP24GahxOKVnCUjyRCoH.sH6pQXuQ1SA.sIZ0E9szHjTY/' root;"
@@AbdulRehman-eq3ns thanks man, I had the same issue
Great sir thank you
Is there any book to learn this, i am lost here
Anyone happened to encounter this issue: "usermod: prefix must be an absolute path"? It drives me crazy..
For me adding a ; between " and \ in EXTRA_USERS_PARAMS = "\ helped. In other words, I am doing this : EXTRA_USERS_PARAMS = ";\
For me, adding a semi-colin between " and \ helped. In other words, I am doing this : EXTRA_USERS_PARAMS = ";\
It built, but I havent flashed and checked login, so I don't know whether it is a proper fix.
VERY nice set of videos. However for me Yocto seems broken. I am using Ubuntu as the host machine, its a huge machine, plenty of ram, plenty of disc and plenty of everything. I have built a yocto and it works and now I want to mod it. I have done the sources command yet the create layer then bullshits that theres no space left on the device when it s trying to set up a watch. It even gives me a hint to look at the max user watches which is 65k... I would be more than a bit shocked that somehow this is not enough