一、开发环境要求

  • 50GB空闲磁盘空间(最好还剩余100GB以上)

  • Git 1.8.3.1以上版本

  • tar 1.28以上版本

  • Python 3.5.0以上版本

  • gcc 5.0以上版本


二、安装依赖

$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
build-essential chrpath socat cpio python3 python3-pip python3-pexpect \
xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev \
pylint3 xterm

三、下载Poky并切换版本分支

$ git clone git://git.yoctoproject.org/poky
$ cd poky
$ git fetch --tags
$ git tag
$ git checkout tags/yocto-3.1 -b my-yocto-3.1

四、构建镜像

(1)进入Poky目录

$ cd poky

(2)初始化编译环境

$ ./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/documentationFor 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-minimalcore-image-satometa-toolchainmeta-ide-supportYou 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

(3)添加bitbake环境变量

当前位于poky目录下:

$ cd bitbake/bin
$ pwd
/home/neutionwei/poky/bitbake/bin
$ export PATH=$PATH:/home/neutionwei/poky/bitbake/bin
$ cd -

(4)编译minimal镜像

当前位于poky目录下:

$ cd build
$ bitbake core-image-minimal
Parsing recipes: 100% |######################################################################################################################################################################| Time: 0:00:21
Parsing of 768 .bb files complete (0 cached, 768 parsed). 1300 targets, 40 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependenciesBuild Configuration:
BB_VERSION           = "1.46.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "ubuntu-18.04"
TARGET_SYS           = "x86_64-poky-linux"
MACHINE              = "qemux86-64"
DISTRO               = "poky"
DISTRO_VERSION       = "3.1"
TUNE_FEATURES        = "m64 core2"
TARGET_FPU           = ""
meta
meta-poky
meta-yocto-bsp       = "my-yocto-3.1:5d47cdf448b6cff5bb7cc5b0ba0426b8235ec478"NOTE: Fetching uninative binary shim from http://downloads.yoctoproject.org/releases/uninative/2.8/x86_64-nativesdk-libc.tar.xz;sha256sum=a09922172c3a439105e0ae6b943daad2d83505b17da0aba97961ff433b8c21ab
Initialising tasks: 100% |###################################################################################################################################################################| Time: 0:00:01
Sstate summary: Wanted 1159 Found 0 Missed 1159 Current 0 (0% match, 0% complete)
NOTE: Executing Tasks

(5)镜像输出目录

当前位于build目录下:

$ cd tmp/deploy/images/qemux86-64/
$ ls -al
total 28144
drwxr-xr-x 2 neutionwei neutionwei     4096 11月  1 04:20 .
drwxr-xr-x 3 neutionwei neutionwei     4096 11月  1 04:19 ..
lrwxrwxrwx 2 neutionwei neutionwei       75 11月  1 04:19 bzImage -> bzImage--5.4.27+git0+bee554e595_03142acba0-r0-qemux86-64-20201031100022.bin
-rw-r--r-- 2 neutionwei neutionwei  8626848 11月  1 04:19 bzImage--5.4.27+git0+bee554e595_03142acba0-r0-qemux86-64-20201031100022.bin
lrwxrwxrwx 2 neutionwei neutionwei       75 11月  1 04:19 bzImage-qemux86-64.bin -> bzImage--5.4.27+git0+bee554e595_03142acba0-r0-qemux86-64-20201031100022.bin
-rw-r--r-- 2 neutionwei neutionwei     1338 11月  1 04:20 core-image-minimal-qemux86-64-20201031100022.qemuboot.conf
-rw-r--r-- 2 neutionwei neutionwei 12273664 11月  1 04:20 core-image-minimal-qemux86-64-20201031100022.rootfs.ext4
-rw-r--r-- 2 neutionwei neutionwei      884 11月  1 04:20 core-image-minimal-qemux86-64-20201031100022.rootfs.manifest
-rw-r--r-- 2 neutionwei neutionwei  3279857 11月  1 04:20 core-image-minimal-qemux86-64-20201031100022.rootfs.tar.bz2
-rw-r--r-- 2 neutionwei neutionwei   181054 11月  1 04:20 core-image-minimal-qemux86-64-20201031100022.testdata.json
lrwxrwxrwx 2 neutionwei neutionwei       56 11月  1 04:20 core-image-minimal-qemux86-64.ext4 -> core-image-minimal-qemux86-64-20201031100022.rootfs.ext4
lrwxrwxrwx 2 neutionwei neutionwei       60 11月  1 04:20 core-image-minimal-qemux86-64.manifest -> core-image-minimal-qemux86-64-20201031100022.rootfs.manifest
lrwxrwxrwx 2 neutionwei neutionwei       58 11月  1 04:20 core-image-minimal-qemux86-64.qemuboot.conf -> core-image-minimal-qemux86-64-20201031100022.qemuboot.conf
lrwxrwxrwx 2 neutionwei neutionwei       59 11月  1 04:20 core-image-minimal-qemux86-64.tar.bz2 -> core-image-minimal-qemux86-64-20201031100022.rootfs.tar.bz2
lrwxrwxrwx 2 neutionwei neutionwei       58 11月  1 04:20 core-image-minimal-qemux86-64.testdata.json -> core-image-minimal-qemux86-64-20201031100022.testdata.json
-rw-r--r-- 2 neutionwei neutionwei  7233298 11月  1 04:19 modules--5.4.27+git0+bee554e595_03142acba0-r0-qemux86-64-20201031100022.tgz
lrwxrwxrwx 2 neutionwei neutionwei       75 11月  1 04:19 modules-qemux86-64.tgz -> modules--5.4.27+git0+bee554e595_03142acba0-r0-qemux86-64-20201031100022.tgz

