IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 开发工具 -> NXP官方yocto学习 -> 正文阅读

[开发工具]NXP官方yocto学习

? ? ? ? 使用yocto平台搭建IMX8QXP开发环境,学习yocto编译开发环境。

环境准备

? ? ? ? Ubuntu 16.04?工具软件

sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat libsdl1.2-dev
sudo apt-get install libsdl1.2-dev xterm sed cvs subversion coreutils texi2html docbook-utils python-pysqlite2 help2man make gcc g++ desktop-file-utils libgl1-mesa-dev libglu1-mesa-dev mercurial autoconf automake groff curl lzop asciidoc
sudo apt-get install uboot-mkimage
sudo apt-get install u-boot-tools
sudo apt-get install libncurses5-dev
mkdir ~/bin (this step may not be needed if the bin folder already exists)
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo

????????git配置

git config --global user.name "Your Name"
git config --global user.email "Your Email"
git config --list

? ? ? ? 下载NXP yocto源码

mkdir imx-yocto-bsp
cd imx-yocto-bsp
repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-sumo -m imx-4.14.78-1.0.0_ga.xml
repo sync

? ? ? ? 代码目录树

.
├── fsl-setup-release.sh -> sources/meta-fsl-bsp-release/imx/tools/fsl-setup-release.sh
├── README -> sources/base/README
├── README-IMXBSP -> sources/meta-fsl-bsp-release/imx/README
├── setup-environment -> sources/base/setup-environment
└── sources
    ├── base
    ├── meta-browser
    ├── meta-freescale
    ├── meta-freescale-3rdparty
    ├── meta-freescale-distro
    ├── meta-fsl-bsp-release
    ├── meta-openembedded
    ├── meta-qt5
    └── poky

编译流程

? ? ? ? 查看yocto版本,也是看poky版本

sources/poky/meta-poky/conf/distro/poky.conf
	DISTRO = "poky"
	DISTRO_NAME = "Poky (Yocto Project Reference Distro)"
	DISTRO_VERSION = "2.5.1"
	DISTRO_CODENAME = "sumo"

?

DISTRO=fsl-imx-wayland MACHINE=imx8qxpmek source fsl-setup-release.sh -b build_imx8qxp

? ? ? ? 环境设置脚本

fsl-setup-release.sh
	. sources/meta-fsl-bsp-release/imx/tools/setup-utils.sh
		提供4个函数
		file_override
		machine_overrides
		bbclass_overrides
		hook_in_layer
			shift
			
	PROGNAME="setup-environment"【sources/base/setup-environment】
	OLD_OPTIND=$OPTIND【getopts命令自动产生两个变量OPTIND和OPTARG】【OPTIND下一个待处理的参数的索引】【OPTARG是当getopts获取到其期望的参数后存入的位置】
	getopts "k:r:t:b:e:gh"
	$OPTARG【只接收-b -h,其他报错返回】
	
	FSLDISTRO="$DISTRO"	【默认是fsl-imx-xwayland】
	BUILD_DIR='build'   【默认是build】
	MACHINE='imx6qpsabresd'【默认是imx6qpsabresd】

	cp sources/meta-fsl-bsp-release/imx/EULA.txt sources/meta-freescale/EULA
	
	MACHINE=$MACHINE . ./$PROGNAME $BUILD_DIR
	MACHINE=imx8qxpmek . ./setup-environment build_imx8qxp
	setup-environment
		PROGNAME="setup-environment"
		- To create a new Yocto build directory:
		  $ MACHINE=imx6qdlsabresd DISTRO=fslc-framebuffer source $PROGNAME build

		- To use an existing Yocto build directory:
		  $ source $PROGNAME build	
		
		-h|--help
		
		OEROOT=$PWD/sources/poky【默认使用poky】
		if [ -e $PWD/sources/oe-core ]; then
			OEROOT=$PWD/sources/oe-core【否则使用oe-core】
		fi

		. $OEROOT/oe-init-build-env $CWD/$1 > /dev/null
		. sources/poky/oe-init-build-env ./build_imx8qxp

		oe-init-build-env
			export OEROOT
			. $OEROOT/scripts/oe-buildenv-internal &&
				TEMPLATECONF="$TEMPLATECONF" $OEROOT/scripts/oe-setup-builddir || {
				unset OEROOT
				return 1
			}

			oe-buildenv-internal
				# Make sure our paths are at the beginning of $PATH【设置bitbake环境变量】
				for newpath in "$BITBAKEDIR/bin" "$OEROOT/scripts"; do
					# Remove any existences of $newpath from $PATH
					PATH=$(echo $PATH | sed -re "s#(^|:)$newpath(:|$)#\2#g;s#^:##")

					# Add $newpath to $PATH
					PATH="$newpath:$PATH"
				done		
			oe-setup-builddir
				mkdir -p "$BUILDDIR/conf"
	
	echo "" >> $BUILD_DIR/conf/bblayers.conf
	echo "# i.MX Yocto Project Release layers" >> $BUILD_DIR/conf/bblayers.conf
	hook_in_layer meta-fsl-bsp-release/imx/meta-bsp
	hook_in_layer meta-fsl-bsp-release/imx/meta-sdk

	echo "" >> $BUILD_DIR/conf/bblayers.conf
	echo "BBLAYERS += \" \${BSPDIR}/sources/meta-browser \"" >> $BUILD_DIR/conf/bblayers.conf
	echo "BBLAYERS += \" \${BSPDIR}/sources/meta-openembedded/meta-gnome \"" >> $BUILD_DIR/conf/bblayers.conf
	echo "BBLAYERS += \" \${BSPDIR}/sources/meta-openembedded/meta-networking \"" >> $BUILD_DIR/conf/bblayers.conf
	echo "BBLAYERS += \" \${BSPDIR}/sources/meta-openembedded/meta-python \"" >> $BUILD_DIR/conf/bblayers.conf
	echo "BBLAYERS += \" \${BSPDIR}/sources/meta-openembedded/meta-filesystems \"" >> $BUILD_DIR/conf/bblayers.conf

	echo "BBLAYERS += \" \${BSPDIR}/sources/meta-qt5 \"" >> $BUILD_DIR/conf/bblayers.conf

