Constructing an Embedded Linux Image for qemux86-64 using yocto project

 Hello All,

In this blog we are going to see how we can construct an embedded linux image for "qemux86-64" and verifying the booting using qemu(quick emulator) using yocto project

pre-requisite: 

you need to be familiar with my previous articles as it contains details of setup environment

link to my previous articles:

https://learnyoctowithme.blogspot.com/2022/03/constructing-embedded-linux-image-for.html

https://learnyoctowithme.blogspot.com/2022/03/constructing-embedded-linux-image-for_22.html

Building an embedded linux image for qemux86-64 using yocto project:

Step 1: Download the Poky Source code

$ git clone git://git.yoctoproject.org/poky
$ cd poky

step 2 : checkout to the branch dunfell
 
$ git checkout dunfell 

step 3: download the meta-openembedded source code from github

$ git clone https://github.com/openembedded/meta-openembedded
 
$ cd meta-openembedded 

$ git checkout dunfell

$ cd ..

step 4: Inside the poky folder ,source the oe-init-build-env script

$ source ./oe-init-build-env build_x86

NOTE : This will create a build environment inside the folder build_x86

step 5: Go to folder build_x86 and inside build_x86 folder you can observe conf directory with two files named as bblayers.conf and local.conf

 step 6 : Edit the local.conf file as below

    set the MACHINE variable as  MACHINE ?? = "qemux86-64"


and append the following line to local.conf file as INHERIT+="rm_work"


INHERIT+="rm_work" will saves the disk space while building the image

step 7: Now add the openembedded layers to bblayers.conf file as

Inside build_x86 folder , type the following commands:

$ bitbake-layers add-layer /home/shashank/poky/meta-openembedded/meta-oe/
$ bitbake-layers add-layer /home/shashank/poky/meta-openembedded/meta-python/
$ bitbake-layers add-layer /home/shashank/poky/meta-openembedded/meta-networking/
$ bitbake-layers add-layer /home/shashank/poky/meta-openembedded/meta-multimedia/
$ bitbake-layers add-layer /home/shashank/poky/meta-openembedded/meta-filesystem/
$ bitbake-layers add-layer /home/shashank/poky/meta-openembedded/meta-perl/
$ bitbake-layers add-layer /home/shashank/poky/meta-openembedded/meta-webserver/
$ bitbake-layers add-layer /home/shashank/poky/meta-openembedded/meta-initramfs
$ bitbake-layers add-layer /home/shashank/poky/meta-openembedded/meta-gnome
$ bitbake-layers add-layer /home/shashank/poky/meta-openembedded/meta-xfce

 and the final bblayers.conf file should look as 



step 8: Now inside the build_x86 folder, run the command as

$ bitbake core-image-minimal 


NOTE: The build will take enough amount of time based on your system configuration.
                for me it took 2-3hrs to complete the build as I have 8 core 16 threads CPU

step 9: Now verify the booting of your image using the command

$ runqemu nographic


NOTE: default username will be root with empty password

That's it now we have constructed our embedded linux image for qemux86-64 and verified the booting using qemu.

 


Comments

Popular posts from this blog

Adding custom splash screen to yocto image

Adding kernel module in to our image and installing in root file system using yocto project

Adding libraries (pciutils,usbutils and util-linux) to our image using yocto project