五、使用QEMU模拟器启动镜像

(1)安装模拟器:

$ sudo apt-get install qemu

(2) 添加runqemu环境变量:

当前位于poky目录下:

$ cd scripts
$ pwd
/home/neutionwei/poky/scripts
$ export PATH=$PATH:/home/neutionwei/poky/scripts
$ cd -

(3)启动镜像

当前位于poky目录下:

$ cd build
$ runqemu qemux86-64
runqemu - INFO - Running MACHINE=qemux86-64 bitbake -e ...
runqemu - INFO - Continuing with the following parameters:
KERNEL: [/home/neutionwei/proj/yocto/poky/build/tmp/deploy/images/qemux86-64/bzImage--5.4.27+git0+bee554e595_03142acba0-r0-qemux86-64-20201031100022.bin]
MACHINE: [qemux86-64]
FSTYPE: [ext4]
ROOTFS: [/home/neutionwei/proj/yocto/poky/build/tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64-20201031100022.rootfs.ext4]
CONFFILE: [/home/neutionwei/proj/yocto/poky/build/tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64-20201031100022.qemuboot.conf]runqemu - INFO - Setting up tap interface under sudo
runqemu - INFO - Network configuration: ip=192.168.7.2::192.168.7.1:255.255.255.0
runqemu - INFO - Running /home/neutionwei/proj/yocto/poky/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-x86_64 -device virtio-net-pci,netdev=net0,mac=52:54:00:12:34:02 -netdev tap,id=net0,ifname=tap0,script=no,downscript=no -drive file=/home/neutionwei/proj/yocto/poky/build/tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64-20201031100022.rootfs.ext4,if=virtio,format=raw -show-cursor -usb -device usb-tablet -object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0   -cpu core2duo -m 256 -serial mon:vc -serial null -kernel /home/neutionwei/proj/yocto/poky/build/tmp/deploy/images/qemux86-64/bzImage--5.4.27+git0+bee554e595_03142acba0-r0-qemux86-64-20201031100022.bin -append 'root=/dev/vda rw  mem=256M ip=192.168.7.2::192.168.7.1:255.255.255.0 oprofile.timer=1 '

与此同时会弹出名为qemu-system-x86_64的终端窗口,进入文件系统后直接输入root登陆即可!