????????DISTRO参数

Here are the list of DISTRO configurations. Note that DirectFB is no longer supported, and fsl-imx-wayland and fsl-imx-fb
are not supported on i.MX 8.
? fsl-imx-x11 - X11 graphics are not supported on i.MX 8.
? fsl-imx-wayland - Wayland weston graphics.
? fsl-imx-xwayland - Wayland graphics and X11. X11 applications using EGL are not supported.
? fsl-imx-fb - Frame Buffer graphics - no X11 or Wayland. Frame Buffer is not supported on i.MX 8.
DISTRO:
	meta-fsl-bsp-release/imx/meta-sdk/conf/distro/
		fsl-imx-fb.conf
		fsl-imx-x11.conf
		fsl-imx-xwayland.conf【default】
		imx-wayland-ivi.conf
		fsl-imx-wayland.conf:
			# i.MX DISTRO for Wayland without X11

			include conf/distro/include/fsl-imx-base.inc
			include conf/distro/include/fsl-imx-preferred-env.inc

			DISTRO = "fsl-imx-wayland"

			# Remove conflicting backends
			DISTRO_FEATURES_remove = "directfb x11 "
			DISTRO_FEATURES_append = " wayland pam systemd"
	
		meta-fsl-bsp-release/imx/meta-sdk/conf/distro/include
			fsl-imx-base.inc  
				DISTRO = "fsl-imx"
				DISTRO_NAME = "NXP i.MX Release Distro"
				DISTRO_VERSION = "4.14-sumo"

				DISTRO_CODENAME = "sumo"
				SDK_VENDOR = "-pokysdk"
				SDK_VERSION := "${DISTRO_VERSION}"
				#SDK_VERSION := "${@'${DISTRO_VERSION}'.replace('snapshot-${DATE}','snapshot')}"
				
				IMX_DEFAULT_DISTRO_FEATURES = "largefile opengl ptest multiarch bluez"
				# Enable vulkan distro feature only for mx8
				IMX_DEFAULT_DISTRO_FEATURES_append_mx8 = " vulkan"
				IMX_DEFAULT_EXTRA_RDEPENDS = "packagegroup-core-boot"
				IMX_DEFAULT_EXTRA_RRECOMMENDS = "kernel-module-af-packet"
				IMAGE_FSTYPES = "tar.bz2 ext4 sdcard.bz2"			
				
			fsl-imx-preferred-env.inc
				# Use i.MX Kernel, U-Boot and Gstreamer 1.0 providers
				PREFERRED_PROVIDER_virtual/bootloader_imx = "u-boot-imx"	
				PREFERRED_PROVIDER_virtual/kernel_imx = "linux-imx"
				PREFERRED_VERSION_linux-libc-headers_imx = "4.14"

				DEFAULTTUNE_mx8 = "aarch64"

				# Use systemd as default init manager
				VIRTUAL-RUNTIME_init_manager = "systemd"
				PREFERRED_PROVIDER_udev = "systemd"
				PREFERRED_PROVIDER_udev-utils = "systemd"
				DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
				IMX_DEFAULT_DISTRO_FEATURES += " systemd"

				UBOOT_MAKE_TARGET_mx6ul = "u-boot.imx"

????????MACHINE参数

