杨振 3 years ago
commit
3ae4b42d24
100 changed files with 2432 additions and 0 deletions
  1. 4 0
      .gitignore
  2. 228 0
      html_index/content/000-index/index.htm
  3. BIN
      html_index/content/000-index/index_files/20210313145956347.gif
  4. BIN
      html_index/content/000-index/index_files/20210513113435813.png
  5. BIN
      html_index/content/000-index/index_files/articleReadEyes.png
  6. 0 0
      html_index/content/000-index/index_files/ck_htmledit_views-1a85854398.css
  7. 0 0
      html_index/content/000-index/index_files/markdown_views-d7a94ec6ab.css
  8. BIN
      html_index/content/000-index/index_files/original.png
  9. 0 0
      html_index/content/000-index/index_files/style-49037e4d27.css
  10. BIN
      html_index/content/000-index/index_files/tobarCollect.png
  11. BIN
      html_index/content/000-index/index_files/tobarCollectionActive.png
  12. 220 0
      html_index/content/001/108910914.htm
  13. BIN
      html_index/content/001/108910914_files/20201003161509206.png
  14. BIN
      html_index/content/001/108910914_files/20201003162954674.png
  15. BIN
      html_index/content/001/108910914_files/20201003174958601.png
  16. BIN
      html_index/content/001/108910914_files/20201217135939350.png
  17. BIN
      html_index/content/001/108910914_files/20210513113435813.png
  18. BIN
      html_index/content/001/108910914_files/articleReadEyes.png
  19. 177 0
      html_index/content/001/108910914_files/blog_code-01256533b5.min.css
  20. 1 0
      html_index/content/001/108910914_files/chart-3456820cac.css
  21. 0 0
      html_index/content/001/108910914_files/ck_htmledit_views-1a85854398.css
  22. 0 0
      html_index/content/001/108910914_files/csdn-toolbar.js.下载
  23. 0 0
      html_index/content/001/108910914_files/markdown_views-d7a94ec6ab.css
  24. BIN
      html_index/content/001/108910914_files/original.png
  25. 0 0
      html_index/content/001/108910914_files/style-49037e4d27.css
  26. BIN
      html_index/content/001/108910914_files/tobarCollect.png
  27. BIN
      html_index/content/001/108910914_files/tobarCollectionActive.png
  28. 249 0
      html_index/content/002/109002508.htm
  29. BIN
      html_index/content/002/109002508_files/20201010191144836.png
  30. BIN
      html_index/content/002/109002508_files/20201010192025426.png
  31. BIN
      html_index/content/002/109002508_files/20201010193322659.png
  32. BIN
      html_index/content/002/109002508_files/20201010194247966.png
  33. BIN
      html_index/content/002/109002508_files/20201010194632668.png
  34. BIN
      html_index/content/002/109002508_files/20201214190748383.png
  35. BIN
      html_index/content/002/109002508_files/20201214191155451.png
  36. BIN
      html_index/content/002/109002508_files/20210525190509962.png
  37. BIN
      html_index/content/002/109002508_files/20210525190925421.png
  38. BIN
      html_index/content/002/109002508_files/20210525191101373.png
  39. BIN
      html_index/content/002/109002508_files/20210525191427684.png
  40. BIN
      html_index/content/002/109002508_files/20210525191605585.png
  41. BIN
      html_index/content/002/109002508_files/articleReadEyes.png
  42. 177 0
      html_index/content/002/109002508_files/blog_code-01256533b5.min.css
  43. 1 0
      html_index/content/002/109002508_files/chart-3456820cac.css
  44. 0 0
      html_index/content/002/109002508_files/ck_htmledit_views-1a85854398.css
  45. 0 0
      html_index/content/002/109002508_files/csdn-toolbar.js.下载
  46. BIN
      html_index/content/002/109002508_files/identityVip.png
  47. 0 0
      html_index/content/002/109002508_files/markdown_views-d7a94ec6ab.css
  48. BIN
      html_index/content/002/109002508_files/original.png
  49. 0 0
      html_index/content/002/109002508_files/style-49037e4d27.css
  50. BIN
      html_index/content/002/109002508_files/tobarCollect.png
  51. BIN
      html_index/content/002/109002508_files/tobarCollectionActive.png
  52. 0 0
      html_index/content/002/109002508_files/user-medal.js.下载
  53. 0 0
      html_index/content/002/109002508_files/user-tooltip.js.下载
  54. 103 0
      html_index/content/003/109003520.htm
  55. BIN
      html_index/content/003/109003520_files/20210525194814989.png
  56. BIN
      html_index/content/003/109003520_files/articleReadEyes.png
  57. 0 0
      html_index/content/003/109003520_files/ck_htmledit_views-1a85854398.css
  58. BIN
      html_index/content/003/109003520_files/identityVip.png
  59. 0 0
      html_index/content/003/109003520_files/markdown_views-d7a94ec6ab.css
  60. BIN
      html_index/content/003/109003520_files/original.png
  61. 0 0
      html_index/content/003/109003520_files/style-49037e4d27.css
  62. BIN
      html_index/content/003/109003520_files/tobarCollect.png
  63. BIN
      html_index/content/003/109003520_files/tobarCollectionActive.png
  64. 298 0
      html_index/content/004/109034181.htm
  65. BIN
      html_index/content/004/109034181_files/20201012191810766.png
  66. BIN
      html_index/content/004/109034181_files/articleReadEyes.png
  67. 0 0
      html_index/content/004/109034181_files/ck_htmledit_views-1a85854398.css
  68. BIN
      html_index/content/004/109034181_files/identityVip.png
  69. 0 0
      html_index/content/004/109034181_files/markdown_views-d7a94ec6ab.css
  70. BIN
      html_index/content/004/109034181_files/original.png
  71. 0 0
      html_index/content/004/109034181_files/style-49037e4d27.css
  72. BIN
      html_index/content/004/109034181_files/tobarCollect.png
  73. BIN
      html_index/content/004/109034181_files/tobarCollectionActive.png
  74. 643 0
      html_index/content/005/109129587.htm
  75. BIN
      html_index/content/005/109129587_files/20210529154705904.png
  76. BIN
      html_index/content/005/109129587_files/articleReadEyes.png
  77. 0 0
      html_index/content/005/109129587_files/ck_htmledit_views-1a85854398.css
  78. BIN
      html_index/content/005/109129587_files/identityVip.png
  79. 0 0
      html_index/content/005/109129587_files/markdown_views-d7a94ec6ab.css
  80. BIN
      html_index/content/005/109129587_files/original.png
  81. 0 0
      html_index/content/005/109129587_files/style-49037e4d27.css
  82. BIN
      html_index/content/005/109129587_files/tobarCollect.png
  83. BIN
      html_index/content/005/109129587_files/tobarCollectionActive.png
  84. 191 0
      html_index/content/006/109035813.htm
  85. BIN
      html_index/content/006/109035813_files/20201012201442422.png
  86. BIN
      html_index/content/006/109035813_files/20210610195339165.png
  87. BIN
      html_index/content/006/109035813_files/articleReadEyes.png
  88. 0 0
      html_index/content/006/109035813_files/ck_htmledit_views-1a85854398.css
  89. BIN
      html_index/content/006/109035813_files/identityVip.png
  90. 0 0
      html_index/content/006/109035813_files/markdown_views-d7a94ec6ab.css
  91. BIN
      html_index/content/006/109035813_files/original.png
  92. 0 0
      html_index/content/006/109035813_files/style-49037e4d27.css
  93. BIN
      html_index/content/006/109035813_files/tobarCollect.png
  94. BIN
      html_index/content/006/109035813_files/tobarCollectionActive.png
  95. 140 0
      html_index/content/007/109133346.htm
  96. BIN
      html_index/content/007/109133346_files/20201017153814514.png
  97. BIN
      html_index/content/007/109133346_files/articleReadEyes.png
  98. 0 0
      html_index/content/007/109133346_files/ck_htmledit_views-1a85854398.css
  99. BIN
      html_index/content/007/109133346_files/identityVip.png
  100. 0 0
      html_index/content/007/109133346_files/markdown_views-d7a94ec6ab.css

+ 4 - 0
.gitignore

@@ -0,0 +1,4 @@
+.idea
+.vscode
+
+html_index.tar.gz

+ 228 - 0
html_index/content/000-index/index.htm

@@ -0,0 +1,228 @@
+<!DOCTYPE html>
+<!-- saved from url=(0055)https://fulinux.blog.csdn.net/article/details/116208803 -->
+<html lang="zh-CN">
+  <body class="nodata " style="">
+        
+    
+    
+
+
+<div class="main_father clearfix d-flex justify-content-center" style="height:100%;"> 
+    <div class="container clearfix" id="mainBox">
+        <main>
+
+<div class="blog-content-box">
+        <div class="article-header-box">
+        <div class="article-header">
+            <div class="article-title-box">
+                <h1 class="title-article" id="articleContentId">Yocto开发讲解系列 - 总目录</h1>
+            </div>
+            <div class="article-info-box">
+                <div class="article-bar-top">
+                    <img class="article-type-img" src="./index_files/original.png" alt="">
+                    <div class="bar-content">
+                        <span class="c-gray">置顶</span>
+                    <a class="follow-nickName " href="https://fulinux.blog.csdn.net/" target="_blank" rel="noopener">fulinux</a>
+                    <span class="time">2021-04-28 20:26:14</span>
+                    <img class="article-read-img article-heard-img" src="./index_files/articleReadEyes.png" alt="">
+                    <span class="read-count">5604</span>
+                    <a id="blog_detail_zk_collection" class="un-collection" data-report-click="{&quot;mod&quot;:&quot;popu_823&quot;,&quot;spm&quot;:&quot;1001.2101.3001.4232&quot;,&quot;ab&quot;:&quot;new&quot;}">
+                        <img class="article-collect-img article-heard-img un-collect-status isdefault" style="display:inline-block" src="./index_files/tobarCollect.png" alt="">
+                        <img class="article-collect-img article-heard-img collect-status isactive" style="display:none" src="./index_files/tobarCollectionActive.png" alt="">
+                        <span class="name">收藏</span>
+                        <span class="get-collection">
+                            112
+                        </span>
+                    </a>
+                    </div>
+                </div>
+                <div class="blog-tags-box">
+                    <div class="tags-box artic-tag-box">
+                            <span class="label">分类专栏:</span>
+                                <a class="tag-link" href="https://blog.csdn.net/sonbai/category_10445379.html" target="_blank" rel="noopener">Yocto开发篇</a>
+                            <span class="label">文章标签:</span>
+                                <a data-report-click="{&quot;mod&quot;:&quot;popu_626&quot;,&quot;spm&quot;:&quot;1001.2101.3001.4223&quot;,&quot;strategy&quot;:&quot;yocto&quot;,&quot;ab&quot;:&quot;new&quot;}" class="tag-link" href="https://so.csdn.net/so/search/s.do?q=yocto&amp;t=blog&amp;o=vip&amp;s=&amp;l=&amp;f=&amp;viparticle=" target="_blank" rel="noopener">yocto</a>
+                                <a data-report-click="{&quot;mod&quot;:&quot;popu_626&quot;,&quot;spm&quot;:&quot;1001.2101.3001.4223&quot;,&quot;strategy&quot;:&quot;bitbake&quot;,&quot;ab&quot;:&quot;new&quot;}" class="tag-link" href="https://so.csdn.net/so/search/s.do?q=bitbake&amp;t=blog&amp;o=vip&amp;s=&amp;l=&amp;f=&amp;viparticle=" target="_blank" rel="noopener">bitbake</a>
+                                <a data-report-click="{&quot;mod&quot;:&quot;popu_626&quot;,&quot;spm&quot;:&quot;1001.2101.3001.4223&quot;,&quot;strategy&quot;:&quot;meta&quot;,&quot;ab&quot;:&quot;new&quot;}" class="tag-link" href="https://so.csdn.net/so/search/s.do?q=meta&amp;t=blog&amp;o=vip&amp;s=&amp;l=&amp;f=&amp;viparticle=" target="_blank" rel="noopener">meta</a>
+                                <a data-report-click="{&quot;mod&quot;:&quot;popu_626&quot;,&quot;spm&quot;:&quot;1001.2101.3001.4223&quot;,&quot;strategy&quot;:&quot;devtool&quot;,&quot;ab&quot;:&quot;new&quot;}" class="tag-link" href="https://so.csdn.net/so/search/s.do?q=devtool&amp;t=blog&amp;o=vip&amp;s=&amp;l=&amp;f=&amp;viparticle=" target="_blank" rel="noopener">devtool</a>
+                                <a data-report-click="{&quot;mod&quot;:&quot;popu_626&quot;,&quot;spm&quot;:&quot;1001.2101.3001.4223&quot;,&quot;strategy&quot;:&quot;recipe&quot;,&quot;ab&quot;:&quot;new&quot;}" class="tag-link" href="https://so.csdn.net/so/search/s.do?q=recipe&amp;t=blog&amp;o=vip&amp;s=&amp;l=&amp;f=&amp;viparticle=" target="_blank" rel="noopener">recipe</a>
+                    </div>
+                </div>
+                <div class="slide-content-box">
+                    <div class="article-copyright">
+                        <div class="creativecommons">
+                            版权声明:本文为博主原创文章,遵循<a href="http://creativecommons.org/licenses/by-sa/4.0/" target="_blank" rel="noopener"> CC 4.0 BY-SA </a>版权协议,转载请附上原文出处链接和本声明。
+                        </div>
+                        <div class="article-source-link">
+                            本文链接:<a href="https://blog.csdn.net/fulinus/article/details/116208803" target="_blank">https://blog.csdn.net/fulinus/article/details/116208803</a>
+                        </div>
+                    </div>
+                </div>
+                <div class="operating">
+                    <a class="href-article-edit slide-toggle">版权</a>
+                </div>
+            </div>
+        </div>
+    </div>
+        <div id="blogColumnPayAdvert">
+            <div class="column-group">
+                <div class="column-group-item column-group0 column-group-item-one">
+                    <div class="item-l">
+                        <a class="item-target" href="https://blog.csdn.net/sonbai/category_10445379.html" target="_blank" title="Yocto开发篇" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.6332&quot;}">
+                            <img class="item-target" src="./index_files/20210513113435813.png" alt="">
+                            <span class="title item-target">Yocto开发篇</span>
+                        </a>
+                        <span class="dec">专栏收录该内容</span>
+                    </div>
+                    <div class="item-m">
+                        <span>73 篇文章</span>
+                        <span>384 订阅</span>
+                        <span class="old-add-new-box">
+                            <span class="price">¥39.90</span>
+                            <span class="oldprice">¥99.00</span>
+                        </span>
+                    </div>
+                    <div class="item-r">
+                                <a class="item-target article-column-subscribe">已订阅</a>
+                    </div>
+                </div>
+            </div>
+        </div>
+    <article class="baidu_pl">
+        <div id="article_content" class="article_content clearfix">
+        <link rel="stylesheet" href="./index_files/ck_htmledit_views-1a85854398.css">
+                <div id="content_views" class="markdown_views prism-atom-one-light">
+                    <svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
+                        <path stroke-linecap="round" d="M5,0 0,2.5 5,5z" id="raphael-marker-block" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></path>
+                    </svg>
+                    <p></p>
+<div class="toc">
+ <h3><a name="t0"></a>Yocto开发讲解系列总纲</h3>
+ <ul><li><a href="https://fulinux.blog.csdn.net/article/details/116208803#Yocto_3" target="_self">Yocto开发专栏前言</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/116208803#Yocto_18" target="_self">Yocto开发专栏总目录</a></li><li><ul><li><a href="https://fulinux.blog.csdn.net/article/details/116208803#_21" target="_self">快速上手</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/116208803#Yocto_29" target="_self">Yocto理论篇</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/116208803#Metadata_Layer_39" target="_self">Metadata Layer</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/116208803#BitBake_51" target="_self">BitBake工具</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/116208803#Toolchain_63" target="_self">Toolchain或交叉编译器</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/116208803#Linux_71" target="_self">Linux内核和驱动模块</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/116208803#_81" target="_self">文件系统相关</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/116208803#devtool_91" target="_self">devtool开发工具</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/116208803#Toaster_109" target="_self">Toaster使用</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/116208803#ARMBSP_118" target="_self">ARM相关的BSP</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/116208803#bb_130" target="_self">bb文件编写知识</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/116208803#conf_144" target="_self">conf配置</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/116208803#_151" target="_self">实际平台举例</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/116208803#_161" target="_self">其他汇总</a></li></ul>
+ </li></ul>
+</div>
+<p></p> 
+<h1><a name="t1"></a><a id="Yocto_3"></a>Yocto开发专栏前言</h1> 
+<p><strong>欢迎读者盆友光临<code>fulinux</code>的《Yocto开发讲解系列》专栏!</strong></p> 
+<p>本小编有10年软件开发经历和丰富的<code>Yocto</code>开发经验,我最早接触Yocto是在做<code>Freescale</code>的<code>imx6</code>平台的时候,那个时候也是瞎折腾,压根就搞不清楚Yocto里的软件代码怎么改,怎么添加自己的软件项目,没有深入去研究。也仅仅是“挪用”yocto编译出来的一些库和程序、文件系统或者<code>Toolchain</code> SDK来满足自己的项目需求,甚至那个时候觉得还是自己的项目构建系统比较简单好用。虽然有心想研究Yocto,但是太大、太难、太复杂了,想入门都找不到门在哪,也仅仅是浅尝辄止~。但是,四年前由于实际开发要求,我又一次开始接触Yocto,感受到了他的强大和价值,决心好好系统的研究它。这期间付出了大量的时间和精力,真是让人头秃过程呐!不过现在来看Yocto真的的是太棒了,也不是那么难,对于我们做软件开发的盆友们而言简直就是福音,省去了我们交叉编译每个软件项目的时间,又容易将我们的成果固化下来,使我们的项目更加的规范和标准化(国外有很多Yocto开发人员哦)。对于开发者而言,仅仅两条终端命令即可编译出我们需要的所有镜像文件。从此,不必再纠结交叉编译的问题,公司也不必担心某个程序员离职导致项目开发无法继承的问题,即使一个N年之后没有接触的项目,仍然可以快速上手、编译和刷机运行。</p> 
+<p>我写本系列的文章也是在实际需求的驱动下,在边开发的过程中边记录和讲解,尽可能使自己处于一张白纸的基础出发和大家一起从Yocto入门到深入研究,每一篇博文尽可能带着问题出发,落实到具体的实例,结合理论和注释讲解,并将自己折腾的过程记录下来。</p> 
+<p>我想很多朋友都在思考本专栏<strong>是否能解决我的问题</strong>,<strong>是否适配我的硬件平台</strong>,我的回答是<strong>肯定</strong>的。而且为了不局限于某个特定的硬件平台和环境,本专栏从Yocto自带的官方<code>x86-64 qemu</code>虚拟机平台上开发和示例演示,<code>qemu</code>虚拟机的好处是不需要借助除了电脑之外的其他硬件环境,<strong>只要一台电脑</strong>就可以开始我们的Yocto学习和开发。</p> 
+<p>本专栏我会涉及到的一些技术和知识点,包括C/C++语言、shell、python、Qt5/QML和网络等知识,技能包括vim、git、makefile、cmake、autotools、Android、gcc/gdb和toolchain SDK等方面的技能。当然,我会在文中也会尽可能照顾到小白盆友,尽可能讲解我这么做的理由和对代码的注释。当然对于小白盆友能掌握掌握一门C语言和<a href="https://so.csdn.net/so/search?from=pc_blog_highlight&amp;q=Linux" target="_blank" class="hl hl-1">Linux</a>基础操作也可以开始我们的yocto之旅。</p> 
+<p>技术和知识点都是在漫长的过程中积累起来的,重要的我觉得是一些精神品质方面的东西:较真、能折腾和不屈不挠的品质,归纳演绎、对比和逆向的思维方式。我在写本文的过程中遇到很多的坎和高山,我私下都是花了很久的时间折腾,有时候近乎绝望都要放弃了,但是还是坚持了下来了,就是希望给读者盆友呈现的是一个完整优美的演绎过程,而不是将就得过且过。有很多时候我们不怕问题本身,就是怕不知道问题是什么,无法描述,导致无法求助于网络或者他人。我希望大家在使用Yocto的过程中遇到问题时,需要善于找示例,有时候千言万语都不及一个好例子,并从中发现要点。解决问题的方向可以是多方面的,这个反向攻不破可以尝试从其他方向入手,进而对比找出问题出在哪里。读者盆友在阅读本专栏的博文的过程中遇到任何的问题和疑惑,都可以在讨论区提出来,我都会尽可能的回复和帮助解决,而不是当个高冷的博主。</p> 
+<p>我后续还会对本专栏进行系统的归类、校对和查错,尽可能丰富博文,让每一篇文档都做到理论和实践相结合,做到有的放矢、深入浅出。从问题和实际需求出发,分析问题,解决问题、并做相应的归纳和总结。</p> 
+<h1><a name="t2"></a><a id="Yocto_18"></a>Yocto开发专栏总目录</h1> 
+<p>本篇博文主要是为了方便新老读者朋友了解和查阅本专栏,将该系列进行科学分类和提取关键词,尽可能为每篇博文写个概述和要解决什么问题。</p> 
+<h2><a name="t3"></a><a id="_21"></a>快速上手</h2> 
+<p>下面几篇是用来带着大家快速上手的,熟悉下yocto。教大家如何搭建环境、安装必备的软件包,下载Yocto源码,download目录修改、开始编译,并演示运行qemu虚拟机,以及不带显示器如何登陆qemu虚拟机:</p> 
+<p><a href="https://fulinux.blog.csdn.net/article/details/108910914">yocto-第1篇-开始qemux86-64虚拟机的构建</a><br> <a href="https://fulinux.blog.csdn.net/article/details/109002508">yocto-第2篇-qemux86-64虚拟机运行演示</a></p> 
+<ul><li>关键词:yocto qemu bitbake 入门</li></ul> 
+<h2><a name="t4"></a><a id="Yocto_29"></a>Yocto理论篇</h2> 
+<p>让大家对Yocto有个简单的认识,介绍一些概念、目录、工具和变量等:</p> 
+<p><a href="https://fulinux.blog.csdn.net/article/details/121492070">yocto系列讲解 (理论篇) 68 -Yocto版本信息查询稳定版本和EOL版本</a><br> <a href="https://fulinux.blog.csdn.net/article/details/109035813">yocto-第6篇-什么是yocto理论篇</a><br> <a href="https://fulinux.blog.csdn.net/article/details/109860712">yocto-第21篇-yocto项目的概念(1)</a><br> <a href="https://fulinux.blog.csdn.net/article/details/110004470">yocto-第22篇-yocto项目的概念(2)</a></p> 
+<ul><li>关键词:bitbake recipe class 用户配置 Distro BSP Software Layer</li></ul> 
+<h2><a name="t5"></a><a id="Metadata_Layer_39"></a>Metadata Layer</h2> 
+<p>介绍meta layer的一些知识和示例:</p> 
+<p><a href="https://fulinux.blog.csdn.net/article/details/117133281">yocto系列讲解 (理论篇) 56 - poky下目录结构</a><br> <a href="https://blog.csdn.net/fulinus/article/details/117160494">yocto系列讲解 (技能篇) 57 - 如何快速搜索和查找</a><br> <a href="https://fulinux.blog.csdn.net/article/details/109003520">yocto-第3篇-添加已有硬件层实例</a><br> <a href="https://fulinux.blog.csdn.net/article/details/109034181">yocto-第4篇-创建自己的meta layer</a><br> <a href="https://fulinux.blog.csdn.net/article/details/109129587">yocto-第5篇-在meta-mylayer中添加helloworld recipe</a></p> 
+<ul><li>关键词:<code>poky</code> <code>bitbake</code> <code>meta</code> <code>layer</code> <code>model</code> <code>create</code> <code>mylayer</code></li></ul> 
+<h2><a name="t6"></a><a id="BitBake_51"></a>BitBake工具</h2> 
+<p>介绍bitbake、构建全过程、使用到的变量和任务,实战演示等:</p> 
+<p><a href="https://fulinux.blog.csdn.net/article/details/110006470">yocto-第23篇-BitBake全过程(1)</a><br> <a href="https://fulinux.blog.csdn.net/article/details/110093342">yocto-第24篇-BitBake全过程(2)</a><br> <a href="https://fulinux.blog.csdn.net/article/details/110139836">yocto-第25篇-BitBake全过程(3)</a><br> <a href="https://fulinux.blog.csdn.net/article/details/110202209">yocto-第26篇-BitBake全过程(4)</a><br> <a href="https://fulinux.blog.csdn.net/article/details/110400636">yocto-第27篇-BitBake全过程(5)</a></p> 
+<ul><li>关键词:<br> source、SRC_URI、DL_DIR、SRCREV、image和SDK、PACKAGE_<em>、DEPLOY_</em>、do_fetch、do_unpack、PN/PV/PR/S/WORKDIR、do_patch、FILESPATH、do_prepare_recipe_sysroot、do_configure、EXTRA_OECONF、EXTRA_OECMAKE、EXTRA_OEMAKE、CFLAGS/CXXFLAGS、do_compile、do_install、do_package、do_packagedata、PKGD、PKGD*、STAGE_DIR_HOST、STAGING_DIR_NATIVE、STAGING_DIR_TARGET、FILES等变量</li></ul> 
+<h2><a name="t7"></a><a id="Toolchain_63"></a>Toolchain或交叉编译器</h2> 
+<p>介绍如何生成Toolchain SDK,安装,和实战演示:</p> 
+<p><a href="https://fulinux.blog.csdn.net/article/details/110494600">yocto-第28篇-应用开发的SDK或toolchain或gcc</a><br> <a href="https://fulinux.blog.csdn.net/article/details/121393416">yocto系列讲解 (技巧篇) 66 - 设备的文件系统中安装gcc</a></p> 
+<ul><li>关键词:toolchain SDK gcc arm-linux-gcc 交叉编译器</li></ul> 
+<h2><a name="t8"></a><a id="Linux_71"></a>Linux内核和驱动模块</h2> 
+<p>介绍Yocto中的Linux kernle和driver module驱动模块:</p> 
+<p><a href="https://fulinux.blog.csdn.net/article/details/110879345">yocto-第29篇-源码树外添加Linux驱动模块(hello驱动实例)</a><br> <a href="https://fulinux.blog.csdn.net/article/details/111482379">yocto-第31篇-Linux kernel相关的任务</a><br> <a href="https://fulinux.blog.csdn.net/article/details/111565334">yocto-第32篇-qemu Linux kernle默认的配置</a><br> <a href="https://fulinux.blog.csdn.net/article/details/111598247">yocto-第33篇-如何修改linux内核源码和添加补丁文件</a></p> 
+<ul><li>关键词:Linux kernel driver hello module bb mylayer recipe modprobe rmmod defconf menuconfig device tree dts dtb devtool layer</li></ul> 
+<h2><a name="t9"></a><a id="_81"></a>文件系统相关</h2> 
+<p>介绍文件系统相关的内容:</p> 
+<p><a href="https://fulinux.blog.csdn.net/article/details/111183968">yocto-第30篇-创建只读根文件系统</a><br> <a href="https://fulinux.blog.csdn.net/article/details/112196806">yocto-第35篇-添加一个新的10M大小的镜像文件</a><br> <a href="https://fulinux.blog.csdn.net/article/details/117672641">yocto系列讲解 (实战篇) 58 - 程序开机自启动</a><br> <a href="https://fulinux.blog.csdn.net/article/details/121422097">yocto系列讲解 (技巧篇) 67 - 在etc/passwd和etc/group文件中添加用户和组等信息</a></p> 
+<ul><li>关键词:rootfs only-read 只读 分区大小 image</li></ul> 
+<h2><a name="t10"></a><a id="devtool_91"></a>devtool开发工具</h2> 
+<p>介绍devtool工具,举了一个helloyocto和git项目的的例子,来演示如何添加和修改软件项目,以及如何集成。</p> 
+<p><a href="https://fulinux.blog.csdn.net/article/details/109133346">yocto-第7篇-开发工具devtool实操(helloyocto)</a><br> <a href="https://fulinux.blog.csdn.net/article/details/109166362">yocto-第8篇-开发工具devtool实操(添加git项目learnyocto)</a><br> <a href="https://fulinux.blog.csdn.net/article/details/109228029">yocto-第9篇-将软件包打包到qemux86-64机器的文件系统中和devtool finish命令</a><br> <a href="https://fulinux.blog.csdn.net/article/details/109255375">yocto-第10篇-在线部署软件到机器上</a><br> <a href="https://fulinux.blog.csdn.net/article/details/109256958">yocto-第11篇-删除在线部署到机器上的软件</a><br> <a href="https://fulinux.blog.csdn.net/article/details/109258938">yocto-第12篇-如何修改开源项目的代码呢?</a><br> <a href="https://fulinux.blog.csdn.net/article/details/109297054">yocto-第13篇-修改workspace目录路径(create-workspace)</a><br> <a href="https://fulinux.blog.csdn.net/article/details/109319268">yocto-第14篇-devtool edit-recipe命令(编辑bb文件命令)</a><br> <a href="https://fulinux.blog.csdn.net/article/details/109340454">yocto-第15篇-devtool update-recipe命令</a><br> <a href="https://fulinux.blog.csdn.net/article/details/109476622">yocto-第16篇-devtool upgrade命令</a><br> <a href="https://fulinux.blog.csdn.net/article/details/109605651">yocto-第17篇-devtool latest-version命令</a></p> 
+<ul><li>关键词:devtool add modify helloyocto learnyocto workspace qemu finish bb edit-recipe update-recipe upgrade version vim 开源项目 删除 打包</li></ul> 
+<h2><a name="t11"></a><a id="Toaster_109"></a>Toaster使用</h2> 
+<p>介绍Toaster,讲解Yocto如何借助Toaster网页在线直观使用。</p> 
+<p><a href="https://fulinux.blog.csdn.net/article/details/109628939">yocto-第18篇-Toaster使用技巧(1)</a><br> <a href="https://fulinux.blog.csdn.net/article/details/109631101">yocto-第19篇-Toaster使用技巧(2)</a><br> <a href="https://fulinux.blog.csdn.net/article/details/109708138">yocto-第20篇-Toaster使用技巧(3)</a></p> 
+<ul><li>关键词:toaster 网页 在线 调试</li></ul> 
+<h2><a name="t12"></a><a id="ARMBSP_118"></a>ARM相关的BSP</h2> 
+<p>结合一个ARM的beaglebone虚拟机,讲述相关的kernel u-boot等BSP知识和配置</p> 
+<p><a href="https://fulinux.blog.csdn.net/article/details/112392275">yocto-第36篇-编译arm虚拟机qemuarm</a><br> <a href="https://fulinux.blog.csdn.net/article/details/112398756">yocto-第37篇-编译可以在beaglebone开发板上运行的镜像</a><br> <a href="https://fulinux.blog.csdn.net/article/details/112488604">yocto-第38篇-beaglebone-yocto.conf配置分析之PREFERRED_PROVIDER变量</a><br> <a href="https://fulinux.blog.csdn.net/article/details/112580600">yocto-第39篇-beaglebone-yocto.conf配置分析之MACHINE_EXTRA_RRECOMMENDS变量</a><br> <a href="https://fulinux.blog.csdn.net/article/details/112723411">yocto-第40篇-beaglebone-yocto.conf配置分析之u-boot</a><br> <a href="https://fulinux.blog.csdn.net/article/details/113130744">yocto-第41篇-beaglebone-yocto.conf配置分析之kernel</a></p> 
+<ul><li>关键词:arm machine qemu local.conf build 编译 work beaglebone PREFERRED PROVIDER virtual/kernel meta-yocto-bsp 目录 device tree dtb MACHINE_EXTRA_RRECOMMENDS u-boot UBOOT* SERIAL_CONSOLES ?= ??= := DEFAULTTUNE tune KERNEL_IMAGETYPE KERNEL_DEVICETREE KERNEL_EXTRA_ARGS MACHINE_FEATURES IMAGE_BOOT_FILES</li></ul> 
+<h2><a name="t13"></a><a id="bb_130"></a>bb文件编写知识</h2> 
+<p>介绍bb、bbappend、bbclass、inc文件相关知识和实践</p> 
+<p><a href="https://fulinux.blog.csdn.net/article/details/113870307">yocto-第42篇-bb文件中的几个关键词require DEPENDS inherit</a><br> <a href="https://fulinux.blog.csdn.net/article/details/112181061">yocto-第34篇-旧版的yocto或者devtool使用不了时如何修改开源项目源码</a><br> <a href="https://fulinux.blog.csdn.net/article/details/113871052">yocto-第43篇-bb文件中函数实操演示(1)</a><br> <a href="https://fulinux.blog.csdn.net/article/details/113952096">yocto-第44篇-bb文件中函数实操演示(2)</a><br> <a href="https://fulinux.blog.csdn.net/article/details/114000961">yocto-第45篇-bb文件中函数实操演示(3)继承自己的class</a><br> <a href="https://fulinux.blog.csdn.net/article/details/114038614">yocto-第46篇-如何添加自己的函数作为recipe的任务</a><br> <a href="https://fulinux.blog.csdn.net/article/details/114375374">yocto-第47篇-bb文件中如何获取源码或指定本地目录</a><br> <a href="https://fulinux.blog.csdn.net/article/details/118803053">yocto系列讲解 (变量篇) 63 - SRC_URI和SRC_DIR的区别</a><br> <a href="https://fulinux.blog.csdn.net/article/details/120565744">yocto系列讲解 (技巧篇) 64 - bb文件中字符串拆分和拼接简单示例</a></p> 
+<ul><li>关键词:bb append bbclass inc inherit require DEPENDS vim 修改 shell python 函数 function do_* 继承 class 类函数 recipe 任务 addtask deltask nostamp noexec EXTRNALSRC git download wget fetch FILESEXTRAPATHS <code>SRC_URI</code> <code>SRC_DIR</code> <code>字符串处理</code> <code>split</code></li></ul> 
+<h2><a name="t14"></a><a id="conf_144"></a>conf配置</h2> 
+<p>介绍meta*/conf/machine目录中的一些配置内容讲解</p> 
+<p><a href="https://fulinux.blog.csdn.net/article/details/114543626">yocto-第48篇-meta目录中conf里的配置项小札</a></p> 
+<ul><li>关键词:DISTRO VARIANT PACKAGE_DEBUG_SPLIT_STYLE SERIAL_CONSOLE ARM_INSTRUCTION_SET FULL_OPTIMIZATION ENABLE_BINARY_LOCALE_GENERATION USE_LDCONFIG PREFERRED_VERSION USE_DEVFS DEPLOY_DIR_IMAGE PACKAGE_ARCH ARCH</li></ul> 
+<h2><a name="t15"></a><a id="_151"></a>实际平台举例</h2> 
+<p>结合自己的高通平台msm8909来讲述如何完成boot、system和aboot等镜像从无到有的制作</p> 
+<p><a href="https://fulinux.blog.csdn.net/article/details/115380774">yocto-第51篇-实战举例之制作boot.img</a><br> <a href="https://fulinux.blog.csdn.net/article/details/115635948">yocto-第52篇-实战举例之制作system/rootfs文件系统</a><br> <a href="https://fulinux.blog.csdn.net/article/details/115788105">yocto-第53篇-实战举例之制作bootloader</a><br> <a href="https://fulinux.blog.csdn.net/article/details/121290524">yocto系列讲解 (实战篇) 65 - system根文件系统大小问题</a></p> 
+<ul><li>关键词:kernel qcom qualcomm apq8009 msm8909 msm boot.img mkbootimg libmincrypty native defconfig dts zImage-dtb zImage ext4 system rootfs 文件系统 virtual/kernel virtual/bootloader multiple definition Error code 302e bb.utils.contains python python3 HOSTTOOLS aboot lk</li></ul> 
+<h2><a name="t16"></a><a id="_161"></a>其他汇总</h2> 
+<p><a href="https://fulinux.blog.csdn.net/article/details/114677265">yocto-第49篇-编译问题汇总及解决方案</a><br> <a href="https://fulinux.blog.csdn.net/article/details/116353466">yocto系列讲解 (实战篇) 54 - 添加Qt5和生成带Qt5的SDK</a><br> <a href="https://fulinux.blog.csdn.net/article/details/116847306">yocto系列讲解 (实战篇) 55 - 编译Qt程序和添加Qt的recipe(bb文件)</a><br> <a href="https://fulinux.blog.csdn.net/article/details/117672641">yocto系列讲解 (实战篇) 58 - 程序开机自启动(sysvinit/init)</a><br> <a href="https://fulinux.blog.csdn.net/article/details/117751788">yocto系列讲解 (实战篇) 59 - 程序开机自启动(systemd)</a><br> <a href="https://fulinux.blog.csdn.net/article/details/117905250">yocto系列讲解 (实战篇) 60 - 定义自己的临时配置模板的目录</a></p> 
+<ul><li> <p>关键词:Qt5 systemd sysvinit init conf templateconf conf.sample</p> </li><li> <p>to be continue ~</p> </li></ul> 
+<p>给我点个赞加个关注呗!万分感谢!<br> <img src="./index_files/20210313145956347.gif" alt="在这里插入图片描述"></p>
+                </div><div><div></div></div>
+                <link href="./index_files/markdown_views-d7a94ec6ab.css" rel="stylesheet">
+                <link href="./index_files/style-49037e4d27.css" rel="stylesheet">
+        </div>
+        
+    </article>
+</div>
+
+
+
+
+
+                
+            
+            
+
+            
+            
+
+
+        </main>
+
+
+
+    </div>
+
+
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  </body></html>

