why buildroot fails to make the .config? - makefile

I'm somehow new to buildroot makefile and I created my own configuration file for a new operating system. After typing
make menuconfig
I saw that the buildroot has made the .config file. but when I type
make
it gives the following error:
linux/linux.mk:69: *** No kernel device tree source specified, check your BR2_LINUX_KERNEL_USE_INTREE_DTS / BR2_LINUX_KERNEL_USE_CUSTOM_DTS settings. Stop.
what does it mean ? what did I forget to include in buildroot configuration menu ?
I searched the internet and didn't find anything useful ... I've looked at the build root documentation and didn't find anything neither ....

In addition to the buildroot .config, you need a linux config. You can create one by:
make linux-menuconfig
See:
How do I configure the Linux kernel within Buildroot?
http://buildroot.org/downloads/manual/manual.html#kernel-custom

Which board do you plan to run the produced image on? Which platform are you building for? Check the output of the following command:
grep ^BR2_ARCH .config
If it is i386 or x86_64, you likely do not need Device Tree support, so just disable it using make menuconfig (search for BR2_LINUX_KERNEL_USE_INTREE_DTS or BR2_LINUX_KERNEL_USE_CUSTOM_DTS by pressing /).
Also check out http://elinux.org/Device_Tree for a detailed description of Device Tree.

It means that you don't have a device tree source file set. There's several different reasons for this. The first thing to check is:
make menuconfig
Select the Kernel options. Near the bottom is the option for "Device tree source". If that's set to "Use a custom device tree file" and you don't have a good path set in the next option, "Device Tree Source file paths", then you will get this error. Alternatively, if it's set to "Use a device tree present in the kernel" and the "Device Tree Source file names" option is blank or the name(s) have .dts at the end, you may get this error.

Related

Vitis PetaLinux build cant fetch required files while building an application project

I want to build a PetaLinux Image for my Ultra96v2.
I followed this guide up until building my application project in Vitis. It looks promising but then while building the application project for my custom platform, Vitis throws this error:
18:08:28 **** Incremental Build of configuration Debug for project dpu_appl_system ****
make all
Generating bif file for the system project
Executing command '::scw::generate_bif -xpfm /media/user/6b04b610-ff80-4702-a575-b0b1a78fbafb/dpu_pkg/dpu_demo/export/dpu_demo/dpu_demo.xpfm -domains linux_domain -bifpath /media/user/6b04b610-ff80-4702-a575-b0b1a78fbafb/dpu_pkg/dpu_appl_system/Debug/system.bif' on XSCT
sdcard_gen --xpfm /media/user/6b04b610-ff80-4702-a575-b0b1a78fbafb/dpu_pkg/dpu_demo/export/dpu_demo/dpu_demo.xpfm --sys_config dpu_demo --bif /media/user/6b04b610-ff80-4702-a575-b0b1a78fbafb/dpu_pkg/dpu_appl_system/Debug/system.bif --bitstream /media/user/6b04b610-ff80-4702-a575-b0b1a78fbafb/dpu_pkg/dpu_appl/_ide/bitstream/dpu_hardware.bit --sd_file /media/user/6b04b610-ff80-4702-a575-b0b1a78fbafb/dpu_pkg/dpu_appl/Debug/dpu_appl.elf
creating BOOT.BIN using /media/user/6b04b610-ff80-4702-a575-b0b1a78fbafb/dpu_pkg/dpu_appl/_ide/bitstream/dpu_hardware.bit
Running /home/user/Xilinx/Vitis/2021.2/bin/bootgen -arch zynqmp -image /media/user/6b04b610-ff80-4702-a575-b0b1a78fbafb/dpu_pkg/dpu_appl_system/Debug/sd_card_temp/boot.bif -w -o i BOOT.BIN
ERROR:BootGen - syntax error
Line #13, "/media/user/6b04b610-ff80-4702-a575-b0b1a78fbafb/dpu_pkg/dpu_appl_system/Debug/sd_card_temp/boot.bif".
... emo/sw/atf,dpu_demo/boot/bl31.elf
^
[ERROR] : BIF file parsing failed with code 1
Error writing SD card data : Error when running '/home/user/Xilinx/Vitis/2021.2/bin/bootgen -arch zynqmp -image /media/user/6b04b610-ff80-4702-a575-b0b1a78fbafb/dpu_pkg/dpu_appl_system/Debug/sd_card_temp/boot.bif -w -o i BOOT.BIN'
make: *** [makefile:42: package] Error 1
18:08:36 Build Finished (took 7s.643ms)
It specifically shows me, that there is a comma in the path where it searches for the file. The files are available
at the "normal" location, without the "atf,", "dtb,", etc
at the "weird" location. I created the path so the requested path exists for every file that throws an error message, like
/media/user/6b04b610-ff80-4702-a575-b0b1a78fbafb/dpu_pkg/dpu_appl_system/Debug/sd_card_temp/boot.bif". ... emo/sw/atf,dpu_demo/boot/bl31.elf
I created the path with the weird artefact "arf,dpu_demo", with the komma in the path, but still it wont work. Is this some kind of problem with Vitis, like some env variables not set correctly, or is the building mechanism just acting weird? I cant resolve this issue, because I am not able to change the paths it is supposed to look for the files. This hinders me in advancing my project. I work on Ubuntu 20.04.
Can anyone help me out here, please? I would really appreciate it!
I asked this question in the Xilinx Community, too, but unfortunately there was no resonance at all.
Thank you so much in advance!
PLEASE READ THE WHOLE ANSWER FOR ACTUAL SOLUTION
I think I got it now, though I did not verify whether the image actually works on my Ultra96v2, yet.
I noticed, that the weird path with commata is inside of the boot.bif and system.bif.
So the first time I tried to build it, the bif wasnt there, but got created (I assume). The bif was ready then but only had a weird path inside, so I took the makefile (you can find it in debug/sd_card), copied it, and just commented out the line GENERATE_BIF_XSCT_CMD = ${GENERATE_BIF} -xpfm ${XPFM_PATH} -domains ${DOMAINS} -bifpath ${BIF_PATH}.
Then I edited the boot.bif and system.bif and changed the atf,boot, uboot,boot, and dts,boot to just boot, so the BootGen wouldnt look into the directories with the commata anymore, but only the boot-directory which was specified.
Once that was set up, I executed the edited makefile in my console, by going into the sd_card-directory and executing the following command:
make -f <your_edited_makefile>
This means, that you cant press "build" in Vitis, it wont work. You build the content on your own and wont get a green check mark beside the project! Then the sd_card-directory was populated with (I assume) all necessary data to boot the Ultra96v2 from SD card. This was the content:
boot.scr
BOOT.BIN
dpu_appl.elf (your application project name, I guess)
README.txt
system.dtb
The underlying issue seem to have been that the ::scw::generate_bif created a path to look after, which didnt exist. Really weird issue, in my opinion.
UPDATE:
I just made some changes to the PetaLinux config with the petalinux-config command and rebuilt everything. Once I go to the Vitis part, I changed the system.bif within Vitis itself, and the project compiled successfully, also populating the sd_card directory, as it seems.
UPDATE 2:
Everything failed, so I tried to get to the *.bif of the Application System project. I opened it (linux.bif) and edited the "atf,", "dtb," and "uboot," out of it. Since this is only created once and references by the following files, this fixed my issue and the build was completed successfully in Vitis. So just ignore my originial answer and update.
I hope this is working and hope it will help some of you.