MACHINE:
	meta-fsl-bsp-release/imx/meta-bsp/conf/machine/
		imx6dlsabreauto.conf
		imx7dsabresd.conf
		imx8qxpmek.conf	:
			MACHINEOVERRIDES =. "mx8:mx8qxp:"

			require conf/machine/include/imx-base.inc
			require conf/machine/include/arm/arch-arm64.inc

			SERIAL_CONSOLE = "115200 ttyAMA0"

			KERNEL_DEVICETREE = "freescale/fsl-imx8qxp-mek.dtb freescale/fsl-imx8qxp-mek-dom0.dtb"
			UBOOT_MAKE_TARGET = "u-boot.bin"
			UBOOT_SUFFIX = "bin"
			UBOOT_CONFIG ??= "sd"
			UBOOT_CONFIG[sd] = "imx8qxp_mek_config,sdcard"
			UBOOT_CONFIG[fspi] = "imx8qxp_mek_fspi_defconfig"

			BOOT_SPACE = "65536"
			IMAGE_BOOTLOADER = "imx-boot"
			IMX_BOOT_SEEK = "32"

			IMXBOOT_TARGETS = "${@bb.utils.contains('UBOOT_CONFIG', 'fspi', 'flash_flexspi', \
																			'flash_all flash', d)}"
			BOARD_TYPE = "mek"

		genvict_imx8qxp.conf:
			KERNEL_DEVICETREE = "freescale/fsl-imx8qxp-mek.dtb"
			UBOOT_CONFIG ??= "emmc"
			UBOOT_CONFIG[emmc] = "imx8qxp_mek_config,sdcard"

? ? ? ? 编译环境配置后

build_imx8qxp/conf/bblayers.conf【带conf/layer.conf层配置的目录文件】
	LCONF_VERSION = "6"

	BBPATH = "${TOPDIR}"
	BSPDIR := "${@os.path.abspath(os.path.dirname(d.getVar('FILE', True)) + '/../..')}"

	BBFILES ?= ""
	BBLAYERS = " \
	  ${BSPDIR}/sources/poky/meta \
	  ${BSPDIR}/sources/poky/meta-poky \
	  \
	  ${BSPDIR}/sources/meta-openembedded/meta-oe \
	  ${BSPDIR}/sources/meta-openembedded/meta-multimedia \
	  \
	  ${BSPDIR}/sources/meta-freescale \
	  ${BSPDIR}/sources/meta-freescale-3rdparty \
	  ${BSPDIR}/sources/meta-freescale-distro \
	"

	# i.MX Yocto Project Release layers
	BBLAYERS += " ${BSPDIR}/sources/meta-fsl-bsp-release/imx/meta-bsp "
	BBLAYERS += " ${BSPDIR}/sources/meta-fsl-bsp-release/imx/meta-sdk "

	BBLAYERS += " ${BSPDIR}/sources/meta-browser "
	BBLAYERS += " ${BSPDIR}/sources/meta-openembedded/meta-gnome "
	BBLAYERS += " ${BSPDIR}/sources/meta-openembedded/meta-networking "
	BBLAYERS += " ${BSPDIR}/sources/meta-openembedded/meta-python "
	BBLAYERS += " ${BSPDIR}/sources/meta-openembedded/meta-filesystems "
	BBLAYERS += " ${BSPDIR}/sources/meta-qt5 "
build_imx8qxp/conf/local.conf
	MACHINE ??= 'imx8qxpmek'
	DISTRO ?= 'fsl-imx-wayland'
	PACKAGE_CLASSES ?= "package_rpm"
	EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
	USER_CLASSES ?= "buildstats image-mklibs image-prelink"
	PATCHRESOLVE = "noop"
	BB_DISKMON_DIRS ??= "\
		STOPTASKS,${TMPDIR},1G,100K \
		STOPTASKS,${DL_DIR},1G,100K \
		STOPTASKS,${SSTATE_DIR},1G,100K \
		STOPTASKS,/tmp,100M,100K \
		ABORT,${TMPDIR},100M,1K \
		ABORT,${DL_DIR},100M,1K \
		ABORT,${SSTATE_DIR},100M,1K \
		ABORT,/tmp,10M,1K"
	PACKAGECONFIG_append_pn-qemu-native = " sdl"
	PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
	CONF_VERSION = "1"

	DL_DIR ?= "${BSPDIR}/downloads/"
	ACCEPT_FSL_EULA = "1"

编译完成后

? ? ? ??bitbake fsl-image-validation-imx

Welcome to Freescale Community BSP

The Yocto Project has extensive documentation about OE including a
reference manual which can be found at:
    http://yoctoproject.org/documentation

For more information about OpenEmbedded see their website:
    http://www.openembedded.org/

You can now run 'bitbake <target>'

Common targets are:
    core-image-minimal
    meta-toolchain
    meta-toolchain-sdk
    adt-installer
    meta-ide-support

Your build environment has been configured with:

    MACHINE=imx8qxpmek
    SDKMACHINE=i686
    DISTRO=fsl-imx-wayland
    EULA=
BSPDIR=
BUILD_DIR=.
meta-freescale directory found

  开发工具 最新文章
Postman接口测试之Mock快速入门
ASCII码空格替换查表_最全ASCII码对照表0-2
如何使用 ssh 建立 socks 代理
Typora配合PicGo阿里云图床配置
SoapUI、Jmeter、Postman三种接口测试工具的
github用相对路径显示图片_GitHub 中 readm
Windows编译g2o及其g2o viewer
解决jupyter notebook无法连接/ jupyter连接
Git恢复到之前版本
VScode常用快捷键
上一篇文章      下一篇文章      查看所有文章
加:2021-11-24 08:09:39  更:2021-11-24 08:11:34 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年12日历 -2024/12/24 3:15:28-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码
数据统计