BIN
html_index/content/000-index/index_files/20210313145956347.gif


BIN
html_index/content/000-index/index_files/20210513113435813.png


BIN
html_index/content/000-index/index_files/articleReadEyes.png


File diff suppressed because it is too large
+ 0 - 0
html_index/content/000-index/index_files/ck_htmledit_views-1a85854398.css


File diff suppressed because it is too large
+ 0 - 0
html_index/content/000-index/index_files/markdown_views-d7a94ec6ab.css


BIN
html_index/content/000-index/index_files/original.png


File diff suppressed because it is too large
+ 0 - 0
html_index/content/000-index/index_files/style-49037e4d27.css


BIN
html_index/content/000-index/index_files/tobarCollect.png


BIN
html_index/content/000-index/index_files/tobarCollectionActive.png


+ 220 - 0
html_index/content/001/108910914.htm

@@ -0,0 +1,220 @@
+<!DOCTYPE html>
+<!-- saved from url=(0055)https://fulinux.blog.csdn.net/article/details/108910914 -->
+<html lang="zh-CN">
+  <body class="nodata " style=""><div id="MathJax_Message" style="display: none;"></div>
+        
+    <script src="./108910914_files/csdn-toolbar.js.下载" type="text/javascript"></script>
+    
+<link rel="stylesheet" href="./108910914_files/blog_code-01256533b5.min.css">
+<link rel="stylesheet" href="./108910914_files/chart-3456820cac.css">
+<div class="main_father clearfix d-flex justify-content-center" style="height:100%;"> 
+    <div class="container" id="mainBox">
+        <main>
+
+<div class="blog-content-box">
+        <div class="article-header-box">
+        <div class="article-header">
+            <div class="article-title-box">
+                <h1 class="title-article" id="articleContentId">yocto-第1篇-开始qemux86-64虚拟机的构建</h1>
+            </div>
+            <div class="article-info-box">
+                <div class="article-bar-top">
+                    <img class="article-type-img" src="./108910914_files/original.png" alt="">
+                    <div class="bar-content">
+                        <span class="c-gray">置顶</span>
+                    <a class="follow-nickName " href="https://fulinux.blog.csdn.net/" target="_blank" rel="noopener">fulinux</a>
+                    <span class="time">2020-10-03 16:50:52</span>
+                    <img class="article-read-img article-heard-img" src="./108910914_files/articleReadEyes.png" alt="">
+                    <span class="read-count">3936</span>
+                    <a id="blog_detail_zk_collection" class="un-collection" data-report-click="{&quot;mod&quot;:&quot;popu_823&quot;,&quot;spm&quot;:&quot;1001.2101.3001.4232&quot;,&quot;ab&quot;:&quot;new&quot;}">
+                        <img class="article-collect-img article-heard-img un-collect-status isdefault" style="display:inline-block" src="./108910914_files/tobarCollect.png" alt="">
+                        <img class="article-collect-img article-heard-img collect-status isactive" style="display:none" src="./108910914_files/tobarCollectionActive.png" alt="">
+                        <span class="name">收藏</span>
+                        <span class="get-collection">
+                            24
+                        </span>
+                    </a>
+                    </div>
+                </div>
+                <div class="blog-tags-box">
+                    <div class="tags-box artic-tag-box">
+                            <span class="label">分类专栏:</span>
+                                <a class="tag-link" href="https://blog.csdn.net/sonbai/category_10445379.html" target="_blank" rel="noopener">Yocto开发篇</a>
+                            <span class="label">文章标签:</span>
+                                <a data-report-click="{&quot;mod&quot;:&quot;popu_626&quot;,&quot;spm&quot;:&quot;1001.2101.3001.4223&quot;,&quot;strategy&quot;:&quot;yocto&quot;,&quot;ab&quot;:&quot;new&quot;}" class="tag-link" href="https://so.csdn.net/so/search/s.do?q=yocto&amp;t=blog&amp;o=vip&amp;s=&amp;l=&amp;f=&amp;viparticle=" target="_blank" rel="noopener">yocto</a>
+                                <a data-report-click="{&quot;mod&quot;:&quot;popu_626&quot;,&quot;spm&quot;:&quot;1001.2101.3001.4223&quot;,&quot;strategy&quot;:&quot;qemu&quot;,&quot;ab&quot;:&quot;new&quot;}" class="tag-link" href="https://so.csdn.net/so/search/s.do?q=qemu&amp;t=blog&amp;o=vip&amp;s=&amp;l=&amp;f=&amp;viparticle=" target="_blank" rel="noopener">qemu</a>
+                                <a data-report-click="{&quot;mod&quot;:&quot;popu_626&quot;,&quot;spm&quot;:&quot;1001.2101.3001.4223&quot;,&quot;strategy&quot;:&quot;虚拟机&quot;,&quot;ab&quot;:&quot;new&quot;}" class="tag-link" href="https://so.csdn.net/so/search/s.do?q=%E8%99%9A%E6%8B%9F%E6%9C%BA&amp;t=blog&amp;o=vip&amp;s=&amp;l=&amp;f=&amp;viparticle=" target="_blank" rel="noopener">虚拟机</a>
+                                <a data-report-click="{&quot;mod&quot;:&quot;popu_626&quot;,&quot;spm&quot;:&quot;1001.2101.3001.4223&quot;,&quot;strategy&quot;:&quot;poky&quot;,&quot;ab&quot;:&quot;new&quot;}" class="tag-link" href="https://so.csdn.net/so/search/s.do?q=poky&amp;t=blog&amp;o=vip&amp;s=&amp;l=&amp;f=&amp;viparticle=" target="_blank" rel="noopener">poky</a>
+                    </div>
+                </div>
+                <div class="slide-content-box">
+                    <div class="article-copyright">
+                        <div class="creativecommons">
+                            版权声明:本文为博主原创文章,遵循<a href="http://creativecommons.org/licenses/by-sa/4.0/" target="_blank" rel="noopener"> CC 4.0 BY-SA </a>版权协议,转载请附上原文出处链接和本声明。
+                        </div>
+                        <div class="article-source-link">
+                            本文链接:<a href="https://blog.csdn.net/fulinus/article/details/108910914" target="_blank">https://blog.csdn.net/fulinus/article/details/108910914</a>
+                        </div>
+                    </div>
+                </div>
+                <div class="operating">
+                    <a class="href-article-edit slide-toggle">版权</a>
+                </div>
+            </div>
+        </div>
+    </div>
+        <div id="blogColumnPayAdvert">
+            <div class="column-group">
+                <div class="column-group-item column-group0 column-group-item-one">
+                    <div class="item-l">
+                        <a class="item-target" href="https://blog.csdn.net/sonbai/category_10445379.html" target="_blank" title="Yocto开发篇" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.6332&quot;}">
+                            <img class="item-target" src="./108910914_files/20210513113435813.png" alt="">
+                            <span class="title item-target">Yocto开发篇</span>
+                        </a>
+                        <span class="dec">专栏收录该内容</span>
+                    </div>
+                    <div class="item-m">
+                        <span>73 篇文章</span>
+                        <span>384 订阅</span>
+                        <span class="old-add-new-box">
+                            <span class="price">¥39.90</span>
+                            <span class="oldprice">¥99.00</span>
+                        </span>
+                    </div>
+                    <div class="item-r">
+                                <a class="item-target article-column-subscribe">已订阅</a>
+                    </div>
+                </div>
+            </div>
+        </div>
+    <article class="baidu_pl">
+        <div id="article_content" class="article_content clearfix">
+        <link rel="stylesheet" href="./108910914_files/ck_htmledit_views-1a85854398.css">
+                <div id="content_views" class="markdown_views prism-atom-one-light">
+                    <svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
+                        <path stroke-linecap="round" d="M5,0 0,2.5 5,5z" id="raphael-marker-block" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></path>
+                    </svg>
+                    <blockquote> 
+ <p>By: fu<a href="https://so.csdn.net/so/search?from=pc_blog_highlight&amp;q=linux" target="_blank" class="hl hl-1">linux</a><br> E-mail: fulinux@sina.com<br> Blog: https://blog.csdn.net/fulinus<br> 喜欢的盆友欢迎点赞和订阅!<br> 你的喜欢就是我写作的动力!</p> 
+</blockquote> 
+<p></p>
+<div class="toc">
+ <h3><a name="t0"></a>目录</h3>
+ <ul><li><ul><li><a href="https://fulinux.blog.csdn.net/article/details/108910914#_9" target="_self">目标理想:</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/108910914#yocto_poky_13" target="_self">构建一个特殊的yocto poky项目</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/108910914#ubuntu_18" target="_self">ubuntu系统环境:</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/108910914#yocto_43" target="_self">下载yocto项目:</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/108910914#_67" target="_self">编译镜像文件:</a></li><li><ul><li><a href="https://fulinux.blog.csdn.net/article/details/108910914#_81" target="_self">开始编译:</a></li></ul>
+  </li></ul>
+ </li></ul>
+</div>
+<p></p> 
+<p><strong>返回总目录</strong>:<a href="https://fulinux.blog.csdn.net/article/details/116208803">Yocto开发讲解系列 - 总目录</a></p> 
+<h2><a name="t1"></a><a id="_9"></a>目标理想:</h2> 
+<p>我的理想是通过一条命令生成对应开发板的所有镜像文件,开机后的系统跑着Qt的wayland桌面管理系统,实现一个类似手机桌面环境的系统,但是精简、高效率、不吃资源、方便应用层实现多个Qt程序来回切换使用桌面等等。这是我学习yocto和wayland/QtWayland的目的</p> 
+<h2><a name="t2"></a><a id="yocto_poky_13"></a>构建一个特殊的yocto poky项目</h2> 
+<p>Welcome! This short document steps you through the process for a typical image build using the Yocto Project. The document also introduces how to configure a build for specific hardware. You will use Yocto Project to build a reference embedded OS called Poky.<br> 欢迎光临!这个简短的文档指导您完成使用Yocto项目构建典型映像的过程。该文档还介绍了如何为特定硬件配置构建。您将使用Yocto项目构建一个名为Poky的引用嵌入式操作系统。</p> 
+<h2><a name="t3"></a><a id="ubuntu_18"></a>ubuntu系统环境:</h2> 
+<p>对编译机器的要求:<br> Git, tar, Python和gcc版本需要满足如下要求:</p> 
+<ul><li>Git 1.8.3.1 or greater</li><li>tar 1.28 or greater</li><li>Python 3.5.0 or greater</li><li>gcc 5.0 or greater</li></ul> 
+<p>我当前的ubuntu版本如下:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">$ <span class="token function">uname</span> -a
+Linux peeta-OptiPlex-7050 <span class="token number">4.15</span>.0-136-generic <span class="token comment">#140~16.04.1-Ubuntu SMP Wed Feb 3 18:51:03 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux</span>
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li></ul></pre> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;"><span class="token function">sudo</span> <span class="token function">apt-get</span> <span class="token function">install</span> <span class="token function">gawk</span> <span class="token function">wget</span> git-core diffstat <span class="token function">unzip</span> texinfo gcc-multilib <span class="token punctuation">\</span>
+     build-essential chrpath socat cpio python3 python3-pip python3-pexpect <span class="token punctuation">\</span>
+     xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev <span class="token punctuation">\</span>
+     pylint3 xterm -y
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li></ul></pre> 
+<p><em><strong>提示:yocto下载和编译的整个环节(除了运行QEMU虚拟机外)不需要root权限,请尽可能不要在root环境下去操作哦</strong></em></p> 
+<h2><a name="t4"></a><a id="yocto_43"></a>下载yocto项目:</h2> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">$ <span class="token function">git</span> clone git://git.yoctoproject.org/poky
+$ <span class="token builtin class-name">cd</span> poky
+$ <span class="token function">git</span> fetch --tags
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li></ul></pre> 
+<p>poky克隆慢的可以在github上面找找资源,比如:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">$ <span class="token function">git</span> clone https://github.com/gc-plp/poky.git
+$ <span class="token builtin class-name">cd</span> poky
+$ <span class="token function">git</span> remote set-url origin git://git.yoctoproject.org/poky
+$ <span class="token function">git</span> fetch --tags
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li></ul></pre> 
+<p>第三行把源修改成了上面的一条,是因为github上面这个没有yocto-3.2.2。<br> (由原来的yocto-3.1.2改成yocto-3.2.2)</p> 
+<p>切换到对应的版本:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;"><span class="token function">git</span> checkout tags/yocto-3.2.2 -b my-yocto-3.2.2
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li></ul></pre> 
+<h2><a name="t5"></a><a id="_67"></a>编译镜像文件:</h2> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">$ <span class="token builtin class-name">cd</span> ~/poky
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li></ul></pre> 
+<p><img src="./108910914_files/20201003161509206.png" alt="在这里插入图片描述"></p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">$ <span class="token builtin class-name">source</span> oe-init-build-env
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li></ul></pre> 
+<p>有个重要的提示:You can also run generated qemu images with a command like ‘runqemu qemux86-64’</p> 
+<h3><a name="t6"></a><a id="_81"></a>开始编译:</h3> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">build/ $ bitbake core-image-sato
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li></ul></pre> 
+<p><img src="./108910914_files/20201003162954674.png" alt="在这里插入图片描述"><br> 要下载的东西还是特别多的,6835个任务要执行<br> <img src="./108910914_files/20201003174958601.png" alt="在这里插入图片描述"></p> 
+<p>初始构建时间可能很长,要为构建一个功能齐全的Linux系统需要编译大量的软件包,就不可避免需要较长的初始构建时间。但是,一旦完成初始构建,Yocto Project使用的共享状态(状态)缓存机制可以防止系统重新构建自上次构建以来尚未“触及”的软件包。稳定状态机制大大减少了后续构建的时间。</p> 
+<p>可能要等待一段时间。。。。我们继续看下文</p> 
+<blockquote> 
+ <p>有些盆友网络下载速度慢,我将我的downloads目录打包后上传到了百度云上面,连接分享如下,<br> 链接:https://pan.baidu.com/s/1ajjdPB97VEkpJYOjJ_P5FQ 提取码:uatu<br> 复制这段内容后打开百度网盘手机App,操作更方便哦</p> 
+ <p>下载后合并解压,在将其中的文件复制到poky/build/downloads下</p> 
+</blockquote> 
+<p><a href="https://blog.csdn.net/fulinus/article/details/109002508">yocto-第2篇-qemux86-64虚拟机运行演示</a><br> 最终的效果:<br> <img src="./108910914_files/20201217135939350.png" alt="在这里插入图片描述"></p> 
+<blockquote> 
+ <p>tips:安装python3.6的方法:<br> sudo add-apt-repository ppa:deadsnakes/ppa<br> sudo apt-get update<br> sudo apt-get install python3.6<br> #将Python版本从2.7切换到3.6<br> sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1<br> sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.4 2<br> sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.6 3<br> 或者:<br> sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 3</p> 
+</blockquote> 
+<p><strong><font color="red">希望帮我点个赞加关注,你的喜欢就是我持续更新的动力!</font></strong></p>
+                </div><div><div></div></div>
+                <link href="./108910914_files/markdown_views-d7a94ec6ab.css" rel="stylesheet">
+                <link href="./108910914_files/style-49037e4d27.css" rel="stylesheet">
+        </div>
+        
+    </article>
+</div>
+
+
+
+
+
+                
+            
+            
+
+            
+            
+
+
+        </main>
+
+
+
+    </div>
+
+
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+     </body></html>

