Buildroot trouble shootings
来自个人维基
1. toolchain-external-custom Configuring
Incorrect selection of kernel headers: expected 4.10.x, got 4.20.x
=> toolchain 配置错误, modify configd/defconfig
BR2_TOOLCHAIN_EXTERNAL=y BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y BR2_TOOLCHAIN_EXTERNAL_PATH="/opt/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu" BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="aarch64-linux-gnu" BR2_TOOLCHAIN_EXTERNAL_GCC_7=y BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_10=y BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y BR2_TOOLCHAIN_EXTERNAL_CXX=y
To check kernel headers version of the toolchain:
cat /opt/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/libc/usr/include/linux/version.h
#define LINUX_VERSION_CODE 264707 (=0x040a03)
Match the required version 4.10
2. Download package too slow
Use download_cache, add
BR2_DL_DIR="/data/download_cache/buildroot"
3. add OpenCV4 into rootfs
vi package/opencv4/opencv4.mk
#with Qt5 ifeq ($(BR2_PACKAGE_OPENCV4_WITH_QT5),y) OPENCV4_CONF_OPTS += -DWITH_QT=5 OPENCV4_DEPENDENCIES += qt5base else OPENCV4_CONF_OPTS += -DWITH_QT=OFF endif #add gapi OPENCV4_CONF_OPTS += -DBUILD_opencv_gapi=ON #with OPENCL OPENCV4_CONF_OPTS += \ -DWITH_OPENCL=ON \ -DWITH_OPENCL_SVM=OFF \ -DWITH_OPENCLAMDBLAS=ON \ -DWITH_OPENCLAMDFFT=ON
BR2_PACKAGE_OPENCV4=y # # OpenCV modules # BR2_PACKAGE_OPENCV4_LIB_CALIB3D=y BR2_PACKAGE_OPENCV4_LIB_DNN=y BR2_PACKAGE_OPENCV4_LIB_FEATURES2D=y BR2_PACKAGE_OPENCV4_LIB_FLANN=y BR2_PACKAGE_OPENCV4_LIB_HIGHGUI=y BR2_PACKAGE_OPENCV4_WITH_QT5=y # # opengl support needs an OpenGL provider # BR2_PACKAGE_OPENCV4_LIB_IMGCODECS=y BR2_PACKAGE_OPENCV4_LIB_IMGPROC=y BR2_PACKAGE_OPENCV4_LIB_ML=y BR2_PACKAGE_OPENCV4_LIB_OBJDETECT=y BR2_PACKAGE_OPENCV4_LIB_PHOTO=y BR2_PACKAGE_OPENCV4_LIB_SHAPE=y BR2_PACKAGE_OPENCV4_LIB_STITCHING=y # BR2_PACKAGE_OPENCV4_LIB_SUPERRES is not set # BR2_PACKAGE_OPENCV4_LIB_TS is not set BR2_PACKAGE_OPENCV4_LIB_VIDEOIO=y BR2_PACKAGE_OPENCV4_LIB_VIDEO=y BR2_PACKAGE_OPENCV4_LIB_VIDEOSTAB=y # # 3rd party support # BR2_PACKAGE_OPENCV4_WITH_FFMPEG=y BR2_PACKAGE_OPENCV4_WITH_GSTREAMER1=y BR2_PACKAGE_OPENCV4_JPEG2000_NONE=y # BR2_PACKAGE_OPENCV4_JPEG2000_WITH_JASPER is not set # BR2_PACKAGE_OPENCV4_JPEG2000_WITH_OPENJPEG is not set # BR2_PACKAGE_OPENCV4_WITH_JPEG is not set # BR2_PACKAGE_OPENCV4_WITH_PNG is not set BR2_PACKAGE_OPENCV4_WITH_PROTOBUF=y # BR2_PACKAGE_OPENCV4_WITH_TBB is not set # BR2_PACKAGE_OPENCV4_WITH_TIFF is not set BR2_PACKAGE_OPENCV4_WITH_V4L=y # BR2_PACKAGE_OPENCV4_WITH_WEBP is not set