How to queue patches in Yocto

Background
I have a microcontroller board which has STM32MP157 chip on it, with a development board. The manufacturer provides a Yocto BSP layer for this device and the development board and it is found on an open Github repository.
The important thing to note is that the BSP layer applies important devicetree patches to the stable release of the Linux kernel.
What I want
I would like to modify parts of the devicetree that is provided by the manufacturer's BSP layer, basically add to it.
What I have done
I have created a layer, named meta-mx-dts, put it after the manufacturer supplied layer in the build/conf/bblayers.conf file, and made it with higher priority by setting BBFILE_PRIORITY_meta-mx-dts in meta-mx-dts/conf/layer.conf (so that it applies after the manufacturer supplied layer). Finally, I made a file linux-stable_5.4.bbappend as follows:
FILESEXTRAPATHS_append := ":${THISDIR}/${PN}"
SRC_URI_append = "file://dts.patch"
and placed the dts.patch file properly.
The error I get
The error stack can be summarized by this line (from the error stack):
error: arch/arm/boot/dts/stm32mp157c-dhcom-pdk2.dts: does not exist in index
Where stm32mp157c-dhcom-pdk2.dts is the devicetree file to be created by the patches in the manufacturer's BSP layer. My patch applies to that file specifically.
What I have tried so far
I have tried different ways to append/prepend the dts.patch to the SRC_URI variable, until I got it appear after the patches directory applied by the BSP layer, by checking in the following ways in the treminal:
bitbake -e linux-stable | grep SRC_URI
bitbake -e virtual/kernel | grep SRC_URI
However, that didn't solve the issue. I also tried to make the SRC_URI append operation to be specific to the machine:
SRC_URI_append_dh-stm32mp1-dhcom-pdk2 = "file://dts.patch"
That didn't help either.
UPDATE
I have also tried to append to KERNEL_FEATURES variable and use .scc file, where I specify patches, as follows:
# The .bbappend file
KERNEL_FEATURES_append = " mx.scc "
SRC_URI_append = " file://mx.scc;type=kmeta "
with the file mx.scc being like:
define KMACHINE dh-stm32mp1-dhcom-pdk2
define KTYPE standard
define KARCH arm
branch dh-stm32mp1-dhcom-pdk2
patch dts.patch
With no effect.
Need your help
Thanks