Yocto开发篇 | Ubuntu构建与体验Poky发行版(Yocto 3.1版本)相关推荐

  1. 使用 Yocto Project 构建自定义嵌入式 Linux 发行版

    使用 Yocto Project 构建自定义嵌入式 Linux 发行版 转自: http://zzjlzx.blog.chinaunix.net/uid-9688646-id-5175371.html ...

  2. 嵌入式linux+程序构架,从头开始构建一个嵌入式 Linux 发行版

    开始之前 目标 本教程展示如何在一个目标系统上安装 Linux.这不是一个预先构建的 Linux 发行版,而是您从头构建发行版.虽然在不同目标系统上安装 Linux 的过程在细节上有差异,但总的原则是 ...

  3. 查看依赖树_如何在基于 Ubuntu 或 Debian 的 Linux 发行版中查看一个软件包的依赖...

    但如果你想在安装一个软件包之前或之后知晓这个软件包的依赖,那该怎么办呢? 来源:https://linux.cn/article-12987-1.html 作者:Abhishek Prakash 译者 ...

  4. debian php-fpn_如何在基于 Ubuntu 或 Debian 的 Linux 发行版中查看一个软件包的依赖...

    在 Ubuntu 或 Debian 中通过命令行来安装应用是一件很简单的事,你只需要执行 apt install package_name 就可以了. 但如果你想在安装一个软件包之前或之后知晓这个软件 ...

  5. Yocto理论篇 | OpenEmbedded构建系统之Package Feeds

    1 工作流 下图表示OpenEmbedded构建系统生成的高级工作流: 通常,构建的工作流由几个功能区域组成: User Configuration:可用于控制生成过程的元数据. Metadata L ...

  6. 从零构建一个riscv64 ubuntu-20发行版系统

    文章目录 1.搭建开发环境 1.1 开发涉及的环境/工具: 1.2 安装qemu虚拟化工具 1.2.1 apt安装 1.2.2 手动交叉编译安装 2. 获取riscv架构ubuntu根文件系统 3.V ...

  7. 红旗Linux的特点和应用范围,以红旗Linux和Ubuntu为例评点Linux发行版的优点

    以红旗Linux和Ubuntu为例,从六个方面简单评点下Linux发行版的优点. 第一 安装是否方便 包括系统安装和软件安装现在Linux基本上系统安装都能在图形界面下进行了. 软件安装要看软件包的管 ...

  8. 利用Yocto构建嵌入式Linux教程01--第一个Yocto项目构建

    大家好,从今日开始,计划写一个利用Yocto构建嵌入式Linux的教程,算是对个人工作和学习的一个总结. 本教程选用的Yocto版本为3.0.4,我使用的Linux发行版为Ubuntu 18.04 ( ...

  9. Linux发行版:CentOS、Ubuntu、RedHat、Android、Tizen、MeeGo

    Linux,最早由Linus Benedict Torvalds在1991年开始编写.在这之前,Richard Stallman创建了Free Software Foundation(FSF)组织以及 ...

最新文章

  1. 线程基类的构建与代码实践
  2. ACCP学习旅程之-----使用C#开发数据库应用程序(第二章)
  3. LoaderManager使用详解(三)---实现Loaders
  4. 电子书下载:Pro Drupal 7 for Windows Developers
  5. CentOS6.4安装Samba(匿名)共享服务器
  6. 什么是软件开发中的 green field 和 brown field 模式 - 绿地开发和棕地开发
  7. 鸿蒙系统董事长,鸿蒙2.0已开源 华为轮值董事长:今年至少3亿设备搭载鸿蒙系统...
  8. Python程序员30行代码素描表白!网友:花里胡哨
  9. 基于AWS的电子商务网站架构——营销与推荐服务
  10. 多功能时钟电路的设计框图_OLED显示屏,行驱动电路设计,单片机AT89C51与和显示屏的硬件接线...
  11. Win10加装SSD固态硬盘后卡顿现象的解决方法
  12. 【工作感悟】linuxdocker运行windows镜像
  13. UDP数据丢包跟踪与总结
  14. gpio上拉下拉区别
  15. smb+服务器+修复,Microsoft Windows
  16. 国标28181:什么是SDP协议
  17. AD19——实验室焊接QFP、PQFP、LQFP、TQFP封装芯片方法(更新)
  18. Cozmo人工智能机器人SDK使用笔记(1)-基础部分basics
  19. 流量就是这么省出来的
  20. 导致DllMain中死锁的关键隐藏因子

热门文章

  1. 3---条形图(matplotlib)
  2. 迄今微软不同时期发布的SQL Server各版本之间的大致区别,供参考查阅
  3. SAP-基于批次特定计量单位的应用-01-产品数量管理
  4. 英语中描写”人”的词语集萃
  5. 厚基础Linux——第二周作业
  6. 战争与征服服务器维护,战争与征服 8月29日停机维护公告_战争与征服 8月29日更新了什么_玩游戏网...
  7. 如何给Linux服务器安装瑞星,手把手教你制作瑞星Linux杀毒光盘
  8. DeviceMonitoringStudio设备监控工具的使用
  9. 当人工智能(AI)撞上供应链
  10. 说一说will-change