Yocto實踐(1): 基於Dunfell 構建Yocto專案
因為工作中很多時候需要基於Yocto來改程式碼、編譯SDK,很久之前就想徹底搞明白Yocto的理念、整個構建的細節。
現在開坑,基於Yocto官方文件,以實踐記錄+網路資料整理的方式,希望加深對Yocto的理解。
操作基於2020年4月份發行的3.1版本(Dunfell)。 Yocto的版本release記錄:https://wiki.yoctoproject.org/wiki/Releases
系統要求:參考Yocto官方的參考文件https://www.yoctoproject.org/docs/current/brief-yoctoprojectqs/brief-yoctoprojectqs.html PC最好是Linux發行版,要求如下:
硬碟:至少50GB
發行版:最近的Fedora, openSUSE, CentOS, Debian, or Ubuntu
常用工具:
-
Git 1.8.3.1 or greater
-
tar 1.28 or greater
-
Python 3.5.0 or greater.
-
gcc 5.0 or greater.
需要安裝如下軟體包(我用的是Ubuntu 18.04, 以Ubuntu18.04為例。其他發行版請參考上面的連結):
$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \
xz-utils debianutils iputils-ping libsdl1.2-dev xterm
獲取Poky:
$ git clone git://git.yoctoproject.org/poky
Cloning into 'poky'...
remote: Counting objects: 432160, done.
remote: Compressing objects: 100% (102056/102056), done.
remote: Total 432160 (delta 323116), reused 432037 (delta 323000)
Receiving objects: 100% (432160/432160), 153.81 MiB | 8.54 MiB/s, done.
Resolving deltas: 100% (323116/323116), done.
Checking connectivity... done.
下載完成後會得到一個Poky資料夾。從這個資料夾裡可以看到Git commit history。你可以在預設的分支上構建你的系統,也可以新建一個分支。如下:
$ git checkout tags/yocto-3.1 -b csdn1013-yocto-3.1
Switched to a new branch 'csdn1013-yocto-3.1'
~/poky$ git branch
* csdn1013-yocto-3.1
dunfell
開始構建
1. 首先需要初始化編譯環境source oe-init-build-env
~/poky$ source oe-init-build-env
You had no conf/local.conf file. This configuration file has therefore been
created for you with some default values. You may wish to edit it to, for
example, select a different MACHINE (target hardware). See conf/local.conf
for more information as common configuration options are commented.
You had no conf/bblayers.conf file. This configuration file has therefore been
created for you with some default values. To add additional metadata layers
into your configuration please add entries to conf/bblayers.conf.
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/
### Shell environment set up for builds. ###
You can now run 'bitbake <target>'
Common targets are:
core-image-minimal
core-image-sato
meta-toolchain
meta-ide-support
You can also run generated qemu images with a command like 'runqemu qemux86'
Other commonly useful commands are:
- 'devtool' and 'recipetool' handle common recipe tasks
- 'bitbake-layers' handles common layer tasks
- 'oe-pkgdata-util' handles common target package tasks
如上面提示,現在通過bitbake編譯工具可以編譯一些目標image了:
core-image-minimal
core-image-sato
meta-toolchain
meta-ide-support
$bitbake core-image-sato
相關文章
- 修改yocto系統啟動logoGo
- yocto的一些命令記錄:
- Yocto專案介紹及入門 -- 嵌入師工程師必備利器工程師
- yocto-第20篇-Toaster使用技巧(3)-待續AST
- 基於Ceph物件儲存構建實踐物件
- 專案管理基礎與實踐(1)專案管理
- 基於Grunt構建一個的專案
- 用mobx構建大型專案的最佳實踐
- Webpack 4 構建大型專案實踐 / 微前端Web前端
- Webpack 4 構建大型專案實踐 / 優化Web優化
- 【快速學習】docker構建java專案實踐DockerJava
- 基於Vue的多專案整合實踐Vue
- 基於 react, redux 最佳實踐構建的 2048ReactRedux
- 用mobx構建大型專案的最佳實踐(2)
- 微服務專案實踐之中建專案微服務
- 基於 OPLG 從 0 到 1 構建統一可觀測平臺實踐
- eclipse中基於maven構建多模組專案EclipseMaven
- 使用cordova構建基於vue的Android專案VueAndroid
- Vue專案Webpack優化實踐,構建效率提高50%VueWeb優化
- 基於Jetpack元件構建的開源專案-WanLearningJetpack元件
- Uber基於Apache Hudi構建PB級資料湖實踐Apache
- 多利熊基於分散式架構實踐穩定性建設分散式架構
- 快手基於 Flink 構建實時數倉場景化實踐
- ABAP system landscape和vue專案webpack構建的最佳實踐VueWeb
- 基於 Nebula Graph 構建百億關係知識圖譜實踐
- 基於lerna+yarn workspaces的monorepo專案實踐YarnMono
- Git 工作流-基於 x 想 cube 專案實踐Git
- 基於Kafka和Elasticsearch構建實時站內搜尋功能的實踐KafkaElasticsearch
- vue專案構建與實戰Vue
- 構建第一個基於 Gradle 的 Spring Boot 專案GradleSpring Boot
- Idea下構建基於Gradle的Spring Boot專案IdeaGradleSpring Boot
- VUE 完整專案構建 (1) -- 初始化Vue
- 設計專案全生命週期管理系統構建與實踐
- Redux進階系列1:React+Redux專案結構最佳實踐ReduxReact
- 重構 Rails 專案之最佳實踐AI
- 專案管理基礎與實踐(4)專案管理
- 專案管理基礎與實踐(5)專案管理
- 專案管理基礎與實踐(3)專案管理