Files
luban-lite-t3e-pro/doc/topics/sdk/advanced/lb_usage_commands.html

288 lines
25 KiB
HTML
Raw Normal View History

2025-01-23 16:37:00 +08:00
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-cn" lang="zh-cn" data-whc_version="26.0">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="DC.rights.owner" content="(C) 版权 2025"/><meta name="copyright" content="(C) 版权 2025"/><meta name="generator" content="DITA-OT"/><meta name="DC.type" content="concept"/><meta name="description" content="常规命令 make board _defconfig make all - 项目查看make list --&gt; 列出当前可用的项目配置 - 配置make d211_demo128_nand_defconfig --&gt; 应用项目配置保存目录target/configs - 编译make --&gt; 编译,自动进行修改检测,增量编译 - 清除make clean --&gt; 清除编译生成内容 - ..."/><meta name="DC.creator" content="yan.wang"/><meta name="DC.date.created" content="2024-10-31"/><meta name="DC.date.modified" content="2024-12-05"/><meta name="DC.format" content="HTML5"/><meta name="DC.identifier" content="lb-usage-commands"/><meta name="DC.language" content="zh-CN"/>
<title>命令详解</title><!-- Build number 2023110923. --><meta name="wh-path2root" content="../../../"/><meta name="wh-toc-id" content=""/><meta name="wh-source-relpath" content="topics/sdk/advanced/lb_usage_commands.dita"/><meta name="wh-out-relpath" content="topics/sdk/advanced/lb_usage_commands.html"/>
<link rel="stylesheet" type="text/css" href="../../../webhelp/app/commons.css?buildId=2023110923"/>
<link rel="stylesheet" type="text/css" href="../../../webhelp/app/topic.css?buildId=2023110923"/>
<script src="../../../webhelp/app/options/properties.js?buildId=20250121171154"></script>
<script src="../../../webhelp/app/localization/strings.js?buildId=2023110923"></script>
<script src="../../../webhelp/app/search/index/keywords.js?buildId=20250121171154"></script>
<script defer="defer" src="../../../webhelp/app/commons.js?buildId=2023110923"></script>
<script defer="defer" src="../../../webhelp/app/topic.js?buildId=2023110923"></script>
<link rel="stylesheet" type="text/css" href="../../../webhelp/template/aic-styles-web.css?buildId=2023110923"/><link rel="stylesheet" type="text/css" href="../../../webhelp/template/notes.css?buildId=2023110923"/><link rel="stylesheet" type="text/css" href="../../../webhelp/template/aic-common.css?buildId=2023110923"/><link rel="stylesheet" type="text/css" href="../../../webhelp/template/aic-images.css?buildId=2023110923"/><link rel="stylesheet" type="text/css" href="../../../webhelp/template/footnote.css?buildId=2023110923"/><link rel="stylesheet" type="text/css" href="../../../webhelp/template/aic-web-watermark.css?buildId=2023110923"/><link rel="stylesheet" type="text/css" href="../../../webhelp/template/topic-body-list.css?buildId=2023110923"/></head>
<body id="lb-usage-commands" class="wh_topic_page frmBody">
<a href="#wh_topic_body" class="sr-only sr-only-focusable">
跳转到主要内容
</a>
<header class="navbar navbar-default wh_header">
<div class="container-fluid">
<div class="wh_header_flex_container navbar-nav navbar-expand-md navbar-dark">
<div class="wh_logo_and_publication_title_container">
<div class="wh_logo_and_publication_title">
<a href="http://www.artinchip.com" class=" wh_logo d-none d-sm-block "><img src="../../../company-logo-white.png" alt="RTOS SDK 使用指南SDK 指南文件"/></a>
<div class=" wh_publication_title "><a href="../../../index.html"><span class="booktitle"><span class="ph mainbooktitle">RTOS SDK 使用指南</span><span class="ph booktitlealt">SDK 指南文件</span></span></a></div>
</div>
</div>
<div class="wh_top_menu_and_indexterms_link collapse navbar-collapse" id="wh_top_menu_and_indexterms_link">
</div>
</div>
</div>
</header>
<div class=" wh_search_input navbar-form wh_topic_page_search search " role="form">
<form id="searchForm" method="get" role="search" action="../../../search.html"><div><input type="search" placeholder="搜索 " class="wh_search_textfield" id="textToSearch" name="searchQuery" aria-label="搜索查询" required="required"/><button type="submit" class="wh_search_button" aria-label="搜索"><span class="search_input_text">搜索</span></button></div></form>
</div>
<div class="container-fluid" id="wh_topic_container">
<div class="row">
<nav class="wh_tools d-print-none navbar-expand-md" aria-label="Tools">
<div data-tooltip-position="bottom" class=" wh_breadcrumb "></div>
<div class="wh_right_tools">
<button class="wh_hide_highlight" aria-label="切换搜索突出显示" title="切换搜索突出显示"></button>
<button class="webhelp_expand_collapse_sections" data-next-state="collapsed" aria-label="折叠截面" title="折叠截面"></button>
<div class=" wh_print_link print d-none d-md-inline-block "><button onClick="window.print()" title="打印此页" aria-label="打印此页"></button></div>
</div>
</nav>
</div>
<div class="wh_content_area">
<div class="row">
<div class="col-lg-10 col-md-10 col-sm-10 col-xs-12" id="wh_topic_body">
<button id="wh_close_topic_toc_button" class="close-toc-button d-none" aria-label="Toggle topic table of content" aria-controls="wh_topic_toc" aria-expanded="true">
<span class="close-toc-icon-container">
<span class="close-toc-icon"></span>
</span>
</button>
<div class=" wh_topic_content body "><main role="main"><article class="- topic/topic concept/concept topic concept" role="article" aria-labelledby="ariaid-title1"><span class="edit-link" style="font-size:12px; opacity:0.6; text-align:right; vertical-align:middle"><a target="_blank" href="http://172.16.35.88/tasks/jdssno1uvvbf2mltu9kb9v3if05d5gopuakboe8hlud18rma/edit/F:/aicdita/aicdita-cn/topics/sdk/advanced/lb_usage_commands.dita">Edit online</a></span><h1 class="- topic/title title topictitle1" id="ariaid-title1">命令详解</h1><div class="date inPage">5 Dec 2024</div><div style="color: gray;">
Read time: 3 minute(s)
</div><div class="- topic/body concept/conbody body conbody"><p class="- topic/shortdesc shortdesc"></p><section class="- topic/section section" id="lb-usage-commands__section_mqr_mdp_fdc" data-ofbid="lb-usage-commands__section_mqr_mdp_fdc"><h2 class="- topic/title title sectiontitle">常规命令</h2>
<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="lb-usage-commands__codeblock_zpf_12s_2bc" data-ofbid="lb-usage-commands__codeblock_zpf_12s_2bc">make <var class="+ topic/keyword sw-d/varname keyword varname">board</var>_defconfig
make all</pre>
<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="lb-usage-commands__codecell0" data-ofbid="lb-usage-commands__codecell0">- 项目查看make list --&gt; 列出当前可用的项目配置
- 配置make d211_demo128_nand_defconfig --&gt; 应用项目配置保存目录target/configs
- 编译make --&gt; 编译,自动进行修改检测,增量编译
- 清除make clean --&gt; 清除编译生成内容
- 清除中间代码make distclean --&gt; 清除编译生成内容,以及解压的源码
</pre>
<div class="- topic/p p" data-ofbid="d131137e37__20250121171605">以下是执行 <span class="+ topic/keyword sw-d/cmdname keyword cmdname">make list</span>
后的输出结果示例:<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="lb-usage-commands__codecell1" data-ofbid="lb-usage-commands__codecell1">make list
make d211_demo128_nand_defconfig
make
</pre></div>
</section><section class="- topic/section section" id="lb-usage-commands__section_wbl_rdp_fdc" data-ofbid="lb-usage-commands__section_wbl_rdp_fdc"><h2 class="- topic/title title sectiontitle">OneStep 加速命令</h2>
<div class="- topic/p p" data-ofbid="d131137e51__20250121171605">为了方便使用并加快开发效率ArtInChip 开发了一系列的加速命令,如下所示:<div class="- topic/note note note note_note" id="lb-usage-commands__note_tzj_h1p_fdc" data-ofbid="lb-usage-commands__note_tzj_h1p_fdc"><span class="note__title">注:</span>
<p class="- topic/p p" data-ofbid="d131137e55__20250121171605">使用加速命令前需要执行 <span class="+ topic/ph sw-d/filepath ph filepath">source scripts/onestep.sh</span> 脚本。</p>
</div></div>
<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="lb-usage-commands__codeblock_obz_rdp_fdc" data-ofbid="lb-usage-commands__codeblock_obz_rdp_fdc">lunch --&gt; 应用项目配置
m --&gt; 编译项目
croot|cr --&gt; 回到 SDK 根目录
ctarget|ct --&gt; 回到 方案目录
ckernel|ck --&gt; 回到到 kernel 目录
godir|gd --&gt; 跳转目录
hmm|h --&gt; 获取帮助</pre>
<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="lb-usage-commands__codeblock_uzc_k1p_fdc" data-ofbid="lb-usage-commands__codeblock_uzc_k1p_fdc">source tools/onestep.sh --&gt; 一步直达命令
lunch d211_demo128_nand_defconfig --&gt; 选择 d211_demo128_nand_defconfig
m --&gt; 编译打包</pre>
</section><div class="- topic/example example" id="lb-usage-commands__example_wgj_tdp_fdc" data-ofbid="lb-usage-commands__example_wgj_tdp_fdc"><h2 class="- topic/title title sectiontitle"><span class="+ topic/keyword sw-d/cmdname keyword cmdname">make list</span></h2>
<div class="- topic/p p" data-ofbid="d131137e74__20250121171605">列出当前 SDK 所有可用的
<span class="+ topic/ph sw-d/filepath ph filepath">defconfig</span><pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="lb-usage-commands__codeblock_qwc_wdp_fdc" data-ofbid="lb-usage-commands__codeblock_qwc_wdp_fdc">Built-in configs:
d211_demo100_nand_defconfig - Build <strong class="hl-keyword">for</strong> d211_demo100_nand
d211_demo128_nand_defconfig - Build <strong class="hl-keyword">for</strong> d211_demo128_nand
d211_demo88_nand_defconfig - Build <strong class="hl-keyword">for</strong> d211_demo88_nand
d211_demo88_nor_defconfig - Build <strong class="hl-keyword">for</strong> d211_demo88_nor
d211_demo88_nor_musl_defconfig - Build <strong class="hl-keyword">for</strong> d211_demo88_nor_musl
d211_demo_defconfig - Build <strong class="hl-keyword">for</strong> d211_demo
d211_ota_defconfig - Build <strong class="hl-keyword">for</strong> d211_ota
d211_ota_emmc_defconfig - Build <strong class="hl-keyword">for</strong> d211_ota_emmc</pre></div>
</div><div class="- topic/example example" id="lb-usage-commands__example_sxg_wdp_fdc" data-ofbid="lb-usage-commands__example_sxg_wdp_fdc"><h2 class="- topic/title title sectiontitle"><span class="+ topic/keyword sw-d/cmdname keyword cmdname">make board_defconfig</span></h2>
<p class="- topic/p p" data-ofbid="d131137e88__20250121171605">应用指定的项目配置,比如 <span class="+ topic/ph sw-d/filepath ph filepath">d211_demo128_nand_defconfig</span></p>
<p class="- topic/p p" data-ofbid="d131137e94__20250121171605">默认情况下,使用 <span class="+ topic/ph sw-d/filepath ph filepath">output</span> 作为项目的工作或输出目录。 使用
<span class="+ topic/keyword sw-d/cmdname keyword cmdname">O=dir</span> 命令可以指定一个专用的工作或输出目录,例如
<span class="+ topic/keyword sw-d/cmdname keyword cmdname">make O=demo128_nand d211_demo128_nand_defconfig</span></p>
<p class="- topic/p p" data-ofbid="d131137e106__20250121171605">当指定了 <span class="+ topic/keyword sw-d/cmdname keyword cmdname">O=demo128_nand</span> ,后续所有与该项目相关的 <span class="+ topic/keyword sw-d/cmdname keyword cmdname">make</span> 操作,都需要加上
<span class="+ topic/keyword sw-d/cmdname keyword cmdname">O=demo128_nand</span> 选项。用户也可以使用 <span class="+ topic/keyword sw-d/cmdname keyword cmdname">cd demo128_nand</span>
进入该目录后进行编译操作。</p>
</div><div class="- topic/example example" id="lb-usage-commands__example_t1n_ydp_fdc" data-ofbid="lb-usage-commands__example_t1n_ydp_fdc"><h2 class="- topic/title title sectiontitle"><span class="+ topic/keyword sw-d/cmdname keyword cmdname">make menuconfig</span></h2>
<p class="- topic/p p" data-ofbid="d131137e127__20250121171605">用于修改项目的配置。</p>
<figure class="- topic/fig fig fignone" id="lb-usage-commands__fig_k35_d2p_fdc" data-ofbid="lb-usage-commands__fig_k35_d2p_fdc"><br/><div class="imagecenter"><img class="- topic/image image imagecenter" id="lb-usage-commands__image_gcq_c2p_fdc" src="../../../images/sdk/luban-menuconfig.png" width="576" alt="luban-menuconfig"/></div><br/></figure>
<p class="- topic/p p" data-ofbid="d131137e135__20250121171605">配置完成后,保存并退出,相应的改动会同步到原有的 <span class="+ topic/ph sw-d/filepath ph filepath"><var class="+ topic/keyword sw-d/varname keyword varname">board</var>_defconfig</span>
文件中。</p>
<p class="- topic/p p" data-ofbid="d131137e143__20250121171605">通过下列命令可以修改 <span class="+ topic/ph sw-d/filepath ph filepath">uboot/linux/busybox</span> 中的配置,且保存配置后对应的修改都会同步到原有的
<span class="+ topic/ph sw-d/filepath ph filepath">defconfig</span> 文件中:</p>
<ul class="- topic/ul ul" id="lb-usage-commands__ul_hh1_f2p_fdc" data-ofbid="lb-usage-commands__ul_hh1_f2p_fdc"><li class="- topic/li li" data-ofbid="d131137e154__20250121171605">
<p class="- topic/p p" data-ofbid="d131137e156__20250121171605"><span class="+ topic/keyword sw-d/cmdname keyword cmdname">make uboot-menuconfig</span></p>
</li><li class="- topic/li li" data-ofbid="d131137e160__20250121171605">
<p class="- topic/p p" data-ofbid="d131137e162__20250121171605"><span class="+ topic/keyword sw-d/cmdname keyword cmdname">make linux-menuconfig</span></p>
</li><li class="- topic/li li" data-ofbid="d131137e166__20250121171605">
<p class="- topic/p p" data-ofbid="d131137e168__20250121171605"><span class="+ topic/keyword sw-d/cmdname keyword cmdname">make busybox-menuconfig</span></p>
</li></ul>
</div><div class="- topic/example example" id="lb-usage-commands__example_pbx_f2p_fdc" data-ofbid="lb-usage-commands__example_pbx_f2p_fdc"><h2 class="- topic/title title sectiontitle"><span class="+ topic/keyword sw-d/cmdname keyword cmdname">make all</span></h2>
<p class="- topic/p p" data-ofbid="d131137e179__20250121171605">编译整个项目,包括 Bootloader、Kernel、应用层的 Pacakge、RootFS 以及生成最终的烧录镜像文件。</p>
<p class="- topic/p p" data-ofbid="d131137e182__20250121171605">Luban 编译框架默认使用 <span class="+ topic/keyword sw-d/cmdname keyword cmdname">make -j0</span>,即根据主机的 CPU 核心个数决定使用多少个线程进行编译,外部不需要再提供
<span class="+ topic/keyword sw-d/cmdname keyword cmdname">-j</span> 参数。</p>
<p class="- topic/p p" data-ofbid="d131137e191__20250121171605">SDK 具有源码修改检测功能,在修改了 SDK 中任意包的源码之后,执行 <span class="+ topic/keyword sw-d/cmdname keyword cmdname">make all</span> 会触发该包的
<span class="+ topic/keyword sw-d/cmdname keyword cmdname">rebuild</span>,通常是增量编译。</p>
</div><section class="- topic/section section" id="lb-usage-commands__section_f5y_f2p_fdc" data-ofbid="lb-usage-commands__section_f5y_f2p_fdc"><h2 class="- topic/title title sectiontitle">快捷命令</h2>
<div class="- topic/p p" data-ofbid="d131137e205__20250121171605">对于一些高频输入的命令,以下列示了简短的快捷命令映射:<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="lb-usage-commands__codeblock_ohv_32p_fdc" data-ofbid="lb-usage-commands__codeblock_ohv_32p_fdc">make m -&gt; make menuconfig
make k -&gt; make linux-rebuild
make km -&gt; make linux-menuconfig
make b -&gt; make uboot-rebuild
make u -&gt; make uboot-rebuild
make bm -&gt; make uboot-menuconfig
make um -&gt; make uboot-menuconfig
make f -&gt; make all</pre></div>
</section><section class="- topic/section section" id="lb-usage-commands__section_gjt_ndp_fdc" data-ofbid="lb-usage-commands__section_gjt_ndp_fdc"><h2 class="- topic/title title sectiontitle">辅助命令</h2>
<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="lb-usage-commands__codeblock_lrn_4dp_fdc" data-ofbid="lb-usage-commands__codeblock_lrn_4dp_fdc">make list (make l) --&gt; 列出当前可用的 &lt;board&gt;_defconfig
make menuconfig (make m) --&gt; 对 SDK 进行配置
make uboot-menuconfig (make um) --&gt; 对 U-Boot 进行配置
make linux-menuconfig (make km) --&gt; 对 Linux 内核进行配置
make busybox-menuconfig --&gt; 对 Busybox 进行配置</pre>
<div class="- topic/note note warning note_warning" id="lb-usage-commands__note_bwb_pdp_fdc" data-ofbid="lb-usage-commands__note_bwb_pdp_fdc"><span class="note__title">警告:</span>
<p class="- topic/p p" data-ofbid="d131137e220__20250121171605">勿在 <span class="+ topic/keyword sw-d/cmdname keyword cmdname">make</span> 命令中使用 <span class="+ topic/keyword pr-d/parmname keyword parmname">-j</span> 参数。</p>
<p class="- topic/p p" data-ofbid="d131137e229__20250121171605">Luban 在编译过程中,已经默认使用了 <span class="+ topic/keyword pr-d/parmname keyword parmname">-j0</span> 参数,即根据系统的 CPU 核心数量, 动态分配编译的线程。如果外部再提供
<span class="+ topic/keyword pr-d/parmname keyword parmname">-j</span> 参数,会导致 SDK 编译过程中出现一些高层次的目标编译 不同步的错误。</p>
</div>
</section><section class="- topic/section section" id="lb-usage-commands__section_bwc_j2p_fdc" data-ofbid="lb-usage-commands__section_bwc_j2p_fdc"><h2 class="- topic/title title sectiontitle">其他重要命令</h2>
<div class="- topic/p p" data-ofbid="d131137e244__20250121171605">
<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="lb-usage-commands__codeblock_bqt_j2p_fdc" data-ofbid="lb-usage-commands__codeblock_bqt_j2p_fdc">make show-targets --&gt; 查看当前项目有哪些编译目标
make &lt;pkg&gt;-extract --&gt; 仅对源码包进行解压
make &lt;pkg&gt;-patch --&gt; 仅对源码包进行 patch如果有的话
make &lt;pkg&gt; --&gt; 完成从 extract/patch/../build/install
make &lt;pkg&gt;-reconfigure --&gt; 对该源码包重新执行配置、编译、安装
make &lt;pkg&gt;-rebuild --&gt; 对该源码包进行重新编译
make &lt;pkg&gt;-reinstall --&gt; 对该源码包进行重新安装
make &lt;pkg&gt;-prebuilt --&gt; 为该源码包生成预编译二进制压缩包
make &lt;pkg&gt;-clean --&gt; 删除该源码包的所有编译输出
make &lt;pkg&gt;-distclean --&gt; 删除该源码包的源码</pre>
</div>
</section></div></article></main></div>
</div>
<nav role="navigation" id="wh_topic_toc" aria-label="On this page" class="col-lg-2 d-none d-lg-block navbar d-print-none">
<div id="wh_topic_toc_content">
<div class=" wh_topic_toc "><div class="wh_topic_label">在本页上</div><ul><li class="section-item"><div class="section-title"><a href="#lb-usage-commands__section_mqr_mdp_fdc" data-tocid="lb-usage-commands__section_mqr_mdp_fdc">常规命令</a></div></li><li class="section-item"><div class="section-title"><a href="#lb-usage-commands__section_wbl_rdp_fdc" data-tocid="lb-usage-commands__section_wbl_rdp_fdc">OneStep 加速命令</a></div></li><li class="section-title"><a href="#lb-usage-commands__example_wgj_tdp_fdc" data-tocid="lb-usage-commands__example_wgj_tdp_fdc"><span class="+ topic/keyword sw-d/cmdname keyword cmdname">make list</span></a></li><li class="section-title"><a href="#lb-usage-commands__example_sxg_wdp_fdc" data-tocid="lb-usage-commands__example_sxg_wdp_fdc"><span class="+ topic/keyword sw-d/cmdname keyword cmdname">make board_defconfig</span></a></li><li class="section-title"><a href="#lb-usage-commands__example_t1n_ydp_fdc" data-tocid="lb-usage-commands__example_t1n_ydp_fdc"><span class="+ topic/keyword sw-d/cmdname keyword cmdname">make menuconfig</span></a></li><li class="section-title"><a href="#lb-usage-commands__example_pbx_f2p_fdc" data-tocid="lb-usage-commands__example_pbx_f2p_fdc"><span class="+ topic/keyword sw-d/cmdname keyword cmdname">make all</span></a></li><li class="section-item"><div class="section-title"><a href="#lb-usage-commands__section_f5y_f2p_fdc" data-tocid="lb-usage-commands__section_f5y_f2p_fdc">快捷命令</a></div></li><li class="section-item"><div class="section-title"><a href="#lb-usage-commands__section_gjt_ndp_fdc" data-tocid="lb-usage-commands__section_gjt_ndp_fdc">辅助命令</a></div></li><li class="section-item"><div class="section-title"><a href="#lb-usage-commands__section_bwc_j2p_fdc" data-tocid="lb-usage-commands__section_bwc_j2p_fdc">其他重要命令</a></div></li></ul></div>
</div>
</nav>
</div>
</div>
</div>
<footer class="navbar navbar-default wh_footer">
<div class=" footer-container mx-auto ">
<title>footer def</title>
<style><!--
.p1 {
font-family: FangZhengShuSong, Times, serif;
}
.p2 {
font-family: Arial, Helvetica, sans-serif;
}
.p3 {
font-family: "Lucida Console", "Courier New", monospace;
}
--></style>
<div class="webhelp.fragment.footer">
<p class="p1">Copyright © 2019-2024 广东匠芯创科技有限公司. All rights reserved.</p>
</div><div>
<div class="generation_time">
Update Time: 2025-01-21
</div>
</div>
</div>
</footer>
<div id="go2top" class="d-print-none">
<span class="oxy-icon oxy-icon-up"></span>
</div>
<div id="modal_img_large" class="modal">
<span class="close oxy-icon oxy-icon-remove"></span>
<div id="modal_img_container"></div>
<div id="caption"></div>
</div>
<script src="${pd}/publishing/publishing-styles-AIC-template/js/custom.js" defer="defer"></script>
</body>
</html>