Gstreamer 1.0 no such or plugin 'videotestsrc' on buildroot problem

I tried to play video with gstreamer-1.0 on buildroot. I opened elements of gstreamer on buildroot. But when I use gst-inspect command, I can not find elements what actived on buildroot. For example I activated videotestsrc. When I want use this element, I take no such element or plugin 'videotestsrc' error.
Also I tried export library. I used this command:
export LD_LIBRARY_PATH=/usr/bin/gstreamer-1.0
export GST_PLUGIN_PATH=/usr/bin/gstreamer-1.0
export GST_PLUGIN_1_0
but result did not change. How can I fix this? How can I work gstreamer-1.0 on buildoot?
Note: Buildroot 2019.05-rc1, kernel 5.0.14, u-boot 2017-05, microprocess Allwinner A13
Update(16.05.2019)
defconfig:
BR2_arm=y
BR2_cortex_a8=y
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_11=y
BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_TARGET_GENERIC_HOSTNAME="GenOS"
BR2_TARGET_GENERIC_ISSUE="Welcome to Mega7"
BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
BR2_ROOTFS_POST_BUILD_SCRIPT="board/olimex/a13_olinuxino/post-build.sh"
BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/olimex/a13_olinuxino/genimage.cfg"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.11.5"
BR2_LINUX_KERNEL_DEFCONFIG="sunxi"
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_INTREE_DTS_NAME="sun5i-a13-olinuxino"
BR2_LINUX_KERNEL_INSTALL_TARGET=y
BR2_PACKAGE_ALSA_UTILS=y
BR2_PACKAGE_FFMPEG_FFPLAY=y
BR2_PACKAGE_FFMPEG_AVRESAMPLE=y
BR2_PACKAGE_GSTREAMER1=y
BR2_PACKAGE_GST1_PLUGINS_GOOD=y
BR2_PACKAGE_GST1_PLUGINS_BAD=y
BR2_PACKAGE_GST1_PLUGINS_UGLY=y
BR2_PACKAGE_GST1_INTERPIPE=y
BR2_PACKAGE_GST1_LIBAV=y
BR2_PACKAGE_DIRECTFB=y
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SWRAST=y
BR2_PACKAGE_MESA3D_DRI_DRIVER_SWRAST=y
BR2_PACKAGE_MESA3D_OPENGL_EGL=y
BR2_PACKAGE_MESA3D_OPENGL_ES=y
BR2_PACKAGE_XORG7=y
BR2_PACKAGE_XSERVER_XORG_SERVER=y
BR2_PACKAGE_XAPP_SETXKBMAP=y
BR2_PACKAGE_XAPP_TWM=y
BR2_PACKAGE_XAPP_XCLOCK=y
BR2_PACKAGE_XAPP_XINIT=y
BR2_PACKAGE_XAPP_XRANDR=y
BR2_PACKAGE_XDRIVER_XF86_INPUT_KEYBOARD=n
BR2_PACKAGE_XDRIVER_XF86_INPUT_MOUSE=y
BR2_PACKAGE_XDRIVER_XF86_VIDEO_FBDEV=y
BR2_PACKAGE_XDRIVER_XF86_VIDEO_FBTURBO=y
BR2_PACKAGE_XTERM=y
BR2_PACKAGE_OPENBOX=y
BR2_PACKAGE_PYTHON=y
BR2_PACKAGE_LIBDRM_NOUVEAU=y
BR2_PACKAGE_LIBGTK3=y
# BR2_PACKAGE_LIBGTK3_BROADWAY is not set
# BR2_PACKAGE_LIBGTK3_WAYLAND is not set
BR2_PACKAGE_LIBGTK3_DEMO=y
BR2_PACKAGE_LIBSERIALPORT=y
BR2_PACKAGE_SCREEN=y
BR2_PACKAGE_SUDO=y
BR2_PACKAGE_HTOP=y
BR2_PACKAGE_NANO=y
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
BR2_TARGET_ROOTFS_EXT2_SIZE="300M"
BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
BR2_TARGET_UBOOT_CUSTOM_VERSION=y
BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2017.05"
BR2_TARGET_UBOOT_BOARD_DEFCONFIG="A13-OLinuXino"
BR2_TARGET_UBOOT_NEEDS_DTC=y
BR2_TARGET_UBOOT_SPL=y
BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin"
BR2_TARGET_UBOOT_BOOT_SCRIPT=y
BR2_TARGET_UBOOT_BOOT_SCRIPT_SOURCE="board/olimex/a13_olinuxino/boot.cmd"
BR2_PACKAGE_HOST_DOSFSTOOLS=y
BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_MTOOLS=y
BR2_PACKAGE_HOST_UBOOT_TOOLS=y
Thanks.
What is your buildroot configuration exactly? (run make savedefconfig and paste the defconfig file here). Notice that Buildroot will not notice changes to the many gst1-plugins-* options after you have done a build, so you need to do a clean build (make clean; make) for the changes to take effect.
See the manual for details:
https://buildroot.org/downloads/manual/manual.html#full-rebuild