BIN
html_index/content/001/108910914_files/20201003161509206.png


BIN
html_index/content/001/108910914_files/20201003162954674.png


BIN
html_index/content/001/108910914_files/20201003174958601.png


BIN
html_index/content/001/108910914_files/20201217135939350.png


BIN
html_index/content/001/108910914_files/20210513113435813.png


BIN
html_index/content/001/108910914_files/articleReadEyes.png


+ 177 - 0
html_index/content/001/108910914_files/blog_code-01256533b5.min.css

@@ -0,0 +1,177 @@
+.dp-highlighter { font-family: "Consolas" , "Courier New" , Courier, mono, serif; font-size: 12px; background-color: #E7E5DC; width: 99%; margin: 18px 0 18px 0 !important; padding-top: 1px; text-align: left; }
+
+/* clear styles */
+.dp-highlighter ol, .dp-highlighter ol li, .dp-highlighter ol li span { margin: 0; padding: 0; border: none; }
+
+.dp-highlighter a, .dp-highlighter a:hover { background: none; border: none; padding: 0; margin: 0; }
+
+.dp-highlighter .bar { padding-left: 45px; }
+
+.dp-highlighter.collapsed .bar, .dp-highlighter.nogutter .bar { padding-left: 0px; }
+
+.dp-highlighter ol { 
+	list-style: decimal; /* for ie */ 
+	background-color: #fff; margin: 0px 0px 1px 45px !important; /* 1px bottom margin seems to fix occasional Firefox scrolling */ 
+	padding: 0px; color: #5C5C5C; 
+	border-right:1px solid #E7E5DC;
+}
+
+.dp-highlighter.nogutter ol, .dp-highlighter.nogutter ol li { list-style: none !important; margin-left: 0px !important; }
+
+.dp-highlighter ol li, .dp-highlighter .columns div { list-style: decimal-leading-zero; /* better look for others, override cascade from OL */ list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #F8F8F8; color: #5C5C5C; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 150%; }
+
+.dp-highlighter.nogutter ol li, .dp-highlighter.nogutter .columns div { border: 0; }
+
+.dp-highlighter .columns { background-color: #F8F8F8; color: gray; overflow: hidden; width: 100%; }
+
+.dp-highlighter .columns div { padding-bottom: 5px; }
+
+.dp-highlighter ol li.alt { background-color: #FFF; color: inherit; }
+
+.dp-highlighter ol li span { color: black; background-color: inherit; }
+
+/* Adjust some properties when collapsed */
+
+.dp-highlighter.collapsed ol { margin: 0px; }
+
+.dp-highlighter.collapsed ol li { display: none; }
+
+/* Additional modifications when in print-view */
+
+.dp-highlighter.printing { border: none; }
+
+.dp-highlighter.printing .tools { display: none !important; }
+
+.dp-highlighter.printing li { display: list-item !important; }
+
+/* Styles for the tools */
+
+.dp-highlighter .tools { 
+	padding: 3px 8px 3px 10px; 
+	font: 9px Verdana, Geneva, Arial, Helvetica, sans-serif; color: silver; 
+	background-color: #f8f8f8; 
+	padding-bottom: 10px; 
+	border-left: 3px solid #6CE26C;
+	border-right:1px solid #E7E5DC;
+	}
+
+.dp-highlighter.nogutter .tools { border-left: 0; }
+
+.dp-highlighter.collapsed .tools { border-bottom: 0; }
+
+.dp-highlighter .tools a { font-size: 9px; color: #a0a0a0; background-color: inherit; text-decoration: none; margin-right: 10px; }
+
+.dp-highlighter .tools a:hover { color: red; background-color: inherit; text-decoration: underline; }
+
+/* About dialog styles */
+
+.dp-about { background-color: #fff; color: #333; margin: 0px; padding: 0px; }
+.dp-about table { width: 100%; height: 100%; font-size: 11px; font-family: Tahoma, Verdana, Arial, sans-serif !important; }
+.dp-about td { padding: 10px; vertical-align: top; }
+.dp-about .copy { border-bottom: 1px solid #ACA899; height: 95%; }
+.dp-about .title { color: red; background-color: inherit; font-weight: bold; }
+.dp-about .para { margin: 0 0 4px 0; }
+.dp-about .footer { background-color: #ECEADB; color: #333; border-top: 1px solid #fff; text-align: right; }
+.dp-about .close { font-size: 11px; font-family: Tahoma, Verdana, Arial, sans-serif !important; background-color: #ECEADB; color: #333; width: 60px; height: 22px; }
+
+/* Language specific styles */
+
+.dp-highlighter .comment, .dp-highlighter .comments { color: #008200; background-color: inherit; }
+.dp-highlighter .string { color: blue; background-color: inherit; }
+.dp-highlighter .keyword { color: #069; font-weight: bold; background-color: inherit; }
+.dp-highlighter .preprocessor { color: gray; background-color: inherit; }
+
+/*xml*/
+.dp-xml .cdata { color: #ff1493; }
+.dp-xml .tag, .dp-xml .tag-name { color: #993300; font-weight: bold; }
+.dp-xml .attribute { color: red; }
+.dp-xml .attribute-value { color: blue; }
+/*sql*/
+.dp-sql .func { color: #ff1493; }
+.dp-sql .op { color: #808080; }
+/*ruby*/
+.dp-rb .symbol { color: #a70; }
+.dp-rb .variable { color: #a70; font-weight: bold; }
+/*python*/
+.dp-py .builtins { color: #ff1493; }
+.dp-py .magicmethods { color: #808080; }
+.dp-py .exceptions { color: brown; }
+.dp-py .types { color: brown; font-style: italic; }
+.dp-py .commonlibs { color: #8A2BE2; font-style: italic; }
+/*java*/
+.dp-j .annotation { color: #646464; }
+.dp-j .number { color: #C00000; }
+/*delphi*/
+.dp-delphi .number { color: blue; }
+.dp-delphi .directive { color: #008284; }
+.dp-delphi .vars { color: #000; }
+/*css*/
+.dp-css .value { color: black; }
+.dp-css .important { color: red; }
+/*csharp*/
+.dp-c .vars { color: #d00; }
+/*cpp*/
+.dp-cpp .datatypes { color: #2E8B57; font-weight: bold; }
+
+
+/*tools image*/
+.dp-highlighter .bar a { background-repeat:no-repeat; background-position:left top; display:inline-block; width:16px; height:16px; padding:1px; text-indent:-2000px; _width:0px; _overflow:hidden; _padding-left:16px; _text-indent:0px; }
+.dp-highlighter .bar a:hover { border:solid 1px #ccc; text-decoration:none; padding:0px; background-repeat:no-repeat;_padding-left:16px;}
+.dp-highlighter .bar a.ExpandSource {}
+.dp-highlighter .bar a.ViewSource { background-image:url(https://csdnimg.cn/release/phoenix/images/ico_plain.gif); }
+.dp-highlighter .bar a.CopyToClipboard { background-image:url(https://csdnimg.cn/release/phoenix/images/ico_copy.gif);}
+.dp-highlighter .bar a.PrintSource { display:none; }
+.dp-highlighter .bar a.About { display:none;}
+/* Pretty printing styles. Used with prettify.js. */
+
+/* SPAN elements with the classes below are added by prettyprint. */
+.pln { color: #000 }  /* plain text */
+
+@media screen {
+  .str { color: #080 }  /* string content */
+  .kwd { color: #008 }  /* a keyword */
+  .com { color: #800 }  /* a comment */
+  .typ { color: #606 }  /* a type name */
+  .lit { color: #066 }  /* a literal value */
+  /* punctuation, lisp open bracket, lisp close bracket */
+  .pun, .opn, .clo { color: #660 }
+  .tag { color: #008 }  /* a markup tag name */
+  .atn { color: #606 }  /* a markup attribute name */
+  .atv { color: #080 }  /* a markup attribute value */
+  .dec, .var { color: #606 }  /* a declaration; a variable name */
+  .fun { color: red }  /* a function name */
+}
+
+/* Use higher contrast and text-weight for printable form. */
+@media print, projection {
+  .str { color: #060 }
+  .kwd { color: #006; font-weight: bold }
+  .com { color: #600; font-style: italic }
+  .typ { color: #404; font-weight: bold }
+  .lit { color: #044 }
+  .pun, .opn, .clo { color: #440 }
+  .tag { color: #006; font-weight: bold }
+  .atn { color: #404 }
+  .atv { color: #060 }
+}
+
+/* Put a border around prettyprinted code snippets. */
+pre.prettyprint { padding: 2px; border: 0px solid #888 }
+
+/* Specify class=linenums on a pre to get line numbering */
+ol.linenums { margin-top: 0; margin-bottom: 0 } /* IE indents via margin-left */
+li.L0,
+li.L1,
+li.L2,
+li.L3,
+li.L5,
+li.L6,
+li.L7,
+li.L8 { list-style-type: none }
+/* Alternate shading for lines 
+li.L1,
+li.L3,
+li.L5,
+li.L7,
+li.L9 { background: #eee }
+*/

+ 1 - 0
html_index/content/001/108910914_files/chart-3456820cac.css

@@ -0,0 +1 @@
+div.chartjs canvas,div.chartjs div.chartjs-legend{display:inline-block}div.chartjs div.chartjs-legend span{display:inline-block;width:20px;height:20px;margin-right:10px;margin-bottom:-5px}div.chartjs div.chartjs-legend ul{list-style-type:none}div.chartjs div.chartjs-legend li{margin-top:10px}

File diff suppressed because it is too large
+ 0 - 0
html_index/content/001/108910914_files/ck_htmledit_views-1a85854398.css


File diff suppressed because it is too large
+ 0 - 0
html_index/content/001/108910914_files/csdn-toolbar.js.下载


File diff suppressed because it is too large
+ 0 - 0
html_index/content/001/108910914_files/markdown_views-d7a94ec6ab.css


BIN
html_index/content/001/108910914_files/original.png


File diff suppressed because it is too large
+ 0 - 0
html_index/content/001/108910914_files/style-49037e4d27.css


BIN
html_index/content/001/108910914_files/tobarCollect.png


BIN
html_index/content/001/108910914_files/tobarCollectionActive.png


+ 249 - 0
html_index/content/002/109002508.htm

@@ -0,0 +1,249 @@
+<!DOCTYPE html>
+<!-- saved from url=(0055)https://fulinux.blog.csdn.net/article/details/109002508 -->
+<html lang="zh-CN">
+  <body class="nodata " style=""><div id="MathJax_Message" style="display: none;"></div>
+        <script>
+            var toolbarSearchExt = '{"landingWord":["虚拟机yacto搭建"],"queryWord":"","tag":[],"title":"yocto-第2篇-qemux86-64虚拟机运行演示"}';
+        </script>
+    <script src="./109002508_files/csdn-toolbar.js.下载" type="text/javascript"></script>
+    <script>
+    (function(){
+        var bp = document.createElement('script');
+        var curProtocol = window.location.protocol.split(':')[0];
+        if (curProtocol === 'https') {
+            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
+        }
+        else {
+            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
+        }
+        var s = document.getElementsByTagName("script")[0];
+        s.parentNode.insertBefore(bp, s);
+    })();
+    </script>
+<link rel="stylesheet" href="./109002508_files/blog_code-01256533b5.min.css">
+<link rel="stylesheet" href="./109002508_files/chart-3456820cac.css">
+<div class="main_father clearfix d-flex justify-content-center" style="height:100%;"> 
+    <div class="container clearfix" id="mainBox">
+        <main>
+
+<div class="blog-content-box">
+        <div class="article-header-box">
+        <div class="article-header">
+            <div class="article-title-box">
+                <h1 class="title-article" id="articleContentId">yocto-第2篇-qemux86-64虚拟机运行演示</h1>
+            </div>
+            <div class="article-info-box">
+                <div class="article-bar-top">
+                    <img class="article-type-img" src="./109002508_files/original.png" alt="">
+                    <div class="bar-content">
+                        <img class="article-vip-img article-heard-img" src="./109002508_files/identityVip.png" alt="">
+                        <span class="article-vip-text vip_article"> VIP文章</span>
+                    <a class="follow-nickName " href="https://fulinux.blog.csdn.net/" target="_blank" rel="noopener">fulinux</a>
+                    <span class="time">2020-10-10 18:53:26</span>
+                    <img class="article-read-img article-heard-img" src="./109002508_files/articleReadEyes.png" alt="">
+                    <span class="read-count">2545</span>
+                    <a id="blog_detail_zk_collection" class="un-collection" data-report-click="{&quot;mod&quot;:&quot;popu_823&quot;,&quot;spm&quot;:&quot;1001.2101.3001.4232&quot;,&quot;ab&quot;:&quot;new&quot;}">
+                        <img class="article-collect-img article-heard-img un-collect-status isdefault" style="display:inline-block" src="./109002508_files/tobarCollect.png" alt="">
+                        <img class="article-collect-img article-heard-img collect-status isactive" style="display:none" src="./109002508_files/tobarCollectionActive.png" alt="">
+                        <span class="name">收藏</span>
+                        <span class="get-collection">
+                            9
+                        </span>
+                    </a>
+                    </div>
+                </div>
+                <div class="blog-tags-box">
+                    <div class="tags-box artic-tag-box">
+                            <span class="label">分类专栏:</span>
+                                <a class="tag-link" href="https://blog.csdn.net/sonbai/category_10445379.html" target="_blank" rel="noopener">Yocto开发篇</a>
+                    </div>
+                </div>
+                <div class="slide-content-box">
+                    <div class="article-copyright">
+                        <div class="creativecommons">
+                            版权声明:本文为博主原创文章,遵循<a href="http://creativecommons.org/licenses/by-sa/4.0/" target="_blank" rel="noopener"> CC 4.0 BY-SA </a>版权协议,转载请附上原文出处链接和本声明。
+                        </div>
+                        <div class="article-source-link">
+                            本文链接:<a href="https://blog.csdn.net/fulinus/article/details/109002508" target="_blank">https://blog.csdn.net/fulinus/article/details/109002508</a>
+                        </div>
+                    </div>
+                </div>
+                <div class="operating">
+                    <a class="href-article-edit slide-toggle">版权</a>
+                </div>
+            </div>
+        </div>
+    </div>
+    <article class="baidu_pl">
+        <div id="article_content" class="article_content clearfix">
+        <link rel="stylesheet" href="./109002508_files/ck_htmledit_views-1a85854398.css">
+                <div id="content_views" class="markdown_views prism-atom-one-light">
+                    <svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
+                        <path stroke-linecap="round" d="M5,0 0,2.5 5,5z" id="raphael-marker-block" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></path>
+                    </svg>
+                    <blockquote> 
+ <p>By: fu<a href="https://so.csdn.net/so/search?from=pc_blog_highlight&amp;q=linux" target="_blank" class="hl hl-1">linux</a><br> E-mail: fulinux@sina.com<br> Blog: https://blog.csdn.net/fulinus<br> 喜欢的盆友欢迎点赞和订阅!<br> 你的喜欢就是我写作的动力!</p> 
+</blockquote> 
+<p></p>
+<div class="toc">
+ <h3><a name="t0"></a>目录</h3>
+ <ul><li><ul><li><a href="https://fulinux.blog.csdn.net/article/details/109002508#_10" target="_self">编译完成运行</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/109002508#qemux8664_36" target="_self">运行qemux86-64</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/109002508#QEMU_67" target="_self">不依赖桌面环境运行QEMU</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/109002508#qemux8664_114" target="_self">登录qemux86-64虚拟机</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/109002508#Ubuntu_142" target="_self">在Ubuntu桌面环境中运行</a></li></ul>
+ </li></ul>
+</div>
+<p></p> 
+<p><strong>返回总目录</strong>:<a href="https://fulinux.blog.csdn.net/article/details/116208803">Yocto开发讲解系列 - 总目录</a></p> 
+<h2><a name="t1"></a><a id="_10"></a>编译完成运行</h2> 
+<p>继续上一篇,今天已经编译完成了,运行虚拟机:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">$ <span class="token function">cd</span> poky/
+$ <span class="token function">source</span> oe-init-build-env
+$ runqemu qemux86
+runqemu - INFO - Running MACHINE<span class="token operator">=</span>qemux86 bitbake -e <span class="token punctuation">..</span>.
+runqemu - ERROR - /home/peeta/poky/build/tmp/deploy/images/qemux86 not a directory valid DEPLOY_DIR_IMAGE
+ls: 无法访问<span class="token string">'/home/peeta/poky/build/tmp/deploy/images/qemux86/*.qemuboot.conf'</span><span class="token keyword">:</span> 没有那个文件或目录
+runqemu - ERROR - Command <span class="token string">'ls -t /home/peeta/poky/build/tmp/deploy/images/qemux86/*.qemuboot.conf'</span> returned non-zero <span class="token keyword">exit</span> status 2
+runqemu - INFO - Cleaning up
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li></ul></pre> 
+<p>提示无法访问/home/peeta/poky/build/tmp/deploy/images/qemux86/*.qemuboot.conf文件,查找原因:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">$ <span class="token function">ls</span> -l /home/peeta/poky/build/tmp/deploy/images/qemux86/*.qemuboot.conf
+ls: 无法访问<span class="token string">'/home/peeta/poky/build/tmp/deploy/images/qemux86/*.qemuboot.conf'</span><span class="token keyword">:</span> 没有那个文件或目录
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li></ul></pre> 
+<p>原因是没有这个路径或者文件,但是有</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">/home/peeta/poky/build/tmp/deploy/images/qemux86-64/
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li></ul></pre> 
+<h2><a name="t2"></a><a id="qemux8664_36"></a>运行qemux86-64</h2> 
+<p>我们在运行runqemu后面的目标机器错了,不是<code>qemux86</code>而是<code>qemux86-64</code>(后者是64位的),因此,前面的命令修改运行如下:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">$ runqemu qemux86-64
+runqemu - INFO - Running MACHINE<span class="token operator">=</span>qemux86-64 bitbake -e <span class="token punctuation">..</span>.
+runqemu - INFO - Continuing with the following parameters:
+KERNEL: <span class="token punctuation">[</span>/home/peeta/poky/build/tmp/deploy/images/qemux86-64/bzImage--5.4.50+git0+416566e1f0_94667198aa-r0-qemux86-64-20201003082353.bin<span class="token punctuation">]</span>
+MACHINE: <span class="token punctuation">[</span>qemux86-64<span class="token punctuation">]</span>
+FSTYPE: <span class="token punctuation">[</span>ext4<span class="token punctuation">]</span>
+ROOTFS: <span class="token punctuation">[</span>/home/peeta/poky/build/tmp/deploy/images/qemux86-64/core-image-sato-qemux86-64-20201003082353.rootfs.ext4<span class="token punctuation">]</span>
+CONFFILE: <span class="token punctuation">[</span>/home/peeta/poky/build/tmp/deploy/images/qemux86-64/core-image-sato-qemux86-64-20201003082353.qemuboot.conf<span class="token punctuation">]</span>
+
+runqemu - INFO - Setting up tap interface under <span class="token function">sudo</span>
+<span class="token punctuation">[</span>sudo<span class="token punctuation">]</span> peeta 的密码: (提示输入超级用户密码)
+runqemu - INFO - Network configuration: ip<span class="token operator">=</span>192.168.7.2::192.168.7.1:255.255.255.0
+runqemu - INFO - Running /home/peeta/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<span class="token operator">=</span>net0,mac<span class="token operator">=</span>52:54:00:12:34:02 -netdev tap,id<span class="token operator">=</span>net0,ifname<span class="token operator">=</span>tap0,script<span class="token operator">=</span>no,downscript<span class="token operator">=</span>no -drive file<span class="token operator">=</span>/home/peeta/poky/build/tmp/deploy/images/qemux86-64/core-image-sato-qemux86-64-20201003082353.rootfs.ext4,if<span class="token operator">=</span>virtio,format<span class="token operator">=</span>raw -show-cursor -usb -device usb-tablet -object rng-random,filename<span class="token operator">=</span>/dev/urandom,id<span class="token operator">=</span>rng0 -device virtio-rng-pci,rng<span class="token operator">=</span>rng0   -cpu core2duo -m 512 -serial mon:vc -serial null -kernel /home/peeta/poky/build/tmp/deploy/images/qemux86-64/bzImage--5.4.50+git0+416566e1f0_94667198aa-r0-qemux86-64-20201003082353.bin -append <span class="token string">'root=/dev/vda rw  mem=512M ip=192.168.7.2::192.168.7.1:255.255.255.0 oprofile.timer=1 '</span>
+
+runqemu - ERROR - Failed to run qemu: Could not initialize SDL<span class="token punctuation">(</span>x11 not available<span class="token punctuation">)</span> - exiting
+
+runqemu - INFO - Cleaning up
+Set <span class="token string">'tap0'</span> nonpersistent
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li><li style="color: rgb(153, 153, 153);">12</li><li style="color: rgb(153, 153, 153);">13</li><li style="color: rgb(153, 153, 153);">14</li><li style="color: rgb(153, 153, 153);">15</li><li style="color: rgb(153, 153, 153);">16</li><li style="color: rgb(153, 153, 153);">17</li><li style="color: rgb(153, 153, 153);">18</li></ul></pre> 
+<p>上面运行的结果显示失败了,重点关注下这个错误提示:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">runqemu - ERROR - Failed to run qemu: Could not initialize SDL<span class="token punctuation">(</span>x11 not available<span class="token punctuation">)</span> - exiting
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li></ul></pre> 
+<p>其中关键词<code>x11</code>通常就是与显示相关的内容,说明失败的原因是<code>run qemu qemux86-64</code>机器需要在ubuntu桌面环境下才能运行,不能在<code>secureCRT</code>或其他第三方linux终端中运行。</p> 
+<h2><a name="t3"></a><a id="QEMU_67"></a>不依赖桌面环境运行QEMU</h2> 
+<p>由于我使用的是<code>secureCRT</code>登录远程Ubuntu服务器的场景,因此,首先尝试不依赖于Ubuntu桌面环境的情况下运行<code>qemux86-64</code>。下面是启动虚拟机的配置信息</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">-device virtio-net-pci,netdev<span class="token operator">=</span>net0,mac<span class="token operator">=</span>52:54:00:12:34:02 -netdev tap,id<span class="token operator">=</span>net0,ifname<span class="token operator">=</span>tap0,script<span class="token operator">=</span>no,downscript<span class="token operator">=</span>no -drive file<span class="token operator">=</span>/home/peeta/poky/build/tmp/deploy/images/qemux86-64/core-image-sato-qemux86-64-20201003082353.rootfs.ext4,if<span class="token operator">=</span>virtio,format<span class="token operator">=</span>raw -show-cursor -usb -device usb-tablet -object rng-random,filename<span class="token operator">=</span>/dev/urandom,id<span class="token operator">=</span>rng0 -device virtio-rng-pci,rng<span class="token operator">=</span>rng0   -cpu core2duo -m 512 -serial mon:vc -serial null -kernel /home/peeta/poky/build/tmp/deploy/images/qemux86-64/bzImage--5.4.50+git0+416566e1f0_94667198aa-r0-qemux86-64-20201003082353.bin -append <span class="token string">'root=/dev/vda rw  mem=512M ip=192.168.7.2::192.168.7.1:255.255.255.0 oprofile.timer=1 '</span>
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li></ul></pre> 
+<p>我们现在使用的机器<code>MACHINE</code>名字是<code>qemux86-64</code>,对应的<code>MACHINE</code>配置文件是:</p> 
+<pre class="prettyprint"><code class="has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">meta/conf/machine/qemux86-64.conf
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li></ul></pre> 
+<p><img src="./109002508_files/20201010192025426.png" alt="在这里插入图片描述"><br> 红框中是其他一个配置文件,相当于头文件。<br> 在<code>meta/conf/machine/include/qemu.inc</code>文件中有这样一个配置:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">MACHINE_FEATURES <span class="token operator">=</span> <span class="token string">"alsa bluetooth usbgadget screen vfat"</span> 
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li></ul></pre> 
+<p>其中有个<code>screen</code>,我们的qemux86-64机器有<code>screen</code>特性<code>FEATURES</code>,这里我们删除<code>screen</code>试试看:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">MACHINE_FEATURES <span class="token operator">=</span> <span class="token string">"alsa bluetooth usbgadget vfat"</span>
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li></ul></pre> 
+<p>在poky/build/conf/local.conf文件中发现这一段话:<br> <img src="./109002508_files/20201010191144836.png" alt="在这里插入图片描述"><br> 与上面错误提示“Could not initialize SDL”中的SDL对上了,看看能不能去掉,试试屏蔽该行:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;"><span class="token comment">#PACKAGECONFIG_append_pn-qemu-system-native = " sdl"</span>
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li></ul></pre> 
+<p>然后,重新source和编译:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">$ <span class="token function">source</span> oe-init-build-env
+$ bitbake core-image-sato
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li></ul></pre> 
+<p>编译完成后运行,这次就没有出错了:<br> <img src="./109002508_files/20201010193322659.png" alt="在这里插入图片描述"></p> 
+<p>从图中可以看到<code>qemux86-64</code>虚拟机的网络地址是<code>192.168.7.2</code>, 而且我的Ubuntu系统可以ping通这个虚拟机(Ubuntu系统自身的网络地址:10.66.10x.xxx,说明qemu虚拟机模拟出来的网卡是可以访问到的,不必考虑是否有相同网关),ping过程如下:</p> 
+<p><img src="./109002508_files/20201010194247966.png" alt="在这里插入图片描述"></p> 
+<h2><a name="t4"></a><a id="qemux8664_114"></a>登录qemux86-64虚拟机</h2> 
+<p>不过突然想到有了网络可以尝试用telnet或者ssh登录,果然是可以的,打开另外一个终端,输入如下命令即可登录:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">$ <span class="token function">ssh</span> root@192.168.7.2
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li></ul></pre> 
+<p><img src="./109002508_files/20201010194632668.png" alt="在这里插入图片描述"><br> 登录后简单了解下这个虚拟机:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">root@qemux86-64:/<span class="token comment"># cat /proc/cmdline </span>
+root<span class="token operator">=</span>/dev/vda rw  mem<span class="token operator">=</span>512M ip<span class="token operator">=</span>192.168.7.2::192.168.7.1:255.255.255.0 oprofile.timer<span class="token operator">=</span>1 
+root@qemux86-64:/<span class="token comment"># mount</span>
+/dev/root on / <span class="token function">type</span> ext4 <span class="token punctuation">(</span>rw,relatime<span class="token punctuation">)</span>
+devtmpfs on /dev <span class="token function">type</span> devtmpfs <span class="token punctuation">(</span>rw,relatime,size<span class="token operator">=</span>244932k,nr_inodes<span class="token operator">=</span>61233,mode<span class="token operator">=</span>755<span class="token punctuation">)</span>
+proc on /proc <span class="token function">type</span> proc <span class="token punctuation">(</span>rw,relatime<span class="token punctuation">)</span>
+tmpfs on /mnt/.psplash <span class="token function">type</span> tmpfs <span class="token punctuation">(</span>rw,relatime,size<span class="token operator">=</span>40k<span class="token punctuation">)</span>
+sysfs on /sys <span class="token function">type</span> sysfs <span class="token punctuation">(</span>rw,relatime<span class="token punctuation">)</span>
+debugfs on /sys/kernel/debug <span class="token function">type</span> debugfs <span class="token punctuation">(</span>rw,relatime<span class="token punctuation">)</span>
+tmpfs on /run <span class="token function">type</span> tmpfs <span class="token punctuation">(</span>rw,nosuid,nodev,mode<span class="token operator">=</span>755<span class="token punctuation">)</span>
+tmpfs on /var/volatile <span class="token function">type</span> tmpfs <span class="token punctuation">(</span>rw,relatime<span class="token punctuation">)</span>
+devpts on /dev/pts <span class="token function">type</span> devpts <span class="token punctuation">(</span>rw,relatime,gid<span class="token operator">=</span>5,mode<span class="token operator">=</span>620,ptmxmode<span class="token operator">=</span>000<span class="token punctuation">)</span>
+nfsd on /proc/fs/nfsd <span class="token function">type</span> nfsd <span class="token punctuation">(</span>rw,relatime<span class="token punctuation">)</span>
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li><li style="color: rgb(153, 153, 153);">12</li><li style="color: rgb(153, 153, 153);">13</li></ul></pre> 
+<p>这样我们使用yocto构建的第一个qemux86-64虚拟机就跑起来了,是不是很顺利呢?</p> 
+<h2><a name="t5"></a><a id="Ubuntu_142"></a>在Ubuntu桌面环境中运行</h2> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">$ runqemu qemux86-64
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li></ul></pre> 
+<p>启动界面:<br> <img src="./109002508_files/20210525190509962.png" alt="在这里插入图片描述"></p> 
+<p>看这个启动log,<code>qemux86-64</code>是没有使用<code>uboot</code>的,而是自带的<code>seaBIOS</code>引导了内核启动。<br> <img src="./109002508_files/20210525191101373.png" alt="在这里插入图片描述"></p> 
+<p>随后出现<code>yocto</code>画面:<br> <img src="./109002508_files/20210525190925421.png" alt="在这里插入图片描述"></p> 
+<p>启动完成的画面:<br> <img src="./109002508_files/20210525191427684.png" alt="在这里插入图片描述"></p> 
+<p>任意操作:<br> <img src="./109002508_files/20210525191605585.png" alt="在这里插入图片描述"></p> 
+<p>打开终端应用:<br> <img src="./109002508_files/20201214190748383.png" alt="在这里插入图片描述"><br> 打开文件管理器,在/home/root下创建文件:<br> <img src="./109002508_files/20201214191155451.png" alt="在这里插入图片描述"></p> 
+<p><strong>To be continue~</strong></p> 
+<p><strong><font color="red">希望帮我点个赞加关注,你的喜欢就是我持续更新的动力!</font></strong></p>
+                </div><div><div></div></div>
+                <link href="./109002508_files/markdown_views-d7a94ec6ab.css" rel="stylesheet">
+                <link href="./109002508_files/style-49037e4d27.css" rel="stylesheet">
+        </div>
+        
+    </article>
+</div>
+
+
+
+
+
+                
+            
+            
+
+            
+            
+
+
+        </main>
+
+
+<script type="text/javascript" src="./109002508_files/user-tooltip.js.下载"></script>
+<script type="text/javascript" src="./109002508_files/user-medal.js.下载"></script>    </div>
+
+
+</div>
+<div class="mask-dark"></div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  </body></html>

BIN
html_index/content/002/109002508_files/20201010191144836.png


BIN
html_index/content/002/109002508_files/20201010192025426.png


BIN
html_index/content/002/109002508_files/20201010193322659.png


BIN
html_index/content/002/109002508_files/20201010194247966.png


BIN
html_index/content/002/109002508_files/20201010194632668.png


BIN
html_index/content/002/109002508_files/20201214190748383.png


BIN
html_index/content/002/109002508_files/20201214191155451.png


BIN
html_index/content/002/109002508_files/20210525190509962.png


BIN
html_index/content/002/109002508_files/20210525190925421.png


BIN
html_index/content/002/109002508_files/20210525191101373.png


BIN
html_index/content/002/109002508_files/20210525191427684.png


BIN
html_index/content/002/109002508_files/20210525191605585.png


BIN
html_index/content/002/109002508_files/articleReadEyes.png


+ 177 - 0
html_index/content/002/109002508_files/blog_code-01256533b5.min.css

@@ -0,0 +1,177 @@
+.dp-highlighter { font-family: "Consolas" , "Courier New" , Courier, mono, serif; font-size: 12px; background-color: #E7E5DC; width: 99%; margin: 18px 0 18px 0 !important; padding-top: 1px; text-align: left; }
+
+/* clear styles */
+.dp-highlighter ol, .dp-highlighter ol li, .dp-highlighter ol li span { margin: 0; padding: 0; border: none; }
+
+.dp-highlighter a, .dp-highlighter a:hover { background: none; border: none; padding: 0; margin: 0; }
+
+.dp-highlighter .bar { padding-left: 45px; }
+
+.dp-highlighter.collapsed .bar, .dp-highlighter.nogutter .bar { padding-left: 0px; }
+
+.dp-highlighter ol { 
+	list-style: decimal; /* for ie */ 
+	background-color: #fff; margin: 0px 0px 1px 45px !important; /* 1px bottom margin seems to fix occasional Firefox scrolling */ 
+	padding: 0px; color: #5C5C5C; 
+	border-right:1px solid #E7E5DC;
+}
+
+.dp-highlighter.nogutter ol, .dp-highlighter.nogutter ol li { list-style: none !important; margin-left: 0px !important; }
+
+.dp-highlighter ol li, .dp-highlighter .columns div { list-style: decimal-leading-zero; /* better look for others, override cascade from OL */ list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #F8F8F8; color: #5C5C5C; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 150%; }
+
+.dp-highlighter.nogutter ol li, .dp-highlighter.nogutter .columns div { border: 0; }
+
+.dp-highlighter .columns { background-color: #F8F8F8; color: gray; overflow: hidden; width: 100%; }
+
+.dp-highlighter .columns div { padding-bottom: 5px; }
+
+.dp-highlighter ol li.alt { background-color: #FFF; color: inherit; }
+
+.dp-highlighter ol li span { color: black; background-color: inherit; }
+
+/* Adjust some properties when collapsed */
+
+.dp-highlighter.collapsed ol { margin: 0px; }
+
+.dp-highlighter.collapsed ol li { display: none; }
+
+/* Additional modifications when in print-view */
+
+.dp-highlighter.printing { border: none; }
+
+.dp-highlighter.printing .tools { display: none !important; }
+
+.dp-highlighter.printing li { display: list-item !important; }
+
+/* Styles for the tools */
+
+.dp-highlighter .tools { 
+	padding: 3px 8px 3px 10px; 
+	font: 9px Verdana, Geneva, Arial, Helvetica, sans-serif; color: silver; 
+	background-color: #f8f8f8; 
+	padding-bottom: 10px; 
+	border-left: 3px solid #6CE26C;
+	border-right:1px solid #E7E5DC;
+	}
+
+.dp-highlighter.nogutter .tools { border-left: 0; }
+
+.dp-highlighter.collapsed .tools { border-bottom: 0; }
+
+.dp-highlighter .tools a { font-size: 9px; color: #a0a0a0; background-color: inherit; text-decoration: none; margin-right: 10px; }
+
+.dp-highlighter .tools a:hover { color: red; background-color: inherit; text-decoration: underline; }
+
+/* About dialog styles */
+
+.dp-about { background-color: #fff; color: #333; margin: 0px; padding: 0px; }
+.dp-about table { width: 100%; height: 100%; font-size: 11px; font-family: Tahoma, Verdana, Arial, sans-serif !important; }
+.dp-about td { padding: 10px; vertical-align: top; }
+.dp-about .copy { border-bottom: 1px solid #ACA899; height: 95%; }
+.dp-about .title { color: red; background-color: inherit; font-weight: bold; }
+.dp-about .para { margin: 0 0 4px 0; }
+.dp-about .footer { background-color: #ECEADB; color: #333; border-top: 1px solid #fff; text-align: right; }
+.dp-about .close { font-size: 11px; font-family: Tahoma, Verdana, Arial, sans-serif !important; background-color: #ECEADB; color: #333; width: 60px; height: 22px; }
+
+/* Language specific styles */
+
+.dp-highlighter .comment, .dp-highlighter .comments { color: #008200; background-color: inherit; }
+.dp-highlighter .string { color: blue; background-color: inherit; }
+.dp-highlighter .keyword { color: #069; font-weight: bold; background-color: inherit; }
+.dp-highlighter .preprocessor { color: gray; background-color: inherit; }
+
+/*xml*/
+.dp-xml .cdata { color: #ff1493; }
+.dp-xml .tag, .dp-xml .tag-name { color: #993300; font-weight: bold; }
+.dp-xml .attribute { color: red; }
+.dp-xml .attribute-value { color: blue; }
+/*sql*/
+.dp-sql .func { color: #ff1493; }
+.dp-sql .op { color: #808080; }
+/*ruby*/
+.dp-rb .symbol { color: #a70; }
+.dp-rb .variable { color: #a70; font-weight: bold; }
+/*python*/
+.dp-py .builtins { color: #ff1493; }
+.dp-py .magicmethods { color: #808080; }
+.dp-py .exceptions { color: brown; }
+.dp-py .types { color: brown; font-style: italic; }
+.dp-py .commonlibs { color: #8A2BE2; font-style: italic; }
+/*java*/
+.dp-j .annotation { color: #646464; }
+.dp-j .number { color: #C00000; }
+/*delphi*/
+.dp-delphi .number { color: blue; }
+.dp-delphi .directive { color: #008284; }
+.dp-delphi .vars { color: #000; }
+/*css*/
+.dp-css .value { color: black; }
+.dp-css .important { color: red; }
+/*csharp*/
+.dp-c .vars { color: #d00; }
+/*cpp*/
+.dp-cpp .datatypes { color: #2E8B57; font-weight: bold; }
+
+
+/*tools image*/
+.dp-highlighter .bar a { background-repeat:no-repeat; background-position:left top; display:inline-block; width:16px; height:16px; padding:1px; text-indent:-2000px; _width:0px; _overflow:hidden; _padding-left:16px; _text-indent:0px; }
+.dp-highlighter .bar a:hover { border:solid 1px #ccc; text-decoration:none; padding:0px; background-repeat:no-repeat;_padding-left:16px;}
+.dp-highlighter .bar a.ExpandSource {}
+.dp-highlighter .bar a.ViewSource { background-image:url(https://csdnimg.cn/release/phoenix/images/ico_plain.gif); }
+.dp-highlighter .bar a.CopyToClipboard { background-image:url(https://csdnimg.cn/release/phoenix/images/ico_copy.gif);}
+.dp-highlighter .bar a.PrintSource { display:none; }
+.dp-highlighter .bar a.About { display:none;}
+/* Pretty printing styles. Used with prettify.js. */
+
+/* SPAN elements with the classes below are added by prettyprint. */
+.pln { color: #000 }  /* plain text */
+
+@media screen {
+  .str { color: #080 }  /* string content */
+  .kwd { color: #008 }  /* a keyword */
+  .com { color: #800 }  /* a comment */
+  .typ { color: #606 }  /* a type name */
+  .lit { color: #066 }  /* a literal value */
+  /* punctuation, lisp open bracket, lisp close bracket */
+  .pun, .opn, .clo { color: #660 }
+  .tag { color: #008 }  /* a markup tag name */
+  .atn { color: #606 }  /* a markup attribute name */
+  .atv { color: #080 }  /* a markup attribute value */
+  .dec, .var { color: #606 }  /* a declaration; a variable name */
+  .fun { color: red }  /* a function name */
+}
+
+/* Use higher contrast and text-weight for printable form. */
+@media print, projection {
+  .str { color: #060 }
+  .kwd { color: #006; font-weight: bold }
+  .com { color: #600; font-style: italic }
+  .typ { color: #404; font-weight: bold }
+  .lit { color: #044 }
+  .pun, .opn, .clo { color: #440 }
+  .tag { color: #006; font-weight: bold }
+  .atn { color: #404 }
+  .atv { color: #060 }
+}
+
+/* Put a border around prettyprinted code snippets. */
+pre.prettyprint { padding: 2px; border: 0px solid #888 }
+
+/* Specify class=linenums on a pre to get line numbering */
+ol.linenums { margin-top: 0; margin-bottom: 0 } /* IE indents via margin-left */
+li.L0,
+li.L1,
+li.L2,
+li.L3,
+li.L5,
+li.L6,
+li.L7,
+li.L8 { list-style-type: none }
+/* Alternate shading for lines 
+li.L1,
+li.L3,
+li.L5,
+li.L7,
+li.L9 { background: #eee }
+*/

+ 1 - 0
html_index/content/002/109002508_files/chart-3456820cac.css

@@ -0,0 +1 @@
+div.chartjs canvas,div.chartjs div.chartjs-legend{display:inline-block}div.chartjs div.chartjs-legend span{display:inline-block;width:20px;height:20px;margin-right:10px;margin-bottom:-5px}div.chartjs div.chartjs-legend ul{list-style-type:none}div.chartjs div.chartjs-legend li{margin-top:10px}

File diff suppressed because it is too large
+ 0 - 0
html_index/content/002/109002508_files/ck_htmledit_views-1a85854398.css


File diff suppressed because it is too large
+ 0 - 0
html_index/content/002/109002508_files/csdn-toolbar.js.下载


BIN
html_index/content/002/109002508_files/identityVip.png


File diff suppressed because it is too large
+ 0 - 0
html_index/content/002/109002508_files/markdown_views-d7a94ec6ab.css


BIN
html_index/content/002/109002508_files/original.png


File diff suppressed because it is too large
+ 0 - 0
html_index/content/002/109002508_files/style-49037e4d27.css


BIN
html_index/content/002/109002508_files/tobarCollect.png


BIN
html_index/content/002/109002508_files/tobarCollectionActive.png


File diff suppressed because it is too large
+ 0 - 0
html_index/content/002/109002508_files/user-medal.js.下载


File diff suppressed because it is too large
+ 0 - 0
html_index/content/002/109002508_files/user-tooltip.js.下载


File diff suppressed because it is too large
+ 103 - 0
html_index/content/003/109003520.htm


BIN
html_index/content/003/109003520_files/20210525194814989.png


BIN
html_index/content/003/109003520_files/articleReadEyes.png


File diff suppressed because it is too large
+ 0 - 0
html_index/content/003/109003520_files/ck_htmledit_views-1a85854398.css


BIN
html_index/content/003/109003520_files/identityVip.png


File diff suppressed because it is too large
+ 0 - 0
html_index/content/003/109003520_files/markdown_views-d7a94ec6ab.css


BIN
html_index/content/003/109003520_files/original.png


File diff suppressed because it is too large
+ 0 - 0
html_index/content/003/109003520_files/style-49037e4d27.css


BIN
html_index/content/003/109003520_files/tobarCollect.png


BIN
html_index/content/003/109003520_files/tobarCollectionActive.png


+ 298 - 0
html_index/content/004/109034181.htm

@@ -0,0 +1,298 @@
+<!DOCTYPE html>
+<!-- saved from url=(0055)https://fulinux.blog.csdn.net/article/details/109034181 -->
+<html lang="zh-CN">
+  <body class="nodata " style=""><div id="MathJax_Message" style="display: none;"></div>
+        
+    
+    
+
+
+<div class="main_father clearfix d-flex justify-content-center" style="height:100%;"> 
+    <div class="container clearfix" id="mainBox">
+        <main>
+
+<div class="blog-content-box">
+        <div class="article-header-box">
+        <div class="article-header">
+            <div class="article-title-box">
+                <h1 class="title-article" id="articleContentId">yocto-第4篇-创建自己的meta layer</h1>
+            </div>
+            <div class="article-info-box">
+                <div class="article-bar-top">
+                    <img class="article-type-img" src="./109034181_files/original.png" alt="">
+                    <div class="bar-content">
+                        <img class="article-vip-img article-heard-img" src="./109034181_files/identityVip.png" alt="">
+                        <span class="article-vip-text vip_article"> VIP文章</span>
+                    <a class="follow-nickName " href="https://fulinux.blog.csdn.net/" target="_blank" rel="noopener">fulinux</a>
+                    <span class="time">2020-10-12 19:44:46</span>
+                    <img class="article-read-img article-heard-img" src="./109034181_files/articleReadEyes.png" alt="">
+                    <span class="read-count">2161</span>
+                    <a id="blog_detail_zk_collection" class="un-collection" data-report-click="{&quot;mod&quot;:&quot;popu_823&quot;,&quot;spm&quot;:&quot;1001.2101.3001.4232&quot;,&quot;ab&quot;:&quot;new&quot;}">
+                        <img class="article-collect-img article-heard-img un-collect-status isdefault" style="display:inline-block" src="./109034181_files/tobarCollect.png" alt="">
+                        <img class="article-collect-img article-heard-img collect-status isactive" style="display:none" src="./109034181_files/tobarCollectionActive.png" alt="">
+                        <span class="name">收藏</span>
+                        <span class="get-collection">
+                            3
+                        </span>
+                    </a>
+                    </div>
+                </div>
+                <div class="blog-tags-box">
+                    <div class="tags-box artic-tag-box">
+                            <span class="label">分类专栏:</span>
+                                <a class="tag-link" href="https://blog.csdn.net/sonbai/category_10445379.html" target="_blank" rel="noopener">Yocto开发篇</a>
+                            <span class="label">文章标签:</span>
+                                <a data-report-click="{&quot;mod&quot;:&quot;popu_626&quot;,&quot;spm&quot;:&quot;1001.2101.3001.4223&quot;,&quot;strategy&quot;:&quot;yocto&quot;,&quot;ab&quot;:&quot;new&quot;}" class="tag-link" href="https://so.csdn.net/so/search/s.do?q=yocto&amp;t=blog&amp;o=vip&amp;s=&amp;l=&amp;f=&amp;viparticle=" target="_blank" rel="noopener">yocto</a>
+                                <a data-report-click="{&quot;mod&quot;:&quot;popu_626&quot;,&quot;spm&quot;:&quot;1001.2101.3001.4223&quot;,&quot;strategy&quot;:&quot;layer&quot;,&quot;ab&quot;:&quot;new&quot;}" class="tag-link" href="https://so.csdn.net/so/search/s.do?q=layer&amp;t=blog&amp;o=vip&amp;s=&amp;l=&amp;f=&amp;viparticle=" target="_blank" rel="noopener">layer</a>
+                                <a data-report-click="{&quot;mod&quot;:&quot;popu_626&quot;,&quot;spm&quot;:&quot;1001.2101.3001.4223&quot;,&quot;strategy&quot;:&quot;mylayer&quot;,&quot;ab&quot;:&quot;new&quot;}" class="tag-link" href="https://so.csdn.net/so/search/s.do?q=mylayer&amp;t=blog&amp;o=vip&amp;s=&amp;l=&amp;f=&amp;viparticle=" target="_blank" rel="noopener">mylayer</a>
+                                <a data-report-click="{&quot;mod&quot;:&quot;popu_626&quot;,&quot;spm&quot;:&quot;1001.2101.3001.4223&quot;,&quot;strategy&quot;:&quot;example&quot;,&quot;ab&quot;:&quot;new&quot;}" class="tag-link" href="https://so.csdn.net/so/search/s.do?q=example&amp;t=blog&amp;o=vip&amp;s=&amp;l=&amp;f=&amp;viparticle=" target="_blank" rel="noopener">example</a>
+                    </div>
+                </div>
+                <div class="slide-content-box">
+                    <div class="article-copyright">
+                        <div class="creativecommons">
+                            版权声明:本文为博主原创文章,遵循<a href="http://creativecommons.org/licenses/by-sa/4.0/" target="_blank" rel="noopener"> CC 4.0 BY-SA </a>版权协议,转载请附上原文出处链接和本声明。
+                        </div>
+                        <div class="article-source-link">
+                            本文链接:<a href="https://blog.csdn.net/fulinus/article/details/109034181" target="_blank">https://blog.csdn.net/fulinus/article/details/109034181</a>
+                        </div>
+                    </div>
+                </div>
+                <div class="operating">
+                    <a class="href-article-edit slide-toggle">版权</a>
+                </div>
+            </div>
+        </div>
+    </div>
+    <article class="baidu_pl">
+        <div id="article_content" class="article_content clearfix">
+        <link rel="stylesheet" href="./109034181_files/ck_htmledit_views-1a85854398.css">
+                <div id="content_views" class="markdown_views prism-atom-one-light">
+                    <svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
+                        <path stroke-linecap="round" d="M5,0 0,2.5 5,5z" id="raphael-marker-block" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></path>
+                    </svg>
+                    <blockquote> 
+ <p>By: fulinux<br> E-mail: fulinux@sina.com<br> Blog: https://blog.csdn.net/fulinus<br> 喜欢的盆友欢迎点赞和订阅!<br> 你的喜欢就是我写作的动力!</p> 
+</blockquote> 
+<p></p>
+<div class="toc">
+ <h3><a name="t0"></a>目录</h3>
+ <ul><li><ul><li><a href="https://fulinux.blog.csdn.net/article/details/109034181#layer_10" target="_self">创建自己的layer</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/109034181#layer_55" target="_self">创建自己的layer最终命令</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/109034181#layers_64" target="_self">查看添加了那些layers</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/109034181#metamylayer_78" target="_self">meta-mylayer图片结构</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/109034181#example_99" target="_self">编译我们的example项目</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/109034181#___139" target="_self">打印不显示问题 - 后记</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/109034181#deploy_177" target="_self">deploy目录</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/109034181#_201" target="_self">文件系统在哪里</a></li></ul>
+ </li></ul>
+</div>
+<p></p> 
+<p><strong>返回总目录</strong>:<a href="https://fulinux.blog.csdn.net/article/details/116208803">Yocto开发讲解系列 - 总目录</a></p> 
+<h2><a name="t1"></a><a id="layer_10"></a>创建自己的layer</h2> 
+<p>在后续的讲解过程中我们会大量的创建新的项目和演示操作等,但是我们尽可能不去改动<code>poky</code>中的源码等内容,我也希望大家能有这种原则意识。因此,我们可以使用<code>bitbake-layers create-layer</code>命令创建一个自己的<code>layer</code>,我们就取名为<code>meta-mylayer</code>吧。过程演示如下:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">$ <span class="token builtin class-name">cd</span> poky/
+$ <span class="token builtin class-name">source</span> oe-init-build-env
+$ bitbake-layers create-layer meta-mylayer
+NOTE: Starting bitbake server<span class="token punctuation">..</span>.
+Add your new layer with <span class="token string">'bitbake-layers add-layer meta-mylayer'</span>
+build<span class="token punctuation">]</span>$ <span class="token function">ls</span> <span class="token punctuation">..</span>/
+<span class="token comment">#发现这个下面并没有meta-mylayer目录,但是它在poky/build/目录下面:</span>
+build<span class="token punctuation">]</span>$ <span class="token function">ls</span>
+bitbake-cookerdaemon.log  cache  conf  downloads  meta-mylayer  sstate-cache  tmp
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li></ul></pre> 
+<p>但是,这个meta-mylayer是在build目录下,build只是一个临时的构建目录,我们应该将其放在与其他meta目录平级的poky目录下,执行删除操作:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">build<span class="token punctuation">]</span>$ <span class="token function">rm</span> meta-mylayer/ -rf
+<span class="token comment">#重新开始创建meta-mylayer</span>
+build<span class="token punctuation">]</span>$ bitbake-layers create-layer <span class="token punctuation">..</span>/meta-mylayer
+NOTE: Starting bitbake server<span class="token punctuation">..</span>.
+Add your new layer with <span class="token string">'bitbake-layers add-layer ../meta-mylayer'</span>
+build<span class="token punctuation">]</span>$ <span class="token function">ls</span> <span class="token punctuation">..</span>/
+bitbake  documentation         LICENSE.MIT  meta-altera   meta-selftest   oe-init-build-env  README.poky
+build    LICENSE               MEMORIAM     meta-mylayer  meta-skeleton   README.hardware    README.qemu
+contrib  LICENSE.GPL-2.0-only  meta         meta-poky     meta-yocto-bsp  README.OE-Core     scripts
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li></ul></pre> 
+<p>创建完了,它提示你执行:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">build<span class="token punctuation">]</span>$ bitbake-layers add-layer <span class="token punctuation">..</span>/meta-mylayer
+<span class="token comment">#注意执行的路径是在build目录下,meta-mylayer在poky目录下,故而../meta-mylayer</span>
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li></ul></pre> 
+<p>简单讲下:<code>bitbake-layers create-layer</code>会在先在poky目录下创建对于的文件夹,而<code>bitbake-layers add-layer</code>会将layer路径添加到<code>build/conf/bblayers.conf</code>文件中,是分两步的。</p> 
+<p>也有对于的命令去删除layer,比如:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">build<span class="token punctuation">]</span>$ bitbake-layers remove-layer <span class="token punctuation">..</span>/meta-mylayer/
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li></ul></pre> 
+<p>只是讲<code>bblayers.conf</code>中的<code>meta-mylayer</code>配置,不会讲poky目录下的<code>meta-mylayer</code>子目录删除。如果有必要可以手动删除。</p> 
+<h2><a name="t2"></a><a id="layer_55"></a>创建自己的layer最终命令</h2> 
+<p>综上,创建自己的layer,严格安装下面的命令即可:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">build<span class="token punctuation">]</span>$ bitbake-layers create-layer <span class="token punctuation">..</span>/meta-mylayer
+build<span class="token punctuation">]</span>$ bitbake-layers add-layer <span class="token punctuation">..</span>/meta-mylayer
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li></ul></pre> 
+<h2><a name="t3"></a><a id="layers_64"></a>查看添加了那些layers</h2> 
+<p>参考:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">build<span class="token punctuation">]</span>$ bitbake-layers show-layers
+NOTE: Starting bitbake server<span class="token punctuation">..</span>.
+WARNING: Layer meta-mybsp should <span class="token builtin class-name">set</span> LAYERSERIES_COMPAT_meta-mybsp <span class="token keyword">in</span> its conf/layer.conf <span class="token function">file</span> to list the core layer names it is compatible with.
+layer                 path                                      priority
+<span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span>
+meta                  /home/peeta/poky/meta                     <span class="token number">5</span>
+meta-poky             /home/peeta/poky/meta-poky                <span class="token number">5</span>
+meta-yocto-bsp        /home/peeta/poky/meta-yocto-bsp           <span class="token number">5</span>
+meta-mylayer          /home/peeta/poky/meta-mylayer             <span class="token number">5</span>
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li></ul></pre> 
+<h2><a name="t4"></a><a id="metamylayer_78"></a>meta-mylayer图片结构</h2> 
+<p>参考:<br> <img src="./109034181_files/20201012191810766.png" alt="在这里插入图片描述"><br> 查看example_0.1.bb文件是<code>create-layer</code>时,自己创建的一个示例项目,简单看下这个bb文件内容:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">build<span class="token punctuation">]</span>$ <span class="token function">cat</span> <span class="token punctuation">..</span>/meta-mylayer/recipes-example/example/example_0.1.bb 
+SUMMARY <span class="token operator">=</span> <span class="token string">"bitbake-layers recipe"</span>
+DESCRIPTION <span class="token operator">=</span> <span class="token string">"Recipe created by bitbake-layers"</span>
+LICENSE <span class="token operator">=</span> <span class="token string">"MIT"</span>
+
+python <span class="token function-name function">do_build</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
+    bb.plain<span class="token punctuation">(</span><span class="token string">"***********************************************"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
+    bb.plain<span class="token punctuation">(</span><span class="token string">"*                                             *"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
+    bb.plain<span class="token punctuation">(</span><span class="token string">"*  Example recipe created by bitbake-layers   *"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
+    bb.plain<span class="token punctuation">(</span><span class="token string">"*                                             *"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
+    bb.plain<span class="token punctuation">(</span><span class="token string">"***********************************************"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
+<span class="token punctuation">}</span>
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li><li style="color: rgb(153, 153, 153);">12</li></ul></pre> 
+<p>可以看到example.bb文件中没有做什么事情,就是在编译的时候打印了字符串。</p> 
+<h2><a name="t5"></a><a id="example_99"></a>编译我们的example项目</h2> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">build<span class="token punctuation">]</span>$ bitbake example
+Parsing recipes: <span class="token number">100</span>% <span class="token operator">|</span><span class="token comment">##########################################################################################| Time: 0:00:09</span>
+Parsing of <span class="token number">780</span> .bb files complete <span class="token punctuation">(</span><span class="token number">0</span> cached, <span class="token number">780</span> parsed<span class="token punctuation">)</span>. <span class="token number">1321</span> targets, <span class="token number">46</span> skipped, <span class="token number">0</span> masked, <span class="token number">0</span> errors.
+NOTE: Resolving any missing task queue dependencies
+
+Build Configuration:
+BB_VERSION           <span class="token operator">=</span> <span class="token string">"1.46.0"</span>
+BUILD_SYS            <span class="token operator">=</span> <span class="token string">"x86_64-linux"</span>
+NATIVELSBSTRING      <span class="token operator">=</span> <span class="token string">"universal"</span>
+TARGET_SYS           <span class="token operator">=</span> <span class="token string">"x86_64-poky-linux"</span>
+MACHINE              <span class="token operator">=</span> <span class="token string">"qemux86-64"</span>
+DISTRO               <span class="token operator">=</span> <span class="token string">"poky"</span>
+DISTRO_VERSION       <span class="token operator">=</span> <span class="token string">"3.1.2"</span>
+TUNE_FEATURES        <span class="token operator">=</span> <span class="token string">"m64 core2"</span>
+TARGET_FPU           <span class="token operator">=</span> <span class="token string">""</span>
+meta                 
+meta-poky            
+meta-yocto-bsp       <span class="token operator">=</span> <span class="token string">"my-yocto-3.1.2:569b1f5d67c57de957e243997c53ec2f81dc8dfe"</span>
+meta-altera          <span class="token operator">=</span> <span class="token string">"master:aa24dfcb39fce3619a87ee6eef6e4296e66d2099"</span>
+meta-mylayer         <span class="token operator">=</span> <span class="token string">"my-yocto-3.1.2:569b1f5d67c57de957e243997c53ec2f81dc8dfe"</span>
+
+Initialising tasks: <span class="token number">100</span>% <span class="token operator">|</span><span class="token comment">#######################################################################################| Time: 0:00:00</span>
+Sstate summary: Wanted <span class="token number">7</span> Found <span class="token number">0</span> Missed <span class="token number">7</span> Current <span class="token number">128</span> <span class="token punctuation">(</span><span class="token number">0</span>% match, <span class="token number">94</span>% complete<span class="token punctuation">)</span>
+NOTE: Executing Tasks
+NOTE: Tasks Summary: Attempted <span class="token number">542</span> tasks of <span class="token function">which</span> <span class="token number">527</span> didn't need to be rerun and all succeeded.
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li><li style="color: rgb(153, 153, 153);">12</li><li style="color: rgb(153, 153, 153);">13</li><li style="color: rgb(153, 153, 153);">14</li><li style="color: rgb(153, 153, 153);">15</li><li style="color: rgb(153, 153, 153);">16</li><li style="color: rgb(153, 153, 153);">17</li><li style="color: rgb(153, 153, 153);">18</li><li style="color: rgb(153, 153, 153);">19</li><li style="color: rgb(153, 153, 153);">20</li><li style="color: rgb(153, 153, 153);">21</li><li style="color: rgb(153, 153, 153);">22</li><li style="color: rgb(153, 153, 153);">23</li><li style="color: rgb(153, 153, 153);">24</li><li style="color: rgb(153, 153, 153);">25</li></ul></pre> 
+<p>编译好像没有什么输出,中间文件都在:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">build<span class="token punctuation">]</span>$ <span class="token builtin class-name">cd</span> build/tmp/work/core2-64-poky-linux/example/0.1-r0
+<span class="token punctuation">[</span>peeta@tommy-OptiPlex-7060 <span class="token number">0.1</span>-r0<span class="token punctuation">]</span>$ <span class="token function">ls</span>
+configure.sstate          example-0.1   license-destdir  pkgdata              pseudo                 source-date-epoch
+deploy-rpms               example.spec  package          pkgdata-pdata-input  recipe-sysroot         sysroot-destdir
+deploy-source-date-epoch  image         packages-split   pkgdata-sysroot      recipe-sysroot-native  temp
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li></ul></pre> 
+<h2><a name="t6"></a><a id="___139"></a>打印不显示问题 - 后记</h2> 
+<p>关于在bb文件中加打印信息没有任何显示的问题<br> 修改<code>meta-mylayer/recipes-example/example/example_0.1.bb</code>文件:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">SUMMARY <span class="token operator">=</span> <span class="token string">"bitbake-layers recipe"</span>
+DESCRIPTION <span class="token operator">=</span> <span class="token string">"Recipe created by bitbake-layers"</span>
+LICENSE <span class="token operator">=</span> <span class="token string">"MIT"</span>
+
+python <span class="token function-name function">do_compile</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span> <span class="token comment">#改成do_compile</span>
+    bb.plain<span class="token punctuation">(</span><span class="token string">"***********************************************"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
+    bb.plain<span class="token punctuation">(</span><span class="token string">"*                                             *"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
+    bb.plain<span class="token punctuation">(</span><span class="token string">"*  Example recipe created by bitbake-layers   *"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
+    bb.plain<span class="token punctuation">(</span><span class="token string">"*                                             *"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
+    bb.plain<span class="token punctuation">(</span><span class="token string">"***********************************************"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
+<span class="token punctuation">}</span>
+
+addtask compile <span class="token comment">#加上这一行</span>
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li><li style="color: rgb(153, 153, 153);">12</li><li style="color: rgb(153, 153, 153);">13</li></ul></pre> 
+<p>然后编译就可以看到打印了:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">build<span class="token punctuation">]</span>$ bitbake example
+<span class="token punctuation">..</span>.
+NOTE: Executing Tasks
+***********************************************
+*                                             *
+*  Example recipe created by bitbake-layers   *
+*                                             *
+***********************************************
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li></ul></pre> 
+<p>如果再次编译会看不到上述打印,是因为有了编译历史记录,而bb文件没有更新,所以do_compile任务就没有再次执行。需要做如下工作:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">build<span class="token punctuation">]</span>$ bitbake -c cleanall example
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li></ul></pre> 
+<h2><a name="t7"></a><a id="deploy_177"></a>deploy目录</h2> 
+<p>所有生成的镜像文件包括bootloader、kernel镜像和文件系统等镜像都在这个目录下面:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">build<span class="token punctuation">]</span>$ <span class="token builtin class-name">cd</span> tmp/deploy/images/qemux86-64/
+qemux86-64<span class="token punctuation">]</span>$ <span class="token function">ls</span>
+bzImage
+bzImage--5.4.50+git0+416566e1f0_94667198aa-r0-qemux86-64-20201003082353.bin
+bzImage-qemux86-64.bin
+core-image-sato-qemux86-64-20201003082353.qemuboot.conf
+core-image-sato-qemux86-64-20201003082353.rootfs.ext4
+core-image-sato-qemux86-64-20201003082353.rootfs.manifest
+core-image-sato-qemux86-64-20201003082353.rootfs.tar.bz2
+core-image-sato-qemux86-64-20201003082353.testdata.json
+core-image-sato-qemux86-64.ext4
+core-image-sato-qemux86-64.manifest
+core-image-sato-qemux86-64.qemuboot.conf
+core-image-sato-qemux86-64.tar.bz2
+core-image-sato-qemux86-64.testdata.json
+modules--5.4.50+git0+416566e1f0_94667198aa-r0-qemux86-64-20201003082353.tgz
+modules-qemux86-64.tgz
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li><li style="color: rgb(153, 153, 153);">12</li><li style="color: rgb(153, 153, 153);">13</li><li style="color: rgb(153, 153, 153);">14</li><li style="color: rgb(153, 153, 153);">15</li><li style="color: rgb(153, 153, 153);">16</li><li style="color: rgb(153, 153, 153);">17</li></ul></pre> 
+<h2><a name="t8"></a><a id="_201"></a>文件系统在哪里</h2> 
+<p>制作文件系统也是一个独立的任务叫core-image-sato,生成的中间文件目录在:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">build<span class="token punctuation">]</span>$ <span class="token function">ls</span> tmp/work/qemux86_64-poky-linux/core-image-sato/1.0-r0/rootfs/
+bin  boot  dev  etc  home  lib  media  mnt  proc  run  sbin  sys  tmp  usr  var
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li></ul></pre> 
+<p>这里面有个技巧就是你的程序有没有整合到文件系统中可以到这里面找找看,没有就说明有问题,就不需要实际刷机运行了。</p> 
+<p><strong><font color="red">希望帮我点个赞加关注,你的喜欢就是我持续更新的动力!</font></strong></p> 
+<p>更新时间:2021年5月</p>
+                </div><div><div></div></div>
+                <link href="./109034181_files/markdown_views-d7a94ec6ab.css" rel="stylesheet">
+                <link href="./109034181_files/style-49037e4d27.css" rel="stylesheet">
+        </div>
+        
+    </article>
+</div>
+
+
+
+
+
+                
+            
+            
+
+            
+            
+
+
+        </main>
+
+
+
+    </div>
+
+
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  </body></html>

BIN
html_index/content/004/109034181_files/20201012191810766.png


BIN
html_index/content/004/109034181_files/articleReadEyes.png


File diff suppressed because it is too large
+ 0 - 0
html_index/content/004/109034181_files/ck_htmledit_views-1a85854398.css


BIN
html_index/content/004/109034181_files/identityVip.png


File diff suppressed because it is too large
+ 0 - 0
html_index/content/004/109034181_files/markdown_views-d7a94ec6ab.css


BIN
html_index/content/004/109034181_files/original.png


File diff suppressed because it is too large
+ 0 - 0
html_index/content/004/109034181_files/style-49037e4d27.css


BIN
html_index/content/004/109034181_files/tobarCollect.png


BIN
html_index/content/004/109034181_files/tobarCollectionActive.png


+ 643 - 0
html_index/content/005/109129587.htm

@@ -0,0 +1,643 @@
+<!DOCTYPE html>
+<!-- saved from url=(0055)https://fulinux.blog.csdn.net/article/details/109129587 -->
+<html lang="zh-CN">
+  <body class="nodata " style=""><div id="MathJax_Message" style="display: none;"></div>
+        
+    
+    
+
+
+<div class="main_father clearfix d-flex justify-content-center" style="height:100%;"> 
+    <div class="container clearfix" id="mainBox">
+        <main>
+
+<div class="blog-content-box">
+        <div class="article-header-box">
+        <div class="article-header">
+            <div class="article-title-box">
+                <h1 class="title-article" id="articleContentId">yocto-第5篇-在meta-mylayer中添加helloworld recipe</h1>
+            </div>
+            <div class="article-info-box">
+                <div class="article-bar-top">
+                    <img class="article-type-img" src="./109129587_files/original.png" alt="">
+                    <div class="bar-content">
+                        <img class="article-vip-img article-heard-img" src="./109129587_files/identityVip.png" alt="">
+                        <span class="article-vip-text vip_article"> VIP文章</span>
+                    <a class="follow-nickName " href="https://fulinux.blog.csdn.net/" target="_blank" rel="noopener">fulinux</a>
+                    <span class="time">2020-10-17 13:34:48</span>
+                    <img class="article-read-img article-heard-img" src="./109129587_files/articleReadEyes.png" alt="">
+                    <span class="read-count">1751</span>
+                    <a id="blog_detail_zk_collection" class="un-collection" data-report-click="{&quot;mod&quot;:&quot;popu_823&quot;,&quot;spm&quot;:&quot;1001.2101.3001.4232&quot;,&quot;ab&quot;:&quot;new&quot;}">
+                        <img class="article-collect-img article-heard-img un-collect-status isdefault" style="display:inline-block" src="./109129587_files/tobarCollect.png" alt="">
+                        <img class="article-collect-img article-heard-img collect-status isactive" style="display:none" src="./109129587_files/tobarCollectionActive.png" alt="">
+                        <span class="name">收藏</span>
+                        <span class="get-collection">
+                            5
+                        </span>
+                    </a>
+                    </div>
+                </div>
+                <div class="blog-tags-box">
+                    <div class="tags-box artic-tag-box">
+                            <span class="label">分类专栏:</span>
+                                <a class="tag-link" href="https://blog.csdn.net/sonbai/category_10445379.html" target="_blank" rel="noopener">Yocto开发篇</a>
+                            <span class="label">文章标签:</span>
+                                <a data-report-click="{&quot;mod&quot;:&quot;popu_626&quot;,&quot;spm&quot;:&quot;1001.2101.3001.4223&quot;,&quot;strategy&quot;:&quot;yocto&quot;,&quot;ab&quot;:&quot;new&quot;}" class="tag-link" href="https://so.csdn.net/so/search/s.do?q=yocto&amp;t=blog&amp;o=vip&amp;s=&amp;l=&amp;f=&amp;viparticle=" target="_blank" rel="noopener">yocto</a>
+                                <a data-report-click="{&quot;mod&quot;:&quot;popu_626&quot;,&quot;spm&quot;:&quot;1001.2101.3001.4223&quot;,&quot;strategy&quot;:&quot;layer&quot;,&quot;ab&quot;:&quot;new&quot;}" class="tag-link" href="https://so.csdn.net/so/search/s.do?q=layer&amp;t=blog&amp;o=vip&amp;s=&amp;l=&amp;f=&amp;viparticle=" target="_blank" rel="noopener">layer</a>
+                                <a data-report-click="{&quot;mod&quot;:&quot;popu_626&quot;,&quot;spm&quot;:&quot;1001.2101.3001.4223&quot;,&quot;strategy&quot;:&quot;makefile&quot;,&quot;ab&quot;:&quot;new&quot;}" class="tag-link" href="https://so.csdn.net/so/search/s.do?q=makefile&amp;t=blog&amp;o=vip&amp;s=&amp;l=&amp;f=&amp;viparticle=" target="_blank" rel="noopener">makefile</a>
+                                <a data-report-click="{&quot;mod&quot;:&quot;popu_626&quot;,&quot;spm&quot;:&quot;1001.2101.3001.4223&quot;,&quot;strategy&quot;:&quot;cmake&quot;,&quot;ab&quot;:&quot;new&quot;}" class="tag-link" href="https://so.csdn.net/so/search/s.do?q=cmake&amp;t=blog&amp;o=vip&amp;s=&amp;l=&amp;f=&amp;viparticle=" target="_blank" rel="noopener">cmake</a>
+                                <a data-report-click="{&quot;mod&quot;:&quot;popu_626&quot;,&quot;spm&quot;:&quot;1001.2101.3001.4223&quot;,&quot;strategy&quot;:&quot;hello&quot;,&quot;ab&quot;:&quot;new&quot;}" class="tag-link" href="https://so.csdn.net/so/search/s.do?q=hello&amp;t=blog&amp;o=vip&amp;s=&amp;l=&amp;f=&amp;viparticle=" target="_blank" rel="noopener">hello</a>
+                    </div>
+                </div>
+                <div class="slide-content-box">
+                    <div class="article-copyright">
+                        <div class="creativecommons">
+                            版权声明:本文为博主原创文章,遵循<a href="http://creativecommons.org/licenses/by-sa/4.0/" target="_blank" rel="noopener"> CC 4.0 BY-SA </a>版权协议,转载请附上原文出处链接和本声明。
+                        </div>
+                        <div class="article-source-link">
+                            本文链接:<a href="https://blog.csdn.net/fulinus/article/details/109129587" target="_blank">https://blog.csdn.net/fulinus/article/details/109129587</a>
+                        </div>
+                    </div>
+                </div>
+                <div class="operating">
+                    <a class="href-article-edit slide-toggle">版权</a>
+                </div>
+            </div>
+        </div>
+    </div>
+    <article class="baidu_pl">
+        <div id="article_content" class="article_content clearfix">
+        <link rel="stylesheet" href="./109129587_files/ck_htmledit_views-1a85854398.css">
+                <div id="content_views" class="markdown_views prism-atom-one-light">
+                    <svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
+                        <path stroke-linecap="round" d="M5,0 0,2.5 5,5z" id="raphael-marker-block" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></path>
+                    </svg>
+                    <blockquote> 
+ <p>By: fu<a href="https://so.csdn.net/so/search?from=pc_blog_highlight&amp;q=linux" target="_blank" class="hl hl-1">linux</a><br> E-mail: fulinux@sina.com<br> Blog: https://blog.csdn.net/fulinus<br> 喜欢的盆友欢迎点赞和订阅!<br> 你的喜欢就是我写作的动力!</p> 
+</blockquote> 
+<p></p>
+<div class="toc">
+ <h3><a name="t0"></a>目录</h3>
+ <ul><li><ul><li><a href="https://fulinux.blog.csdn.net/article/details/109129587#_10" target="_self">前言</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/109129587#recipes_15" target="_self">创建项目的recipes</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/109129587#Makefile_25" target="_self">由Makefile构建的项目</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/109129587#AutotoolsMakefileam_164" target="_self">由Autotools(Makefile.am)构建的项目</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/109129587#CmakeCMakeListstxt_371" target="_self">由Cmake(CMakeLists.txt)构建的项目</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/109129587#bb_499" target="_self">关于bb文件所处的位置问题</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/109129587#_520" target="_self">安装执行程序到文件系统中</a></li><li><ul><li><a href="https://fulinux.blog.csdn.net/article/details/109129587#1_537" target="_self">关联的方法1</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/109129587#2_548" target="_self">关联的方法2</a></li></ul>
+   </li><li><a href="https://fulinux.blog.csdn.net/article/details/109129587#_593" target="_self">构建只有源码的项目</a></li></ul>
+ </li></ul>
+</div>
+<p></p> 
+<p><strong>返回总目录</strong>:<a href="https://fulinux.blog.csdn.net/article/details/116208803">Yocto开发讲解系列 - 总目录</a></p> 
+<h2><a name="t1"></a><a id="_10"></a>前言</h2> 
+<p>在前面的一篇<a href="https://blog.csdn.net/fulinus/category_10445379.html">yocto-第4篇-创建自己的meta layer</a>中,我们已经在<code>poky</code>目录中添加了自己的一个<code>meta layer</code>,即<code>meta-mylayer</code>,而且在该<code>layer</code>中还有一个自动生成的<code>recipe</code>,即<code>example</code>,没有任何源码仅仅是有一个可以<code>bitbake</code>的<code>example.bb</code>文件,用于输出编译信息。</p> 
+<p>对于绝大部分小白盆友而言,如何快速添加一个项目,哪怕是一个<code>helloworld</code>项目,也是对于自己初识<code>yocto</code>想快速上手的一个也非常有用的示例和帮助,因为一个好的例子胜过千言万语。诚然,关于<code>yocto</code>如何添加<code>helloworld</code>项目在其他博文中也可以看到,但是应该没有本篇全面和系统化,考虑到项目有多种构建系统,比如<code>Makefile</code>、<code>Autotools</code>和<code>Cmake</code>等构建的项目。我将在本篇中尽可能为大家展示出来。</p> 
+<h2><a name="t2"></a><a id="recipes_15"></a>创建项目的recipes</h2> 
+<p>首先我们考虑下这个<code>helloworld</code>项目源代码放在哪里?git服务器或者本地?当然都是可以的(本专利其他系列有讲到)。这里先考虑将源代码(毕竟源文件很少)放到<code>meta-mylayer</code>目录中。之前的文章中我们说了<code>recipes</code>是放在<code>meta layer</code>目录下的,因此,我们也在<code>meta-mylayer</code>目录中创建一个<code>recipe</code>, 参考下面:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">poky<span class="token punctuation">]</span>$ <span class="token builtin class-name">cd</span> meta-mylayer/
+meta-mylayer<span class="token punctuation">]</span>$ <span class="token function">mkdir</span> recipes-helloworld
+meta-mylayer<span class="token punctuation">]</span>$ <span class="token builtin class-name">cd</span> recipes-helloworld/
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li></ul></pre> 
+<p>见上面,我们将会在<code>recipes-helloworld</code>目录中放置若干种方式构建的<code>helloworld</code>项目。</p> 
+<h2><a name="t3"></a><a id="Makefile_25"></a>由Makefile构建的项目</h2> 
+<ol><li>创建一个<code>Makefile</code>方式构建的<code>helloworld</code>项目,为了区分后面的构建系统项目,这里我们将目录名定为<code>hellowolrd-m</code>,参考如下过程:</li></ol> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">recipes-helloworld<span class="token punctuation">]</span>$ <span class="token function">mkdir</span> helloworld-m/helloworld
+recipes-helloworld<span class="token punctuation">]</span>$ <span class="token builtin class-name">cd</span> hellowolrd-m/helloworld
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li></ul></pre> 
+<ol start="2"><li>并新建一个<code>helloworld.c</code>文件:</li></ol> 
+<pre class="prettyprint"><code class="prism language-c has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;"><span class="token comment">//helloworld.c</span>
+<span class="token macro property"><span class="token directive-hash">#</span><span class="token directive keyword">include</span> <span class="token string">&lt;stdio.h&gt;</span></span>
+
+<span class="token keyword">int</span> <span class="token function">main</span> <span class="token punctuation">(</span><span class="token keyword">int</span> argc<span class="token punctuation">,</span> <span class="token keyword">char</span> <span class="token operator">*</span><span class="token operator">*</span>argv<span class="token punctuation">)</span>
+<span class="token punctuation">{<!-- --></span>
+        <span class="token function">printf</span><span class="token punctuation">(</span><span class="token string">"Hello World!\n"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
+        <span class="token keyword">return</span> <span class="token number">0</span><span class="token punctuation">;</span>
+<span class="token punctuation">}</span> <span class="token comment">/* ----- End of main() ----- */</span>
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li></ul></pre> 
+<p>这个程序很简单,C程序内容也不是本篇的关注点,尽量简单哈。如果大家遇到复杂的情况不清楚怎么弄可以在评论区里面留言。</p> 
+<ol start="3"><li>新建一个<code>Makefile</code>文件:</li></ol> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">TARGET <span class="token operator">=</span> helloworld
+all :<span class="token operator">=</span> <span class="token variable"><span class="token variable">$(</span>TARGET<span class="token variable">)</span></span>
+CFLAGS ?<span class="token operator">=</span> -Wall -O
+bindir <span class="token operator">=</span> <span class="token variable"><span class="token variable">$(</span>DESTDIR<span class="token variable">)</span></span>/usr/bin/
+
+OBJS <span class="token operator">=</span> helloworld.o
+
+<span class="token variable"><span class="token variable">$(</span>TARGET<span class="token variable">)</span></span><span class="token builtin class-name">:</span> <span class="token variable"><span class="token variable">$(</span>OBJS<span class="token variable">)</span></span>
+        <span class="token variable"><span class="token variable">$(</span>CC<span class="token variable">)</span></span> <span class="token variable"><span class="token variable">$(</span>CFLAGS<span class="token variable">)</span></span> <span class="token variable"><span class="token variable">$(</span>LDFLAGS<span class="token variable">)</span></span> $^ -o <span class="token variable">$@</span>
+
+install:
+        <span class="token function">install</span> -d <span class="token variable"><span class="token variable">$(</span>bindir<span class="token variable">)</span></span>
+        <span class="token function">install</span> -m 0755 <span class="token variable"><span class="token variable">$(</span>TARGET<span class="token variable">)</span></span> <span class="token variable"><span class="token variable">$(</span>bindir<span class="token variable">)</span></span>
+                           
+uninstall:
+        <span class="token variable">${RM}</span> <span class="token variable"><span class="token variable">$(</span>bindir<span class="token variable">)</span></span>/<span class="token variable"><span class="token variable">$(</span>TARGET<span class="token variable">)</span></span>
+
+clean:
+        <span class="token variable"><span class="token variable">$(</span>RM<span class="token variable">)</span></span> <span class="token variable"><span class="token variable">$(</span>TARGET<span class="token variable">)</span></span> <span class="token variable"><span class="token variable">$(</span>OBJS<span class="token variable">)</span></span>
+
+.PHONY: all clean <span class="token function">install</span> uninstall
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li><li style="color: rgb(153, 153, 153);">12</li><li style="color: rgb(153, 153, 153);">13</li><li style="color: rgb(153, 153, 153);">14</li><li style="color: rgb(153, 153, 153);">15</li><li style="color: rgb(153, 153, 153);">16</li><li style="color: rgb(153, 153, 153);">17</li><li style="color: rgb(153, 153, 153);">18</li><li style="color: rgb(153, 153, 153);">19</li><li style="color: rgb(153, 153, 153);">20</li><li style="color: rgb(153, 153, 153);">21</li></ul></pre> 
+<ol start="4"><li>在添加bb文件之前,可以先自己手动验证是否有问题,如果没有问题了,我们再继续下一步:</li></ol> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">helloworld<span class="token punctuation">]</span>$ <span class="token function">ls</span>
+helloworld.c  Makefile
+helloworld<span class="token punctuation">]</span>$ <span class="token function">make</span>
+cc -Wall -O -c -o helloworld.o helloworld.c
+cc -Wall -O helloworld.o -o helloworld
+helloworld<span class="token punctuation">]</span>$ ./helloworld 
+Hello World<span class="token operator">!</span>
+helloworld<span class="token punctuation">]</span>$ <span class="token function">make</span> clean
+<span class="token function">rm</span> -f helloworld helloworld.o
+helloworld<span class="token punctuation">]</span>$ <span class="token function">ls</span>
+helloworld.c  Makefile
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li></ul></pre> 
+<p>OK~ 上面验证的结果正常,下一步就是写一个<code>recipe</code>的bb文件了:</p> 
+<ol start="5"><li>新建一个bb文件,文件名就叫<code>helloworld-m.bb</code>,注意文件名中下划线"_"是分隔<code>recipe</code>名和版本的,<code>不能</code>出现<code>helloworld_m.bb</code>的名字,这样一来m就成版本号了。</li></ol> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">helloworld<span class="token punctuation">]</span>$ <span class="token builtin class-name">cd</span> <span class="token punctuation">..</span>/
+helloworld-m<span class="token punctuation">]</span>$ <span class="token function">vim</span> helloworld-m.bb
+<span class="token comment"># helloworld application</span>
+SUMMARY <span class="token operator">=</span> <span class="token string">"helloworld of makefile recipe"</span> <span class="token comment">#概要</span>
+DESCRIPTION <span class="token operator">=</span> <span class="token string">"My hello world application"</span> <span class="token comment">#描述</span>
+LICENSE <span class="token operator">=</span> <span class="token string">"CLOSED"</span> <span class="token comment">#关闭license</span>
+
+FILESEXTRAPATHS_prepend :<span class="token operator">=</span> <span class="token string">"<span class="token variable">${THISDIR}</span>/:"</span> <span class="token comment">#文件额外的搜索路径</span>
+SRC_URI <span class="token operator">=</span> <span class="token string">"file://helloworld/"</span> <span class="token comment">#指定源码路径</span>
+
+S <span class="token operator">=</span> <span class="token string">"<span class="token variable">${WORKDIR}</span>/helloworld"</span>
+
+CFLAGS_append <span class="token operator">=</span> <span class="token string">"-Wall -O -g"</span>
+
+EXTRA_OEMAKE <span class="token operator">=</span> <span class="token string">"'CC=<span class="token variable">${CC}</span>' 'CFLAGS=<span class="token variable">${CFLAGS}</span>'"</span>
+EXTRA_OEMAKE_append <span class="token operator">=</span> <span class="token string">" 'LDFLAGS=<span class="token variable">${LDFLAGS}</span>'"</span>
+EXTRA_OEMAKE_append <span class="token operator">=</span> <span class="token string">" 'DESTDIR=<span class="token variable">${D}</span>'"</span>
+
+<span class="token function-name function">do_install</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
+        oe_runmake <span class="token function">install</span>
+<span class="token punctuation">}</span>
+
+<span class="token comment"># if no install target in makefile, using this do_install</span>
+<span class="token comment">#do_install () {<!-- --></span>
+<span class="token comment">#install -d ${D}${bindir}/</span>
+<span class="token comment">#install -m 0755 ${S}/helloworld ${D}${bindir}/</span>
+<span class="token comment">#}</span>
+
+<span class="token comment"># if no LDFLAGS, using this</span>
+<span class="token comment">#INSANE_SKIP_${PN} += "ldflags"</span>
+
+FILES_<span class="token variable">${PN}</span> <span class="token operator">=</span> <span class="token string">"<span class="token variable">${bindir}</span>/"</span>
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li><li style="color: rgb(153, 153, 153);">12</li><li style="color: rgb(153, 153, 153);">13</li><li style="color: rgb(153, 153, 153);">14</li><li style="color: rgb(153, 153, 153);">15</li><li style="color: rgb(153, 153, 153);">16</li><li style="color: rgb(153, 153, 153);">17</li><li style="color: rgb(153, 153, 153);">18</li><li style="color: rgb(153, 153, 153);">19</li><li style="color: rgb(153, 153, 153);">20</li><li style="color: rgb(153, 153, 153);">21</li><li style="color: rgb(153, 153, 153);">22</li><li style="color: rgb(153, 153, 153);">23</li><li style="color: rgb(153, 153, 153);">24</li><li style="color: rgb(153, 153, 153);">25</li><li style="color: rgb(153, 153, 153);">26</li><li style="color: rgb(153, 153, 153);">27</li><li style="color: rgb(153, 153, 153);">28</li><li style="color: rgb(153, 153, 153);">29</li><li style="color: rgb(153, 153, 153);">30</li><li style="color: rgb(153, 153, 153);">31</li><li style="color: rgb(153, 153, 153);">32</li></ul></pre> 
+<p>这里不细讲bb文件了,关于bb文件的内容和变量等知识,我都放在后面的文章中有讲解,大家这里先了解有个印象即可。</p> 
+<ol start="6"><li>查看文件拓扑结构:</li></ol> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">meta-mylayer<span class="token punctuation">]</span>$ tree recipes-helloworld/
+recipes-helloworld/
+└── helloworld-m
+    ├── helloworld
+    │   ├── helloworld.c
+    │   └── Makefile
+    └── helloworld-m.bb
+
+<span class="token number">2</span> directories, <span class="token number">3</span> files
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li></ul></pre> 
+<ol start="7"><li>开始编译</li></ol> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">poky<span class="token punctuation">]</span>$ <span class="token builtin class-name">source</span> oe-init-build-env
+build<span class="token punctuation">]</span>$ bitbake helloworld-m
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li></ul></pre> 
+<ol start="8"><li>查看编译结果:</li></ol> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">build<span class="token punctuation">]</span>$ <span class="token function">ls</span> tmp/work/core2-64-poky-linux/helloworld-m/1.0-r0/  
+configure.sstate          helloworld       packages-split       pseudo                 sysroot-destdir
+debugsources.list         image            pkgdata              recipe-sysroot         temp
+deploy-ipks               license-destdir  pkgdata-pdata-input  recipe-sysroot-native
+deploy-source-date-epoch  package          pkgdata-sysroot      source-date-epoch
+build<span class="token punctuation">]</span>$ <span class="token function">file</span> tmp/work/core2-64-poky-linux/helloworld-m/1.0-r0/image/usr/bin/helloworld 
+tmp/work/core2-64-poky-linux/helloworld-m/1.0-r0/image/usr/bin/helloworld: ELF <span class="token number">64</span>-bit LSB shared object, x86-64, version <span class="token number">1</span> <span class="token punctuation">(</span>SYSV<span class="token punctuation">)</span>, dynamically linked, interpreter /lib/ld-linux-x86-64.so.2, BuildID<span class="token punctuation">[</span>sha1<span class="token punctuation">]</span><span class="token operator">=</span>641c84dfe75480fef888339aa2c782566d48a106, <span class="token keyword">for</span> GNU/Linux <span class="token number">3.2</span>.0, not stripped
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li></ul></pre> 
+<p>OK~ 上面讲解用<code>Makefile</code>文件构建的项目,并如何在<code>yocto</code>中添加<code>recipe</code>的工作到这里就告一段落!</p> 
+<p><em>注意:我们的工作到这里并还没有真正完成,如果编译<code>target</code>(比如<code>bitbake core-image-sato</code>),在文件系统的/usr/bin/目录下没有相应的<code>helloworld</code>执行程序。后面再讲。文末再讲如何安装到文件系统中。</em></p> 
+<h2><a name="t4"></a><a id="AutotoolsMakefileam_164"></a>由Autotools(Makefile.am)构建的项目</h2> 
+<p>可能你并没有听说过<code>Autotools</code>,但是如果项目当中存在<code>configure.ac</code>、<code>Makefile.am</code>等文件的时候,你可能会有印象,不错<code>configure.ac</code>和<code>Makefile.am</code>就是<code>Autotools</code>构建项目的配置文件。</p> 
+<ol><li>新建的<code>recipe</code>的子目录,新建对应的新目录名为<code>helloworld-a</code>,过程参考如下:</li></ol> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">recipes-helloworld<span class="token punctuation">]</span>$ <span class="token function">mkdir</span> helloworld-a
+recipes-helloworld<span class="token punctuation">]</span>$ <span class="token builtin class-name">cd</span> helloworld-a/
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li></ul></pre> 
+<ol start="3"><li>将上一篇的<code>helloworld</code>项目复制到该目录,并做增删操作</li></ol> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">helloworld-a<span class="token punctuation">]</span>$ <span class="token function">cp</span> -rf <span class="token punctuation">..</span>/helloworld-m/helloworld <span class="token builtin class-name">.</span>
+helloworld-a<span class="token punctuation">]</span>$ <span class="token builtin class-name">cd</span> helloworld/
+helloworld<span class="token punctuation">]</span>$ <span class="token function">rm</span> Makefile
+helloworld<span class="token punctuation">]</span>$ <span class="token function">mkdir</span> src
+helloworld<span class="token punctuation">]</span>$ <span class="token function">mv</span> helloworld.c src/
+helloworld<span class="token punctuation">]</span>$ <span class="token function">vim</span> src/helloworld.c 
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li></ul></pre> 
+<blockquote> 
+ <p>实际上我们也可以不用将源码文件放到<code>src</code>目录下,这里只是尽可能向正规的做法靠拢。</p> 
+</blockquote> 
+<ol start="3"><li>修改代码:</li></ol> 
+<pre class="prettyprint"><code class="prism language-c has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;"><span class="token macro property"><span class="token directive-hash">#</span><span class="token directive keyword">include</span> <span class="token string">&lt;stdio.h&gt;</span></span>
+<span class="token macro property"><span class="token directive-hash">#</span><span class="token directive keyword">include</span> <span class="token string">&lt;config.h&gt;</span> <span class="token comment">//添加了这个</span></span>
+
+<span class="token keyword">int</span> <span class="token function">main</span> <span class="token punctuation">(</span><span class="token keyword">int</span> argc<span class="token punctuation">,</span> <span class="token keyword">char</span> <span class="token operator">*</span><span class="token operator">*</span>argv<span class="token punctuation">)</span>
+<span class="token punctuation">{<!-- --></span>
+        <span class="token function">printf</span><span class="token punctuation">(</span><span class="token string">"Hello World and Autotools\n"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
+        <span class="token keyword">return</span> <span class="token number">0</span><span class="token punctuation">;</span>
+<span class="token punctuation">}</span> <span class="token comment">/* ----- End of main() ----- */</span>
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li></ul></pre> 
+<ol start="4"><li>在<code>helloworld</code>目录中新建一个<code>README</code>文件(当然有没有这个文件也没关系):</li></ol> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">helloworld<span class="token punctuation">]</span>$ <span class="token function">vim</span> README    
+This is a demonstration package <span class="token keyword">for</span> GNU Automake.
+Type <span class="token string">'info Automake'</span> to <span class="token builtin class-name">read</span> the Automake manual.
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li></ul></pre> 
+<ol start="5"><li>在项目根目录和<code>src</code>目录中新建两个<code>Makefile.am</code>和<code>src/Makefile.am</code>(包含<code>Automake</code>指令语句)<br> 新建<code>Makefile.am</code>文件</li></ol> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">helloworld<span class="token punctuation">]</span>$ <span class="token function">vim</span> Makefile.am
+SUBDIRS <span class="token operator">=</span> src
+dist_doc_DATA <span class="token operator">=</span> README
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li></ul></pre> 
+<p>新建<code>src/Makefile.am</code>文件</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">helloworld<span class="token punctuation">]</span>$ <span class="token function">vim</span> src/Makefile.am
+bin_PROGRAMS <span class="token operator">=</span> helloworlda <span class="token comment">#命名为helloworlda是为了区别上面的/usr/bin/helloworld,以免冲突</span>
+helloworlda_SOURCES <span class="token operator">=</span> helloworld.c
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li></ul></pre> 
+<ol start="6"><li>新建<code>configure.ac</code>文件(该文件内包含创建<code>configure</code>脚本的<code>Autoconf</code>指令)。</li></ol> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">helloworld<span class="token punctuation">]</span>$ <span class="token function">vim</span> configure.ac
+AC_INIT<span class="token punctuation">(</span><span class="token punctuation">[</span>helloworld<span class="token punctuation">]</span>, <span class="token punctuation">[</span><span class="token number">1.0</span><span class="token punctuation">]</span>, <span class="token punctuation">[</span>fulinux@sina.com<span class="token punctuation">]</span><span class="token punctuation">)</span>
+AM_INIT_AUTOMAKE<span class="token punctuation">(</span><span class="token punctuation">[</span>-Wall -Werror foreign<span class="token punctuation">]</span><span class="token punctuation">)</span>
+AC_PROG_CC
+AC_CONFIG_HEADERS<span class="token punctuation">(</span><span class="token punctuation">[</span>config.h<span class="token punctuation">]</span><span class="token punctuation">)</span>
+AC_CONFIG_FILES<span class="token punctuation">(</span><span class="token punctuation">[</span>
+        Makefile
+        src/Makefile
+<span class="token punctuation">]</span><span class="token punctuation">)</span>
+
+AC_OUTPUT
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li></ul></pre> 
+<p>一旦有了这五个文件,就可以运行<code>Autotools</code>来实例化构建系统了。</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">recipes-helloworld<span class="token punctuation">]</span>$ tree helloworld-a/helloworld/
+helloworld-a/helloworld/
+├── configure.ac
+├── Makefile.am
+├── README
+└── src
+    ├── helloworld.c
+    └── Makefile.am
+
+<span class="token number">1</span> directory, <span class="token number">5</span> files
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li></ul></pre> 
+<ol start="7"><li>本地构建系统实例化和编译演示<br> 使用<code>autoreconf</code>命令执行此操作来实例化构建系统,我们首先在本地中验证下。如下所示:</li></ol> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">helloworld<span class="token punctuation">]</span>$ autoreconf --install
+configure.ac:3: installing <span class="token string">'./compile'</span>
+configure.ac:2: installing <span class="token string">'./install-sh'</span>
+configure.ac:2: installing <span class="token string">'./missing'</span>
+src/Makefile.am: installing <span class="token string">'./depcomp'</span>
+helloworld<span class="token punctuation">]</span>$ <span class="token function">ls</span>
+aclocal.m4      compile      configure     depcomp     Makefile.am  missing
+autom4te.cache  config.h.in  configure.ac  install-sh  Makefile.in  src
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li></ul></pre> 
+<p>此时构建系统已完成。除了上面命令输出中提到的三个脚本之外,还可以看到<code>autoreconf</code>还创建了四个其他文件:<code>configure</code>、<code>config.h.In</code>、<code>Makefile.In</code>和<code>src/Makefile.In</code>。后三个文件是模板,它们将通过在<code>config.h</code>、<code>Makefile</code>和<code>src/Makefile</code>下进行配置来适应系统。运行如下命令:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">helloworld<span class="token punctuation">]</span>$ ./configure 
+checking <span class="token keyword">for</span> a BSD-compatible install<span class="token punctuation">..</span>. /usr/bin/install -c
+checking whether build environment is sane<span class="token punctuation">..</span>. <span class="token function">yes</span>
+checking <span class="token keyword">for</span> a thread-safe <span class="token function">mkdir</span> -p<span class="token punctuation">..</span>. /bin/mkdir -p
+checking <span class="token keyword">for</span> gawk<span class="token punctuation">..</span>. <span class="token function">gawk</span>
+checking whether <span class="token function">make</span> sets <span class="token variable"><span class="token variable">$(</span>MAKE<span class="token variable">)</span></span><span class="token punctuation">..</span>. <span class="token function">yes</span>
+checking whether <span class="token function">make</span> supports nested variables<span class="token punctuation">..</span>. <span class="token function">yes</span>
+checking <span class="token keyword">for</span> gcc<span class="token punctuation">..</span>. gcc
+checking whether the C compiler works<span class="token punctuation">..</span>. <span class="token function">yes</span>
+checking <span class="token keyword">for</span> C compiler default output <span class="token function">file</span> name<span class="token punctuation">..</span>. a.out
+checking <span class="token keyword">for</span> suffix of executables<span class="token punctuation">..</span>. 
+checking whether we are cross compiling<span class="token punctuation">..</span>. no
+checking <span class="token keyword">for</span> suffix of object files<span class="token punctuation">..</span>. o
+checking whether we are using the GNU C compiler<span class="token punctuation">..</span>. <span class="token function">yes</span>
+checking whether gcc accepts -g<span class="token punctuation">..</span>. <span class="token function">yes</span>
+checking <span class="token keyword">for</span> gcc option to accept ISO C89<span class="token punctuation">..</span>. none needed
+checking whether gcc understands -c and -o together<span class="token punctuation">..</span>. <span class="token function">yes</span>
+checking <span class="token keyword">for</span> style of include used by make<span class="token punctuation">..</span>. GNU
+checking dependency style of gcc<span class="token punctuation">..</span>. gcc3
+checking that generated files are newer than configure<span class="token punctuation">..</span>. <span class="token keyword">done</span>
+configure: creating ./config.status
+config.status: creating Makefile
+config.status: creating src/Makefile
+config.status: creating config.h
+config.status: executing depfiles commands
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li><li style="color: rgb(153, 153, 153);">12</li><li style="color: rgb(153, 153, 153);">13</li><li style="color: rgb(153, 153, 153);">14</li><li style="color: rgb(153, 153, 153);">15</li><li style="color: rgb(153, 153, 153);">16</li><li style="color: rgb(153, 153, 153);">17</li><li style="color: rgb(153, 153, 153);">18</li><li style="color: rgb(153, 153, 153);">19</li><li style="color: rgb(153, 153, 153);">20</li><li style="color: rgb(153, 153, 153);">21</li><li style="color: rgb(153, 153, 153);">22</li><li style="color: rgb(153, 153, 153);">23</li><li style="color: rgb(153, 153, 153);">24</li><li style="color: rgb(153, 153, 153);">25</li></ul></pre> 
+<p>在<code>configure</code>运行之后,可以看到生成了<code>Makefile</code>、<code>src/Makefile</code>和<code>config.h</code>。现在我们可以调用make命令编译了:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">helloworld<span class="token punctuation">]</span>$ <span class="token function">make</span>
+<span class="token function">make</span>  all-recursive
+make<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span>: Entering directory <span class="token string">'/home/peeta/poky/meta-mylayer/recipes-helloworld/helloworld-a/helloworld'</span>
+Making all <span class="token keyword">in</span> src
+make<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span>: Entering directory <span class="token string">'/home/peeta/poky/meta-mylayer/recipes-helloworld/helloworld-a/helloworld/src'</span>
+gcc -DHAVE_CONFIG_H -I. -I<span class="token punctuation">..</span>     -g -O2 -MT helloworld.o -MD -MP -MF .deps/helloworld.Tpo -c -o helloworld.o helloworld.c
+<span class="token function">mv</span> -f .deps/helloworld.Tpo .deps/helloworld.Po
+gcc  -g -O2   -o helloworld helloworld.o  
+make<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span>: Leaving directory <span class="token string">'/home/peeta/poky/meta-mylayer/recipes-helloworld/helloworld-a/helloworld/src'</span>
+make<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span>: Entering directory <span class="token string">'/home/peeta/poky/meta-mylayer/recipes-helloworld/helloworld-a/helloworld'</span>
+make<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span>: Leaving directory <span class="token string">'/home/peeta/poky/meta-mylayer/recipes-helloworld/helloworld-a/helloworld'</span>
+make<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span>: Leaving directory <span class="token string">'/home/peeta/poky/meta-mylayer/recipes-helloworld/helloworld-a/helloworld'</span>
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li><li style="color: rgb(153, 153, 153);">12</li></ul></pre> 
+<ol start="8"><li>运行演示:</li></ol> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">helloworld<span class="token punctuation">]</span>$ ./src/helloworld 
+Hello World and Autotools
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li></ul></pre> 
+<ol start="9"><li>清理编译生成的文件:<br> 可以编译和运行后,最后就是清理和删除一些编译生成的文件:</li></ol> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">helloworld<span class="token punctuation">]</span>$ <span class="token function">make</span> distclean
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li></ul></pre> 
+<p>当然更绝做法的是:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">helloworld<span class="token punctuation">]</span>$ <span class="token function">rm</span> aclocal.m4 compile configure depcomp missing autom4te.cache config.h.in install-sh Makefile.in -rf
+helloworld<span class="token punctuation">]</span>$ <span class="token function">rm</span> src/Makefile.in 
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li></ul></pre> 
+<p>最后只保留一开始的5个文件。</p> 
+<ol start="10"><li>添加recipe的bb文件,如下:</li></ol> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">helloworld<span class="token punctuation">]</span>$ <span class="token builtin class-name">cd</span> <span class="token punctuation">..</span>/
+helloworld-a<span class="token punctuation">]</span>$ <span class="token function">cat</span> helloworld-a.bb 
+<span class="token comment"># helloworld application</span>
+SUMMARY <span class="token operator">=</span> <span class="token string">"helloworld of Autotools recipe"</span>
+DESCRIPTION <span class="token operator">=</span> <span class="token string">"My hello world application"</span>
+LICENSE <span class="token operator">=</span> <span class="token string">"CLOSED"</span>
+
+inherit autotools <span class="token comment">#继承了autotools, 这个是重点</span>
+
+FILESEXTRAPATHS_prepend :<span class="token operator">=</span> <span class="token string">"<span class="token variable">${THISDIR}</span>/:"</span>
+SRC_URI <span class="token operator">=</span> <span class="token string">"file://helloworld/"</span>
+
+S <span class="token operator">=</span> <span class="token string">"<span class="token variable">${WORKDIR}</span>/helloworld"</span>
+
+<span class="token comment">#CFLAGS_append = "-Wall -O -g"</span>
+
+FILES_<span class="token variable">${PN}</span> <span class="token operator">=</span> <span class="token string">"<span class="token variable">${bindir}</span>/"</span>
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li><li style="color: rgb(153, 153, 153);">12</li><li style="color: rgb(153, 153, 153);">13</li><li style="color: rgb(153, 153, 153);">14</li><li style="color: rgb(153, 153, 153);">15</li><li style="color: rgb(153, 153, 153);">16</li><li style="color: rgb(153, 153, 153);">17</li></ul></pre> 
+<p>上面是不是很简单,没有前面的bb文件中的一些变量和函数了,不用修改<code>do_make()</code>或<code>do_install()</code>等函数的原因都是因为继承了<code>autotools</code>,继承的这个<code>class</code>类做了<code>autotools</code>构建编译过程中的各项任务,0是不是很简单~</p> 
+<ol start="11"><li><code>bitbake</code>编译演示:</li></ol> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">poky<span class="token punctuation">]</span>$ <span class="token builtin class-name">source</span> oe-init-build-env 
+build<span class="token punctuation">]</span>$ bitbake helloworld-a
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li></ul></pre> 
+<ol start="12"><li>结果浏览:</li></ol> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">build<span class="token punctuation">]</span>$ <span class="token function">ls</span> tmp/work/core2-64-poky-linux/helloworld-a/1.0-r0/helloworld/
+aclocal.m4      compile       config.h.in  configure     depcomp     m4           Makefile.in  README
+autom4te.cache  config.guess  config.sub   configure.ac  install-sh  Makefile.am  missing      src
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li></ul></pre> 
+<p>上面可见bitbake的过程中已经自己执行了<code>autoreconf</code>命令,是不是很简单呢?</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">build<span class="token punctuation">]</span>$ <span class="token function">ls</span> tmp/work/core2-64-poky-linux/helloworld-a/1.0-r0/image/usr/bin/
+helloworlda
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li></ul></pre> 
+<p>文末再讲如何安装到文件系统中。使用<code>Autotools</code>工具构建的项目就完成了~</p> 
+<h2><a name="t5"></a><a id="CmakeCMakeListstxt_371"></a>由Cmake(CMakeLists.txt)构建的项目</h2> 
+<p>现在讲<code>Cmake</code>工具构建的项目,这个也是本专栏推荐的方式,后续的很多示例项目都是用CMake构建的,这方面的教程网上也有,大家感兴趣的也可以了解下~</p> 
+<ol><li>首先我们就是新建一个目录用来放这个<code>recipe</code>,目录名为<code>helloworld-c</code>:</li></ol> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">recipes-helloworld<span class="token punctuation">]</span>$ <span class="token function">mkdir</span> helloworld-c
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li></ul></pre> 
+<ol start="2"><li>将初始的<code>helloworld</code>项目复制到<code>helloworld-c</code>目录中:</li></ol> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">recipes-helloworld<span class="token punctuation">]</span>$ <span class="token function">cp</span> helloworld-m/helloworld helloworld-c/ -rf
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li></ul></pre> 
+<ol start="3"><li>增删<code>helloworld</code>项目目录结果:</li></ol> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">recipes-helloworld<span class="token punctuation">]</span>$ <span class="token builtin class-name">cd</span> helloworld-c/helloworld/
+helloworld<span class="token punctuation">]</span>$ <span class="token function">rm</span> Makefile
+helloworld<span class="token punctuation">]</span>$ <span class="token function">mkdir</span> src
+helloworld<span class="token punctuation">]</span>$ <span class="token function">mv</span> helloworld.c src/
+helloworld<span class="token punctuation">]</span>$ <span class="token function">vim</span> src/helloworld.c    
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li></ul></pre> 
+<pre class="prettyprint"><code class="prism language-c has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;"><span class="token macro property"><span class="token directive-hash">#</span><span class="token directive keyword">include</span> <span class="token string">&lt;stdio.h&gt;</span></span>
+
+<span class="token keyword">int</span> <span class="token function">main</span> <span class="token punctuation">(</span><span class="token keyword">int</span> argc<span class="token punctuation">,</span> <span class="token keyword">char</span> <span class="token operator">*</span><span class="token operator">*</span>argv<span class="token punctuation">)</span>
+<span class="token punctuation">{<!-- --></span>
+        <span class="token function">printf</span><span class="token punctuation">(</span><span class="token string">"Hello World and Cmake\n"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
+        <span class="token keyword">return</span> <span class="token number">0</span><span class="token punctuation">;</span>
+<span class="token punctuation">}</span> <span class="token comment">/* ----- End of main() ----- */</span>
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li></ul></pre> 
+<ol start="4"><li>改造<code>helloworld</code>项目为由<code>Cmake</code>构建:</li></ol> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">helloworld<span class="token punctuation">]</span>$ <span class="token function">vim</span> CMakeLists.txt   
+project<span class="token punctuation">(</span>helloworld C<span class="token punctuation">)</span>
+cmake_minimum_required<span class="token punctuation">(</span>VERSION <span class="token number">2.6</span>.3<span class="token punctuation">)</span>
+
+add_subdirectory<span class="token punctuation">(</span>src<span class="token punctuation">)</span>
+
+helloworld<span class="token punctuation">]</span>$ <span class="token function">cat</span> src/CMakeLists.txt 
+add_executable <span class="token punctuation">(</span>helloworldc helloworld.c<span class="token punctuation">)</span>
+
+install<span class="token punctuation">(</span>TARGETS helloworldc DESTINATION <span class="token variable">${CMAKE_INSTALL_PREFIX}</span>/bin<span class="token punctuation">)</span>
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li></ul></pre> 
+<ol start="5"><li>OK, 就添加了这两个文件,拓扑结构如下:</li></ol> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">helloworld<span class="token punctuation">]</span>$ tree <span class="token builtin class-name">.</span>
+<span class="token builtin class-name">.</span>
+├── CMakeLists.txt
+└── src
+    ├── CMakeLists.txt
+    └── helloworld.c
+
+<span class="token number">1</span> directory, <span class="token number">3</span> files
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li></ul></pre> 
+<ol start="6"><li>本地编译演示,确保<code>Cmake</code>构建的项目没问题:</li></ol> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">helloworld<span class="token punctuation">]</span>$ <span class="token function">mkdir</span> build
+helloworld<span class="token punctuation">]</span>$ <span class="token builtin class-name">cd</span> build/
+build<span class="token punctuation">]</span>$ cmake <span class="token punctuation">..</span>
+-- The C compiler identification is GNU <span class="token number">5.4</span>.0
+-- Check <span class="token keyword">for</span> working C compiler: /usr/bin/cc
+-- Check <span class="token keyword">for</span> working C compiler: /usr/bin/cc -- works
+-- Detecting C compiler ABI info
+-- Detecting C compiler ABI info - <span class="token keyword">done</span>
+-- Detecting C compile features
+-- Detecting C compile features - <span class="token keyword">done</span>
+-- Configuring <span class="token keyword">done</span>
+-- Generating <span class="token keyword">done</span>
+-- Build files have been written to: /home/peeta/poky/meta-mylayer/recipes-helloworld/helloworld-c/helloworld/build
+build<span class="token punctuation">]</span>$ <span class="token function">make</span>
+Scanning dependencies of target helloworldc
+<span class="token punctuation">[</span> <span class="token number">50</span>%<span class="token punctuation">]</span> Building C object src/CMakeFiles/helloworldc.dir/helloworld.c.o
+<span class="token punctuation">[</span><span class="token number">100</span>%<span class="token punctuation">]</span> Linking C executable helloworldc
+<span class="token punctuation">[</span><span class="token number">100</span>%<span class="token punctuation">]</span> Built target helloworldc
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li><li style="color: rgb(153, 153, 153);">12</li><li style="color: rgb(153, 153, 153);">13</li><li style="color: rgb(153, 153, 153);">14</li><li style="color: rgb(153, 153, 153);">15</li><li style="color: rgb(153, 153, 153);">16</li><li style="color: rgb(153, 153, 153);">17</li><li style="color: rgb(153, 153, 153);">18</li></ul></pre> 
+<ol start="7"><li>运行演示:</li></ol> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">build<span class="token punctuation">]</span>$ ./src/helloworldc 
+Hello World and Cmake
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li></ul></pre> 
+<ol start="8"><li>清理编译内容,删除<code>build</code>目录</li></ol> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">helloworld<span class="token punctuation">]</span>$ <span class="token function">rm</span> -rf build/
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li></ul></pre> 
+<ol start="9"><li>添加<code>recipe</code>的bb文件,如下:</li></ol> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">helloworld<span class="token punctuation">]</span>$ <span class="token builtin class-name">cd</span> <span class="token punctuation">..</span>
+helloworld-c<span class="token punctuation">]</span>$ <span class="token function">cat</span> helloworld-c.bb    
+<span class="token comment"># helloworld application</span>
+SUMMARY <span class="token operator">=</span> <span class="token string">"helloworld of Autotools recipe"</span>
+DESCRIPTION <span class="token operator">=</span> <span class="token string">"My hello world application"</span>
+LICENSE <span class="token operator">=</span> <span class="token string">"CLOSED"</span>
+
+inherit cmake <span class="token comment">#继承了这个</span>
+
+FILESEXTRAPATHS_prepend :<span class="token operator">=</span> <span class="token string">"<span class="token variable">${THISDIR}</span>/:"</span>
+SRC_URI <span class="token operator">=</span> <span class="token string">"file://helloworld/"</span>
+
+S <span class="token operator">=</span> <span class="token string">"<span class="token variable">${WORKDIR}</span>/helloworld"</span>
+
+<span class="token comment">#CFLAGS_append = "-Wall -O -g"</span>
+
+FILES_<span class="token variable">${PN}</span> <span class="token operator">=</span> <span class="token string">"<span class="token variable">${bindir}</span>/"</span>
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li><li style="color: rgb(153, 153, 153);">12</li><li style="color: rgb(153, 153, 153);">13</li><li style="color: rgb(153, 153, 153);">14</li><li style="color: rgb(153, 153, 153);">15</li><li style="color: rgb(153, 153, 153);">16</li><li style="color: rgb(153, 153, 153);">17</li></ul></pre> 
+<p>这个bb文件基本上和<code>Autotools</code>使用的bb文件类似,只是继承的<code>autotools</code>改成了<code>cmake</code>。</p> 
+<ol start="10"><li><code>bitbake</code>编译演示:</li></ol> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">build<span class="token punctuation">]</span>$ bitbake helloworld-c
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li></ul></pre> 
+<ol start="11"><li>结果浏览:</li></ol> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">build<span class="token punctuation">]</span>$ <span class="token function">ls</span> tmp/work/core2-64-poky-linux/helloworld-c/1.0-r0/image/usr/bin/
+helloworldc
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li></ul></pre> 
+<p>到这里,我们使用<code>Cmake</code>工具构建的项目就完成了~</p> 
+<h2><a name="t6"></a><a id="bb_499"></a>关于bb文件所处的位置问题</h2> 
+<p>从上面我们看到了三个bb文件的路径是这样的:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">meta-mylayer/recipes-helloworld/helloworld-a/helloworld-a.bb
+meta-mylayer/recipes-helloworld/helloworld-m/helloworld-m.bb
+meta-mylayer/recipes-helloworld/helloworld-c/helloworld-c.bb
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li></ul></pre> 
+<p>如果,自己做个测试将bb文件放在这个<code>meta-mylayer/recipes-helloworld/</code>目录下,再<code>bitbake</code>编译,会发现找不到对于的<code>recipe</code>。这是为啥呢?<br> 这个是由于<code>meta-mylayer/conf/layer.conf</code>配置文件中定义了bb文件搜索路径的结果,看下面:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">poky<span class="token punctuation">]</span>$ <span class="token function">cat</span> meta-mylayer/conf/layer.conf
+<span class="token punctuation">..</span>.
+<span class="token comment"># We have recipes-* directories, add to BBFILES</span>
+BBFILES <span class="token operator">+=</span> <span class="token string">"<span class="token variable">${LAYERDIR}</span>/recipes-*/*/*.bb \
+            <span class="token variable">${LAYERDIR}</span>/recipes-*/*/*.bbappend"</span>
+<span class="token punctuation">..</span>.
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li></ul></pre> 
+<p>即只在<code>meta-mylayer/recipes-helloworld/xxx/</code>目录下查找bb文件。</p> 
+<h2><a name="t7"></a><a id="_520"></a>安装执行程序到文件系统中</h2> 
+<p>我们看下这么个情况:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">poky<span class="token punctuation">]</span>$ <span class="token builtin class-name">source</span> oe-init-build-env
+build<span class="token punctuation">]</span>$ bitbake core-image-sato -c cleansstate
+build<span class="token punctuation">]</span>$ bitbake core-image-sato
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li></ul></pre> 
+<p>编译完成后,看下文件系统中是否有helloworld等程序:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">build<span class="token punctuation">]</span>$ <span class="token function">ls</span> tmp-qemux86-64/work/qemux86_64-poky-linux/core-image-sato/1.0-r0/rootfs/usr/bin/helloworld*
+ls: cannot access <span class="token string">'tmp-qemux86-64/work/qemux86_64-poky-linux/core-image-sato/1.0-r0/rootfs/usr/bin/helloworld*'</span><span class="token builtin class-name">:</span> No such <span class="token function">file</span> or directory
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li></ul></pre> 
+<p>没有helloworld等文件或者目录。</p> 
+<p>这个是什么原因?poky目录下有很多的recipes,并不是所有的recipes都会编译和安装,需要将需要的recipes和我们的目标(当前是core-image-sato 或者 core-image-minimal)关联起来,怎么关联呢?</p> 
+<h3><a name="t8"></a><a id="1_537"></a>关联的方法1</h3> 
+<p>第一个方法就是在<code>conf/local.conf</code>文件中添加这个关联关系:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">build<span class="token punctuation">]</span>$ <span class="token function">vim</span> conf/local.conf
+<span class="token punctuation">..</span>.
+IMAGE_INSTALL <span class="token operator">+=</span> <span class="token string">"helloworld-m"</span>
+IMAGE_INSTALL <span class="token operator">+=</span> <span class="token string">"helloworld-a"</span>
+IMAGE_INSTALL <span class="token operator">+=</span> <span class="token string">"helloworld-c"</span>
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li></ul></pre> 
+<p>但是我们知道,build目录是临时的目录,这是一种临时的做法。</p> 
+<h3><a name="t9"></a><a id="2_548"></a>关联的方法2</h3> 
+<p>添加一个目标的<code>bbappend</code>文件,例如我们的这个目标<code>core-image-sato</code>的bb文件是:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">meta/recipes-sato/images/core-image-sato.bb
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li></ul></pre> 
+<p>我需要做的只是在自己的<code>meta-mylayer</code>中创建相应的<code>recipe</code> <code>bbappend</code>文件,如下所示:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">meta-mylayer<span class="token punctuation">]</span>$ <span class="token function">mkdir</span> -p recipes-sato/images/
+meta-mylayer<span class="token punctuation">]</span>$ <span class="token function">vim</span> recipes-sato/images/core-image-sato.bbappend
+IMAGE_INSTALL <span class="token operator">+=</span> <span class="token string">"helloworld-m"</span>
+IMAGE_INSTALL <span class="token operator">+=</span> <span class="token string">"helloworld-a"</span>
+IMAGE_INSTALL <span class="token operator">+=</span> <span class="token string">"helloworld-c"</span>
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li></ul></pre> 
+<p>同时,我们将前面<code>conf/local.conf</code>文件中添加的三个语句删除掉,然后编译演示:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">poky<span class="token punctuation">]</span>$ <span class="token builtin class-name">source</span> oe-init-build-env
+build<span class="token punctuation">]</span>$ bitbake core-image-sato
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li></ul></pre> 
+<p>看下编译后的文件系统中是否有这个<code>helloworld</code>等文件:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">build<span class="token punctuation">]</span>$ <span class="token function">ls</span> tmp/work/qemux86_64-poky-linux/core-image-sato/1.0-r0/rootfs/usr/bin/helloworld*
+tmp/work/qemux86_64-poky-linux/core-image-sato/1.0-r0/rootfs/usr/bin/helloworld
+tmp/work/qemux86_64-poky-linux/core-image-sato/1.0-r0/rootfs/usr/bin/helloworlda
+tmp/work/qemux86_64-poky-linux/core-image-sato/1.0-r0/rootfs/usr/bin/helloworldc
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li></ul></pre> 
+<p>可见是有点,下面我们运行看看效果(在<code>Ubuntu</code>桌面的终端中执行):<br> <img src="./109129587_files/20210529154705904.png" alt="在这里插入图片描述"><br> 或者这样:</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">build<span class="token punctuation">]</span>$ ssh-keygen -f <span class="token string">"/home/peeta/.ssh/known_hosts"</span> -R <span class="token number">192.168</span>.7.2
+build<span class="token punctuation">]</span>$ <span class="token function">ssh</span> root@192.168.7.2
+root@qemux86-64:~<span class="token comment"># helloworld</span>
+Hello World<span class="token operator">!</span>
+root@qemux86-64:~<span class="token comment"># helloworlda</span>
+Hello World and Autotools
+root@qemux86-64:~<span class="token comment"># helloworldc</span>
+Hello World and Cmake
+root@qemux86-64:~<span class="token comment"># </span>
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li></ul></pre> 
+<p>结果展示都表明我们的<code>helloworld</code>程序都安装到文件系统中了。</p> 
+<h2><a name="t10"></a><a id="_593"></a>构建只有源码的项目</h2> 
+<p>这一节是后面加上的,有些项目特别特别简单,就行上面的例子一样就只单单只有一个源文件,然后还要费那么大的精力去写这些或者那些编译脚本,太麻烦了。这里将介绍如何在yocto中构建极少数源文件又不依赖编译脚本的项目来添加一个recipe。</p> 
+<p>1.首先创建一个<code>recipe</code>目录,取名<code>helloworld-o</code>吧,这里的o表示only source file的意思哈</p> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">recipes-helloworld<span class="token punctuation">]</span>$ <span class="token function">mkdir</span> helloworld-o
+recipes-helloworld<span class="token punctuation">]</span>$ <span class="token builtin class-name">cd</span> helloworld-o/
+helloworld-o<span class="token punctuation">]</span>$ <span class="token function">mkdir</span> files
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li></ul></pre> 
+<ol start="2"><li>复制一个源文件到该目录:</li></ol> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">helloworld-o<span class="token punctuation">]</span>$ <span class="token function">cp</span> <span class="token punctuation">..</span>/helloworld-m/helloworld/helloworld.c files/
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li></ul></pre> 
+<ol start="3"><li>写一个bb文件:</li></ol> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">SUMMARY <span class="token operator">=</span> <span class="token string">"Simple helloworld application"</span>
+SECTION <span class="token operator">=</span> <span class="token string">"examples"</span>
+LICENSE <span class="token operator">=</span> <span class="token string">"MIT"</span>
+LIC_FILES_CHKSUM <span class="token operator">=</span> <span class="token string">"file://<span class="token variable">${COMMON_LICENSE_DIR}</span>/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"</span>
+
+SRC_URI <span class="token operator">=</span> <span class="token string">"file://helloworld.c"</span>
+
+S <span class="token operator">=</span> <span class="token string">"<span class="token variable">${WORKDIR}</span>"</span>
+
+B <span class="token operator">=</span> <span class="token string">"<span class="token variable">${S}</span>"</span>
+
+<span class="token function-name function">do_compile</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
+        <span class="token variable">${CC}</span> <span class="token variable">${CFLAGS}</span> <span class="token variable">${LDFLAGS}</span> helloworld.c -o helloworld
+<span class="token punctuation">}</span>
+
+<span class="token function-name function">do_install</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
+        <span class="token function">install</span> -d <span class="token variable">${D}</span><span class="token variable">${bindir}</span>
+        <span class="token function">install</span> -m 0755 helloworld <span class="token variable">${D}</span><span class="token variable">${bindir}</span>
+<span class="token punctuation">}</span>
+
+FILES_<span class="token variable">${PN}</span> <span class="token operator">=</span> <span class="token string">"<span class="token variable">${bindir}</span>"</span>
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li><li style="color: rgb(153, 153, 153);">12</li><li style="color: rgb(153, 153, 153);">13</li><li style="color: rgb(153, 153, 153);">14</li><li style="color: rgb(153, 153, 153);">15</li><li style="color: rgb(153, 153, 153);">16</li><li style="color: rgb(153, 153, 153);">17</li><li style="color: rgb(153, 153, 153);">18</li><li style="color: rgb(153, 153, 153);">19</li><li style="color: rgb(153, 153, 153);">20</li><li style="color: rgb(153, 153, 153);">21</li></ul></pre> 
+<ol start="4"><li>bitbake编译演示,以及结果:</li></ol> 
+<pre class="prettyprint"><code class="prism language-bash has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">build<span class="token punctuation">]</span>$ bitbake helloworld-o
+build<span class="token punctuation">]</span>$ <span class="token function">ls</span> tmp/work/core2-64-poky-linux/helloworld-o/1.0-r0/image/usr/bin/helloworld 
+tmp-qemux86-64/work/core2-64-poky-linux/helloworld-o/1.0-r0/image/usr/bin/helloworld
+<div class="hljs-button {2}" data-title="复制(为作者贡献原力分)" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li></ul></pre> 
+<p>如果有任何问题,请在评论区留言。</p> 
+<p>End ~</p> 
+<p>更新时间2021052x</p> 
+<p><strong><font color="red">希望帮我点个赞加关注,你的喜欢就是我持续更新的动力!</font></strong></p>
+                </div><div><div></div></div>
+                <link href="./109129587_files/markdown_views-d7a94ec6ab.css" rel="stylesheet">
+                <link href="./109129587_files/style-49037e4d27.css" rel="stylesheet">
+        </div>
+        
+    </article>
+</div>
+
+
+
+
+
+                
+            
+            
+
+            
+            
+
+
+        </main>
+
+
+
+    </div>
+
+
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  </body></html>

BIN
html_index/content/005/109129587_files/20210529154705904.png


BIN
html_index/content/005/109129587_files/articleReadEyes.png


File diff suppressed because it is too large
+ 0 - 0
html_index/content/005/109129587_files/ck_htmledit_views-1a85854398.css


BIN
html_index/content/005/109129587_files/identityVip.png


File diff suppressed because it is too large
+ 0 - 0
html_index/content/005/109129587_files/markdown_views-d7a94ec6ab.css


BIN
html_index/content/005/109129587_files/original.png


File diff suppressed because it is too large
+ 0 - 0
html_index/content/005/109129587_files/style-49037e4d27.css


BIN
html_index/content/005/109129587_files/tobarCollect.png


BIN
html_index/content/005/109129587_files/tobarCollectionActive.png


+ 191 - 0
html_index/content/006/109035813.htm

@@ -0,0 +1,191 @@
+<!DOCTYPE html>
+<!-- saved from url=(0055)https://fulinux.blog.csdn.net/article/details/109035813 -->
+<html lang="zh-CN">
+  <body class="nodata " style="">
+        
+    
+    
+
+
+<div class="main_father clearfix d-flex justify-content-center" style="height:100%;"> 
+    <div class="container clearfix" id="mainBox">
+        <main>
+
+<div class="blog-content-box">
+        <div class="article-header-box">
+        <div class="article-header">
+            <div class="article-title-box">
+                <h1 class="title-article" id="articleContentId">yocto-第6篇-yocto是什么</h1>
+            </div>
+            <div class="article-info-box">
+                <div class="article-bar-top">
+                    <img class="article-type-img" src="./109035813_files/original.png" alt="">
+                    <div class="bar-content">
+                        <img class="article-vip-img article-heard-img" src="./109035813_files/identityVip.png" alt="">
+                        <span class="article-vip-text vip_article"> VIP文章</span>
+                    <a class="follow-nickName " href="https://fulinux.blog.csdn.net/" target="_blank" rel="noopener">fulinux</a>
+                    <span class="time">2020-10-12 20:17:55</span>
+                    <img class="article-read-img article-heard-img" src="./109035813_files/articleReadEyes.png" alt="">
+                    <span class="read-count">2024</span>
+                    <a id="blog_detail_zk_collection" class="un-collection" data-report-click="{&quot;mod&quot;:&quot;popu_823&quot;,&quot;spm&quot;:&quot;1001.2101.3001.4232&quot;,&quot;ab&quot;:&quot;new&quot;}">
+                        <img class="article-collect-img article-heard-img un-collect-status isdefault" style="display:inline-block" src="./109035813_files/tobarCollect.png" alt="">
+                        <img class="article-collect-img article-heard-img collect-status isactive" style="display:none" src="./109035813_files/tobarCollectionActive.png" alt="">
+                        <span class="name">收藏</span>
+                        <span class="get-collection">
+                            6
+                        </span>
+                    </a>
+                    </div>
+                </div>
+                <div class="blog-tags-box">
+                    <div class="tags-box artic-tag-box">
+                            <span class="label">分类专栏:</span>
+                                <a class="tag-link" href="https://blog.csdn.net/sonbai/category_10445379.html" target="_blank" rel="noopener">Yocto开发篇</a>
+                            <span class="label">文章标签:</span>
+                                <a data-report-click="{&quot;mod&quot;:&quot;popu_626&quot;,&quot;spm&quot;:&quot;1001.2101.3001.4223&quot;,&quot;strategy&quot;:&quot;yocto&quot;,&quot;ab&quot;:&quot;new&quot;}" class="tag-link" href="https://so.csdn.net/so/search/s.do?q=yocto&amp;t=blog&amp;o=vip&amp;s=&amp;l=&amp;f=&amp;viparticle=" target="_blank" rel="noopener">yocto</a>
+                                <a data-report-click="{&quot;mod&quot;:&quot;popu_626&quot;,&quot;spm&quot;:&quot;1001.2101.3001.4223&quot;,&quot;strategy&quot;:&quot;poky&quot;,&quot;ab&quot;:&quot;new&quot;}" class="tag-link" href="https://so.csdn.net/so/search/s.do?q=poky&amp;t=blog&amp;o=vip&amp;s=&amp;l=&amp;f=&amp;viparticle=" target="_blank" rel="noopener">poky</a>
+                                <a data-report-click="{&quot;mod&quot;:&quot;popu_626&quot;,&quot;spm&quot;:&quot;1001.2101.3001.4223&quot;,&quot;strategy&quot;:&quot;openembedded&quot;,&quot;ab&quot;:&quot;new&quot;}" class="tag-link" href="https://so.csdn.net/so/search/s.do?q=openembedded&amp;t=blog&amp;o=vip&amp;s=&amp;l=&amp;f=&amp;viparticle=" target="_blank" rel="noopener">openembedded</a>
+                    </div>
+                </div>
+                <div class="slide-content-box">
+                    <div class="article-copyright">
+                        <div class="creativecommons">
+                            版权声明:本文为博主原创文章,遵循<a href="http://creativecommons.org/licenses/by-sa/4.0/" target="_blank" rel="noopener"> CC 4.0 BY-SA </a>版权协议,转载请附上原文出处链接和本声明。
+                        </div>
+                        <div class="article-source-link">
+                            本文链接:<a href="https://blog.csdn.net/fulinus/article/details/109035813" target="_blank">https://blog.csdn.net/fulinus/article/details/109035813</a>
+                        </div>
+                    </div>
+                </div>
+                <div class="operating">
+                    <a class="href-article-edit slide-toggle">版权</a>
+                </div>
+            </div>
+        </div>
+    </div>
+    <article class="baidu_pl">
+        <div id="article_content" class="article_content clearfix">
+        <link rel="stylesheet" href="./109035813_files/ck_htmledit_views-1a85854398.css">
+                <div id="content_views" class="markdown_views prism-atom-one-light">
+                    <svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
+                        <path stroke-linecap="round" d="M5,0 0,2.5 5,5z" id="raphael-marker-block" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></path>
+                    </svg>
+                    <blockquote> 
+ <p>By: fulinux<br> E-mail: fulinux@sina.com<br> Blog: https://blog.csdn.net/fulinus<br> 喜欢的盆友欢迎点赞和订阅!<br> 你的喜欢就是我写作的动力!</p> 
+</blockquote> 
+<p></p>
+<div class="toc">
+ <h3><a name="t0"></a>目录</h3>
+ <ul><li><ul><li><a href="https://fulinux.blog.csdn.net/article/details/109035813#yocto_10" target="_self">什么是yocto</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/109035813#_17" target="_self">注意事项</a></li><li><a href="https://fulinux.blog.csdn.net/article/details/109035813#Yocto_36" target="_self">为什么将Yocto项目用于我的物联网项目呢</a></li></ul>
+ </li></ul>
+</div>
+<p></p> 
+<p><strong>返回总目录</strong>:<a href="https://fulinux.blog.csdn.net/article/details/116208803">Yocto开发讲解系列 - 总目录</a></p> 
+<h2><a name="t1"></a><a id="yocto_10"></a>什么是yocto</h2> 
+<p>看一点理论性的内容~</p> 
+<p><code>Yocto</code>项目是一个<code>开源协作项目</code>,可帮助开发人员创建针对<code>嵌入式产品</code>设计的基于<code>Linux</code>的定制系统,而与产品的硬件体系结构无关。<code>Yocto Project</code>提供了灵活的<code>工具集</code>和<code>开发环境</code>,使全世界的嵌入式设备开发人员可以通过<code>共享的技术</code>,<code>软件堆栈</code>,<code>配置</code>和用于创建这些定制Linux映像的最佳实践进行协作。</p> 
+<p>全球成千上万的开发人员发现,Yocto Project在系统和应用程序开发,归档和管理优势以及运行速度,占用空间和内存利用率的自定义项方面均具有优势。该项目是交付嵌入式<code>软件堆栈</code>的标准。该项目允许软件定制和为多个硬件平台以及可维护和扩展的软件堆栈建立互换。<br> <img src="./109035813_files/20201012201442422.png" alt="在这里插入图片描述"></p> 
+<h2><a name="t2"></a><a id="_17"></a>注意事项</h2> 
+<ol><li>尽可能使用git来获取yocto的源码,以免后面有版本更新或者修复重大的bug补丁更新带来的麻烦</li><li>有些项目可能已经有自己的layer了,没有必要自己闭门造车,可以拿来自己用。到https://layers.openembedded.org这里去找找有没有你需要的layer.</li><li>根据自己的半导体厂商找到已有的BSP layers。像Intel、TI、 NXP和其他一些公司都有自己的BSPlayers,比如meta-intel、meta-ti、meta-freescale等. 需要不断的试错,这些layer也行不是你需要的,但是可以作为你的参考和模板.</li><li>不要把所有的内容都放在一个layer中:根据不同的情况和逻辑划分出相互独立的layer, 比如BPS、 GUI、中间件、应用软件等创建各自的layer, 对今后的定制和重复利用很有帮助。</li><li>不要去修改poky目录下默认存在的layers,因为当你更新到新版本的时候,可能丢失你的所有工作,最好是在自己的layer中做修改.</li><li>熟悉构建一个目标的工作流程,对于你再遇到困难的时候能知道问题出在那个环节中很有帮助。目前的流程有这些:<br> 1) Fetch - 获取源代码;<br> 2) Extract - 解压、展开源码包等;<br> 3) Patch - 打补丁或者添加新功能;<br> 4) Configure - 配置编译环境;<br> 5) Build - 编译链接;<br> 6) Install - 复制文件到目标目录中;<br> 7) Package - 打包文件用于安装;<br> 比如,当Fetch环境出问题的时候,可能就是源代码的连接失效了,Extract环节出问题的时候,可能就是压缩包出错了,无法解压。<br> 参考下图:<br> <img src="./109035813_files/20210610195339165.png" alt="在这里插入图片描述"></li></ol> 
+<h2><a name="t3"></a><a id="Yocto_36"></a>为什么将Yocto项目用于我的物联网项目呢</h2> 
+<p>下面的文章挺好,大家可以参考着阅读了解下:<br> 嵌入式和物联网(IoT)空间中的软件开发人员在选择操作系统(OS)来支持其设计时面临众多令人眼花array乱的选择。有关硬件和工具的决策显然将对项目的成功产生重大影响。假设您可以灵活地选择最适合您的设计的组件,并且不受历史决定或向后兼容性的限制,那么您有必要投资前期研究以了解选项并为您的项目做出最佳选择和设计团队。</p> 
+<p>当您的系统重点主要是具有简单控制逻辑的机电时,Linux设计可能会显得过时,而使用RTOS或控制循环可能更合适。当系统的重点更多地放在数据处理和网络上时,在您的设计中考虑使用Linux可能是有意义的。如果您的系统兼有这两种元素,那么您肯定可以在Linux中实现机电方面的功能,因为与大多数其他系统相比,Linux内核可以为更广泛的外围设备提供设备支持。更复杂的系统可能需要使用多核芯片组或多个芯片上的异步多处理功能来建立双OS。</p> 
+<p>在您的设计中使用Linux的一个令人信服的理由是它的普遍性。书籍,视频和其他培训材料很容易获得,而找到一个描述与您的设计相似的用例的博客或会议演示文稿仅需进行网络搜索。诸如stackoverflow.com和quora.com之类的资源中充满了有趣,及时的信息,可以在您的教育和设计周期中提供帮助。此外,还提供了edx.org,coursera.org和udacity.com等供应商的在线课程(许多免费),涵盖了与Linux相关的各种主题。</p> 
+<p>在Linux系统上运行的可用软件数量惊人。对于依赖外部定义的协议,API等的设计中的任何部分,您都可能会找到在Linux上运行的实现。对于许多此类软件组件,您将找到一个充满活力的开发人员社区,其中提供了错误修复,支持和功能开发。通常,将这些位集成到Linux设计中很简单,但是根据您选择的发行版或构建系统而有所不同。幸运的是,通用的分发和构建系统还具有活跃的社区,可以为默认情况下未集成的项目提供帮助。</p> 
+<p>也不乏具有Linux专业知识的有才华的开发人员。由于行业广泛采用基于Linux的设计,因此寻找具有相关经验的工程师相对容易。从招聘团队的角度来看,找到已经接受过所需技术培训的工程师是一个明显的优势。从工程师的角度来看,开发您认为有趣的技术并能够将您的专业知识应用于多个潜在雇主是一个很大的好处。简而言之,Linux和相关技术极大地简化了与人才匹配的招聘需求。</p> 
+<p>您可以使用各种各样的发行和构建系统来开发嵌入式Linux系统。可以缩减许多桌面发行版,以在有限的资源环境中使用,并且像Ubuntu这样的系统具有专门针对IoT设备的品种。Raspberry Pi平台使用定制的Debian映像作为其主要目标OS映像。另外,有几种选择可以交叉编译一个完整的Linux系统。Yocto,OpenWRT和Buildroot是最常见的三个。这些系统通常托管在标准桌面Linux发行版上,并将为您选择的目标设备交叉构建Linux系统。所需的更改将首先内置到Linux桌面上的目标映像中,然后从那里部署到目标安装介质。</p> 
+<p>在下面的讨论中,我们将更详细地描述Yocto项目,并解释为什么我们认为它是用于IoT的嵌入式Linux设计的理想选择。</p> 
+<p>嵌入式注意事项<br> 嵌入式Linux的开发模糊了嵌入式和桌面开发之间的界线,可以提供这两种模型中的精华。许多嵌入式Linux系统承载SSH服务器,GUI和目标工具等功能,从而允许类似于传统桌面开发的开发工作流程。可以在部署的系统中直接修改用脚本语言编写的代码,并测试更改,而无需花费昂贵的构建/部署周期。对于已编译的代码,许多此类系统的计算能力受到限制,并且按目标构建可能会非常缓慢。使用交叉编译环境执行此类任务的速度明显更快,并且感觉更像传统的嵌入式开发,为开发人员提供了开发主机OS上可用的所有工具和功能。</p> 
+<p>众所周知,设置交叉编译环境很棘手。正确组合工具链组件和库可能会让人沮丧。将内核标头与桌面分发内核和嵌入式内核都匹配可能是一个挑战。获取预构建的跨工具链有多种选择。如果幸运的话,桌面开发系统上的程序包管理器可能提供了一种。如果发行商提供的软件包对您不起作用,则可能需要使用诸如crosstool-NG之类的构建系统。</p> 
+<p>开发人员与嵌入式目标板的连接通常是通过串行端口和以太网。幸运的是,嵌入式Linux对这些设备提供了广泛的支持,通常不会对您的设计团队造成任何障碍。Windows和MacOS主机系统中的驱动程序支持可能会出现问题,因为这些设备驱动程序可能未包含在默认操作系统中,并且可能需要安装第三方驱动程序。</p> 
+<p>对JTAG的支持在嵌入式Linux中有些分散,对低级内核调试非常有用。此外,它高度依赖于半导体制造商以及JTAG设备制造商的供应商支持。通常,使用广泛使用和移植的工具(例如GDB)可以更好地完成应用程序和用户空间代码的调试。</p> 
+<p>嵌入式和物联网领域的项目使用各种各样的芯片架构和电路板。Linux内核已移植到绝大多数市售部件上,并且很可能已经支持您选择的芯片组。大多数半导体供应商直接开发内核代码和驱动程序来支持其产品,从而使在设计中轻松采用Linux成为可能。但是,并不是所有供应商的贡献都可以从kernel.org的库存内核中获得,因此您可能需要进行一些研究和集成工作,以收集所选平台所需的所有软件组件。</p> 
+<p>Yocto计划说明<br> 的Yocto计划将自己定义为“一个开源协作项目您创建无论硬件架构的嵌入式产品定制的基于Linux的系统提供的模板,工具和方法来帮助。” 它大致类似于桌面Linux发行版的概念;但是,这有点过分简化了。Yocto更恰当地称为元分布。它是配方,配置值和依赖项的集合,用于创建针对您的特定需求的定制Linux运行时映像。</p> 
+<p>Yocto项目着重于机制,使开发人员可以自由地根据您的设计强加政策。在桌面发行版将选择诸如打包格式和初始化 系统之类的选项的地方,Yocto提供了配置点,使您可以根据需要选择这些点。默认情况下,用户可以选择deb,rpm,ipk或tar 软件包格式;或通过添加自定义bbclass 文件轻松添加一个新文件。同样,选择sysvinit 或system init系统是对本地构建文件的简单配置更改。</p> 
+<p>Yocto构建通过构建构建系统本身所需的许多本机实用程序开始。这样做是为了最大程度地减少对主机OS的依赖性,并确保有一组已知的软件包版本。然后,大多数配置将继续构建经过测试的已知良好的交叉编译环境,然后再继续构建目标平台的二进制文件。由于为Yocto配置构建了许多软件包,因此这会在主机系统上消耗大量资源和时间。</p> 
+<p>程序包定义包括各个阶段(例如,获取,编译,安装,打包),并且必须指定任何运行时或构建时依赖项。该构建由称为bitbake的主管控制,该主管负责处理依赖关系和安排任务。任务将在主机系统资源和任务之间的相互依赖关系允许的范围内并行执行。此外,使用共享状态机制维护每个构建阶段的中间输出,以允许在相似的构建中重复使用,这可以显着提高速度。</p> 
+<p>Yocto的优点:功能<br> Yocto注重于机制而非策略,这为系统开发人员提供了更大的自由度。这种方法可确保您可以根据设计需求自由设置策略,而不必适应系统软件提供商强制执行的决策。Yocto提供了明智的默认设置,以允许开发人员快速入门,但是更改这些策略的机制已被详细记录且易于采用。</p> 
+<p>该Yocto层基础设施是Yocto模型的一个组成部分。层将与功能相关的功能分成单独的捆绑包,仅可根据需要将其添加到构建设置中。这大大降低了每个单独层的复杂性,并使它们可以按照自己的进度进行开发。图层按优先级顺序包含在构建中,从而允许较高优先级的图层覆盖和修改基础图层中的设置。</p> 
+<p>平台层通常支持向Yocto添加板;它们通常将包含自定义内核和引导加载程序组件,以及任何特定于板的运行时软件包和配置。下表显示了许多半导体行业重量级人物提供的平台层。这些层为广泛的市场上可买到的芯片和电路板提供了支持,应该用作包含这些部件中任何一个的任何设计的起点。</p> 
+<p>https://layers.openembedded.org/layerindex/branch/master/layer/meta-qcom/<br> https://layers.openembedded.org/layerindex/branch/master/layer/meta-ti/<br> https://layers.openembedded.org/layerindex/branch/master/layer/meta-freescale/<br> https://layers.openembedded.org/layerindex/branch/master/layer/meta-amd/<br> 特征层添加的功能通常对所有Yocto用户而言都不有价值,但是被认为过于复杂而无法包含在基础层中。以下列表显示了当今可用的某些要素图层。</p> 
+<p>https://layers.openembedded.org/layerindex/branch/master/layer/meta-mender-core/<br> https://layers.openembedded.org/layerindex/branch/master/layer/meta-qt5/<br> https://layers.openembedded.org/layerindex/branch/master/layer/meta-nodejs/<br> https://layers.openembedded.org/layerindex/branch/master/layer/meta-snappy/<br> 在传统的桌面Linux分发模型中,通常是从CD或USB密钥安装,然后在正在运行的目标系统中执行其他软件包安装和配置。Yocto工作流程有所不同;它包括在开发机器上运行完整版本,其输出是包含整个目标系统的映像。稍加注意,您就可以消除正在运行的目标中所需的大多数(如果不是全部)配置步骤,从而可以更可预测地加载软件并减少测试矩阵中的维数。Yocto甚至可以将运行时软件配置为使用只读的根文件系统,从而使系统始终从已知良好的状态启动。当然,这需要您自己确保状态正确保存到持久数据存储中。</p> 
+<p>此外,Yocto项目遵循严格的发布时间表。这种可预测性对于基于Yocto的项目至关重要,并允许开发团队计划其活动。开发人员可以根据自己的需要选择活动的基础Yocto分支。开发分支将确保访问最新功能,而稳定分支将减少更改的速度,同时仍允许进行更新以解决CVE(常见漏洞和披露)问题和其他潜在的安全隐患。</p> 
+<p>Yocto的优势:行业和社区的支持<br> Yocto Project网站对Yocto周围的生态系统有以下说法:</p> 
+<p>对于开源项目,没有什么比它周围的个人和组织的生态系统重要。”</p> 
+<p>这很容易是Yocto的主要优势之一。不能充分强调社区的价值;支持论坛和专业知识随时可用,活跃的开发社区也在推动Yocto向前发展。作为一个开源项目,您可以根据自己的需要对其进行修改,或者找人为您完成;无需担心软件供应商会改变策略并让您重新开始。</p> 
+<p>Yocto在行业中也被广泛采用。除半导体供应商外,还有许多供应商提供商业支持的Yocto软件和服务。Yocto项目参与者页面显示了使用Yocto的各种行业参与者。此外,GENIVI Alliance和Automotive Grade Linux等行业计划还有助于将Yocto推向汽车行业。</p> 
+<p>Yocto的优势:工具和SDK<br> 如上所述,获得适当支持的跨工具链可能需要大量的精力。Yocto项目包括在项目构建过程中构建功能齐全的工具链的配方。Yocto社区已经在各种体系结构和平台上对该工具链进行了测试,该工具链在大多数情况下足以支持您的项目。如果需要,可以使用标准Yocto配方机制轻松定制此工具链。此外,如果您的目标芯片支持默认工具链中未启用的功能(例如,自定义指令或优化),则在平台层中只需添加特定于平台的调整参数即可。最后,如果您需要使用第三方提供的预构建工具链,则Yocto内置了一些机制来允许这种情况。</p> 
+<p>Yocto还可以将平台所需的工具和库捆绑到SDK中,以交付给应用程序开发人员。这比要求此类开发人员运行完整的Yocto系统构建要简单,并允许优化的应用程序开发工作流程,同时确保这些开发人员具有工作所需的所有组件的正确版本。</p> 
+<p>Yocto的缺点Yocto的<br> 学习曲线相当陡峭。仅术语本身就令人生畏(例如,Yocto,Poky和OpenEmbedded之间有什么区别?)。用于配置目标的选项数量众多,因此难以评估最佳选择。通过遵循简单的Web搜索中可用的任何教程,可以快速实现基本系统的启动和运行。但是,了解需要对您的特定设计进行哪些更改可能需要大量的研究和调查。可以肯定的是,存在复杂性的正当理由,我们认为上面讨论的优点值得付出努力。一旦完成了初始准备工作,进一步的设计工作将更快地进行。</p> 
+<p>对于习惯了传统台式机和服务器软件开发的开发人员,Yocto工作流程可能会造成混乱。在桌面开发环境中,主机OS提供程序通常提供一种安装新软件包的机制。例如,在Ubuntu中,可以使用apt-get 命令轻松安装新软件包。可通过可通过Internet连接访问的服务器中的预编译二进制文件中提供的软件包。在Yocto中,您将需要修改配置并重建以添加其他软件包。通常没有互联网托管的软件包库可供提取。</p> 
+<p>在跨构建环境中工作可能会感到陌生,并且要求开发人员同时了解主机和目标系统。能够在目标系统中开发代码,进行编译(或仅在脚本环境中运行)和快速测试,比运行bitbake 构建并将新映像部署到目标中要快。需要明确的是,Yocto确实支持目标开发工具来支持这种工作流程。但是,一旦开发并调试了所需的代码,则还需要执行其他步骤才能将这些更改重新集成到Yocto构建环境中。一种中间方法是在Yocto环境中进行更改,然后仅部署更新的软件包。Yocto构建系统以标准格式(rpm,deb,ipk或tar),可以使用目标上的实用程序(例如rpm 或ipk)将其安装到正在运行的系统中。这些方法可以很好地在生命周期的早期优化开发周期。但是,随着产品发布的临近​​,您通常希望最小化或消除测试映像和生产映像之间的差异-在正在运行的系统上手动安装软件包或修改代码可以有效地创建自定义映像。</p> 
+<p>最后,完整的Yocto构建的构建时间可能很长。通常,由于需要为功能齐全的Linux系统构建大量软件包,因此这是不可避免的。但是,可以通过Yocto共享状态机制大大减轻这种情况。</p> 
+<p>IoT特定需求<br> Yocto项目是IoT项目的绝佳选择。上面讨论的所有优势对于物联网领域的设计都是有效的。肖恩·哈德森指出:</p> 
+<p>我们向客户推荐Yocto项目,这是我们自己的Mentor嵌入式Linux(MEL)的基础,因为它具有灵活性,广泛的行业支持,庞大的社区以及对长期维护的支持。对于物联网(IoT),支持多种架构,多种设备配置以及目标软件组合的需求使其非常适合为IoT设备创建Linux基础。</p> 
+<p>肖恩·哈德森(Sean Hudson),西门子商务Yocto项目顾问委员会<br> 技术人员和嵌入式Linux架构师<br> 导师<br> 创始成员<br> 当前OpenEmbedded董事会成员</p> 
+<p>维基百科将物联网定义为:</p> 
+<p>物理设备,车辆(也称为“连接的设备”和“智能设备”),建筑物以及其他嵌入了电子,软件,传感器,执行器和网络连接的物品的互连网络,使这些对象可以收集和交换数据。</p> 
+<p>从广义上讲,有两种类型的IoT设备:托管传感器或执行器的小型系统,以及IoT网关,网络连接存储(NAS)盒,家庭自动化路由器等大型系统。它们中的许多运行不能轻松支持Linux的8位或16位微控制器。对于较大的设备,通常是Linux,尤其是Yocto是一个很好的选择。这些类型的设备越来越多地使用易于获得的消费类硬件设备(例如Raspberry Pi或BeagleBone)进行原型设计(有时是实现)。Yocto项目为这些(以及许多其他类似)板提供了出色的支持,并且是快速开始您的IoT项目的绝佳方法。</p> 
+<p>许多连接的设备作为大量设备进行部署和管理。在这些情况下,上述软件内容的可预测性是一个主要优点。手动更新设备会占用大量资源,并且容易出错,拥有设备及其软件内容的确定清单是确保车队安全的第一步。如果已部署的设备可以对其软件进行重大修改,则可能很难确定要进行哪些更新。</p> 
+<p>物联网系统倾向于使用台式机Linux发行版中不一定广泛使用的软件,库和协议。可以使用标准Yocto层将许多常见的软件包(例如MQTT和AMQP)轻松添加到您的Yocto构建中:</p> 
+<p>MQTT: http : //cgit.openembedded.org/meta-openembedded/tree/meta-python/recipes-devtools/python/python-paho-mqtt_1.2.bb<br> AMQP: http ://cgit.openembedded.org/meta-openembedded/tree/meta-oe/recipes-connectivity/rabbitmq-c/rabbitmq-c_0.7.0.bb<br> 此外,Yocto使用功能层直接支持诸如IoTivity之类的行业计划:</p> 
+<p>https://layers.openembedded.org/layerindex/branch/master/layer/meta-oic/<br> 结束语<br> 对于Linux发行版和构建系统,开发人员有多种不错的选择。Yocto项目是大多数嵌入式项目的可靠选择,并且是一个很好的起点。本文概述的Yocto构建系统的好处是其在嵌入式软件行业中得到如此广泛使用的原因之一。物联网领域的产品开发正以惊人的速度进行,其中许多设备的功能集都受益于Linux实施。Yocto的各种功能,可扩展性以及对目标图像内容的细粒度控制使其非常适合这些空间中的项目,并且在您开始设计时当然值得进行一些研究。</p> 
+<p>Drew Moseley 当前是Mender.io开源项目的一部分,该项目旨在将OTA软件更新部署到嵌入式Linux设备上。他在佛罗里达州坦帕长大,并就读于佛罗里达大学。Drew在英特尔,摩托罗拉,红帽,Monta Vista,Mentor Graphics以及最近的Mender.io从事嵌入式软件和开发工具方面的职业生涯。在过去的10年中,他从事嵌入式Linux的工作,而在过去的6年中,他专注于Yocto。德鲁(Drew)是退休的击剑运动员,击剑教练和裁判。在业余时间,他喜欢从事电子项目,最大限度地减少生活,并在佛罗里达的阳光下度过。<br> 来源:<a href="https://blog.csdn.net/u013921164/article/details/110919329">https://blog.csdn.net/u013921164/article/details/110919329</a></p>
+                </div><div><div></div></div>
+                <link href="./109035813_files/markdown_views-d7a94ec6ab.css" rel="stylesheet">
+                <link href="./109035813_files/style-49037e4d27.css" rel="stylesheet">
+        </div>
+        <div id="treeSkill"></div>
+    </article>
+</div>
+
+
+
+
+
+                
+            
+            
+
+            
+            
+
+
+        </main>
+
+
+
+    </div>
+
+
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  </body></html>

BIN
html_index/content/006/109035813_files/20201012201442422.png


BIN
html_index/content/006/109035813_files/20210610195339165.png


BIN
html_index/content/006/109035813_files/articleReadEyes.png


File diff suppressed because it is too large
+ 0 - 0
html_index/content/006/109035813_files/ck_htmledit_views-1a85854398.css


BIN
html_index/content/006/109035813_files/identityVip.png


File diff suppressed because it is too large
+ 0 - 0
html_index/content/006/109035813_files/markdown_views-d7a94ec6ab.css


BIN
html_index/content/006/109035813_files/original.png


File diff suppressed because it is too large
+ 0 - 0
html_index/content/006/109035813_files/style-49037e4d27.css


BIN
html_index/content/006/109035813_files/tobarCollect.png


BIN
html_index/content/006/109035813_files/tobarCollectionActive.png


File diff suppressed because it is too large
+ 140 - 0
html_index/content/007/109133346.htm


BIN
html_index/content/007/109133346_files/20201017153814514.png


BIN
html_index/content/007/109133346_files/articleReadEyes.png


File diff suppressed because it is too large
+ 0 - 0
html_index/content/007/109133346_files/ck_htmledit_views-1a85854398.css


BIN
html_index/content/007/109133346_files/identityVip.png


File diff suppressed because it is too large
+ 0 - 0
html_index/content/007/109133346_files/markdown_views-d7a94ec6ab.css


Some files were not shown because too many files changed in this diff