我一直在玩Yocto,以便为我的Raspberry Pi生成图像,也是一个用于交叉编译的SDK。我想输入要在我的图像文件中安装的软件包并使用以下方法生成图像:
bitbake my-image
并使用:
生成sdkbitbake my-image -c populate_sdk
工作流程afaik是您提供bash文件并为交叉编译设置环境。
但是,由于某种原因(问题1) OEToolchainConfig.cmake
在我的案例中未生成sysroots/usr/share/cmake
。
到目前为止我的内容如下:
#To build SDK, use bitbake meta-toolchain or bitbake my-image -c populate_sdk
inherit core-image
# for populate_sdk to create a valid toolchain with qt5
inherit populate_sdk populate_sdk_qt5
##
inherit distro_features_check
DESCRIPTION = "My image."
LICENSE="CLOSED"
image_KERNEL_MODULES = " \
kernel-modules \
"
#Framebuffer driver for tft
image_DRIVERS = " \
xf86-video-fbdev \
"
image_DESKTOP_SUPPORT = " \
packagegroup-core-boot \
packagegroup-core-x11 \
packagegroup-lxde-base \
localedef \
pointercal \
xinit \
xkeyboard-config \
base-passwd \
liberation-fonts \
"
image_BASIC_TOOLS = " \
apt \
dpkg \
sudo \
tzdata \
dbus \
packagegroup-core-ssh-openssh \
xterm \
networkmanager \
wpa-supplicant \
"
image_DEV_TOOLS = " \
git \
cmake \
gcc \
g++ \
binutils \
binutils-symlinks \
coreutils \
cpp \
cpp-symlinks \
diffutils \
file \
g++ \
g++-symlinks \
gdb \
gdbserver \
gcc \
gcc-symlinks \
gettext \
git \
ldd \
libgcc \
libgcc-dev \
libstdc++ \
libstdc++-dev \
libstdc++-staticdev \
libtool \
make \
perl-modules \
pkgconfig \
python-modules \
python3-modules \
autoconf \
automake \
ccache \
packagegroup-core-buildessential \
glibc-utils \
"
image_DEV_LIBS = " \
wiringpi \
"
image_QT_TOOLS = " \
qtbase \
qtwebengine \
qtwebkit \
"
IMAGE_INSTALL_append = " \
${image_KERNEL_MODULES} \
${image_DRIVERS} \
${image_DESKTOP_SUPPORT} \
${image_BASIC_TOOLS} \
${image_DEV_TOOLS} \
${image_DEV_LIBS} \
${image_QT_TOOLS} \
"
#Maybe consider connman instead of networkmanager
#vc-graphics is problematic with userland..
## SDK stuff, to build sdk use bitbake my-image -c populate_sdk
# Add all static packages: SDKIMAGE_FEATURES += "staticdev-pkgs"
#SDKIMAGE_FEATURES += "staticdev-pkgs"
#SDKIMAGE_FEATURES += "dev-pkgs"
# Dnf issue fix for nativesdk-qt add to local.conf
#PACKAGE_CLASSES = "package_ipk"
# In the target side, add our libs
TOOLCHAIN_TARGET_TASK_append = " wiringpi-dev"
# Needed for cross-compilation / host tasks
TOOLCHAIN_HOST_TASK_append = " nativesdk-packagegroup-qt5-toolchain-host"
#CMake conflicts with the qt packagegroup, cmake is a must, when qt packagegroup is nonexistent
TOOLCHAIN_HOST_TASK_append = " nativesdk-cmake"
REQUIRED_DISTRO_FEATURES = "x11"
IMAGE_LINGUAS ?= " "
LICENSE = "MIT"
export IMAGE_BASENAME = "my-image"
ENABLE_SPI_BUS = "1"
ENABLE_I2C = "1"
do_image_prepend() {
}
提出了一些问题:
(问题2)我看到有些人不使用TOOLCHAIN_HOST_TASK
或TOOLCHAIN_TARGET_TASK
,有些人如何能够将软件包添加到SDK中。我想知道我是否做错了什么。
(问题3)我已根据其他条目继承了一些类,但我不确定继承populate_sdk
和populate_sdk_qt5
的确切内容对我有什么帮助。如果有人能够粗略地解释我做错了什么,以及如何在工作流程方面做得更好,那么这对知识来说可能是一个很好的补充。
提前感谢您的建议。
答案 0 :(得分:0)
尝试回答(问题1):
我对poky-2.5的发现是将x86_64目标OEToolchainConfig.cmake放在dev程序包中(即nativesdk-cmake-dev-3.10.3-r0.x86_64_nativesdk.rpm)
因此,请尝试:
TOOLCHAIN_HOST_TASK_append = " nativesdk-cmake-dev"
不确定这是否是错误。