How do I change window managers with Yocto Project tools?

My Intent
I have an image generated by BitBake on which I'm interested in changing the window manager to metacity or maybe something similar.
My Process
I've added require recipes-graphics/images/core-image-x11.bb into my core recipe, which provides a simple Matchbox terminal window but seemingly no other functionality. If I add matchbox-desktop and matchbox-session-sato, it adds a bit more usability but not what I'm looking for.
I've included the default package from the metacity_2.34.13.bb recipe from the meta-gnome layer from the OpenEmbedded Metadata Index in the IMAGE_INSTALL variable of my core image. This installs several components including a metacity command in /usr/bin. If I run that command, I get the following message:
GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications
(metacity:1124): GLib-GIO-ERROR **: Settings schema 'org.gnome.metacity' is not installed
Trace/breakpoint trap
I've navigated to /usr/share/glib-2.0/schemas and run glib-compile-schemas ., then run:
startx
metacity --replace
again. Now, the output is:
Window manager error: Unable to open X display
I haven't found a clear solution to this error which applies to my specific situation.
Update (2/29):
I may have now found a solution to this error, using these commands:
X&
export DISPLAY=:0
metacity&
At this point, I seem to be running something on one of my VTs. I can run demos like glxgears in that VT (glxgears is included in the mesa-demos recipe), but I don't know how to actually create a usable environment.
My question(s)
I'm not using much from meta-openembedded/meta-gnome (just metacity) or meta/recipes-gnome (adwaita-icon-theme, gnome-desktop3, gsettings-desktop-schemas and gtk+3), so am I missing some recipe which automates the addition of metacity?
(if not Question 1) How can I solve the error Window manager error: Unable to open X display?
The x11-common recipe adds a X session script that will run /usr/bin/x-session-manager: that is responsible for starting your desktop environment.
The way to implement a new session/DE in OE-Core is to use update-alternatives for "x-session-manager": see the matchbox-session recipe for the default implementation and mini-x-session recipe for an alternative.
mini-x-session might be modifiable for your needs so you don't need to write a new one: A /etc/mini_x/session file like this might do the trick:
# start any apps here, e.g. "my-desktop &"
exec metacity
Going from this (a running window manager) to "usable environment" might still be lots and lots of work, depending on your definition of usable.

Code::Blocks debugger shows some other path which isn't included in the project

I'm trying to use code::blocks debugger. I followed this basic tutorial on how to do it. I also watched two videos on you tube. I was actually trying it on a bigger file which had its declaration & implementation in separate files (one was header file tree.h, one had its implementation tree.cpp & the last one had implementation_tree.cpp main function to check the header file) but it didn't work so I tried it on a very simple program. But now debugger shows this error
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: F:\Coding\test\test\
Adding source dir: F:\Coding\test\test\
Adding file: F:\Coding\test\test\bin\Debug\test.exe
Changing directory to: F:/Coding/test/test/.
Set variable: PATH=.;C:\Program Files\CodeBlocks\bin;C:\Program Files\CodeBlocks;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0
[debug]Command-line: F:\Coding\Data Structures\tree.h -nx -fullname -quiet -args F:/Coding/test/test/bin/Debug/test.exe
[debug]Working dir : F:\Coding\test\test
Starting debugger: F:\Coding\Data Structures\tree.h -nx -fullname -quiet -args F:/Coding/test/test/bin/Debug/test.exe
failed
Whatever is in this line [debug]Command-line: is the address of my tree.h file which I was trying to debug earlier. But now I've removed all the breakpoints & everything related to that file from Code::Blocks & even changed that file's location but it still shows that same address in Starting debugger:. I've also rebuilt my test program after deleting everything related to it several times but I'm still getting the same error. I'm using GDB.
I'm so sorry if this question sounds very silly as I'm trying this for the first time & not being able to proceed through any tutorials or any other forum or anything else. I've also seen other related questions on stackoverflow but none of them works for me. So, please help. Thanks.
Settings -> Compiler -> Search Directories.. Delete all paths from there.

Resources