Files
luban-lite/doc/topics/sdk/app/mkfs_partition_image.html

364 lines
48 KiB
HTML
Raw Permalink Normal View History

2025-04-23 17:54:31 +08:00
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-cn" lang="zh-cn" data-whc_version="26.1">
2025-07-22 11:15:46 +08:00
<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="description" content="制作文件系统镜像时,需要将编译后的文件和资源打包成特定格式的镜像文件,以便烧录到目标设备上。制作文件系统镜像前,需要准备相应的资源文件。在 Luban Lite SDK 中,各模块可以通过配置 INSTALL 参数来指定需要安装的资源文件。这些资源文件会被复制到指定的目标目录中。 Luban-Lite SDK ..."/><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="topic"/><meta name="DC.relation" content="../../../topics/sdk/chapter-app.html"/><meta name="DC.relation" content="../../../topics/sdk/secure/spinenc-efuse-and-firmware-combined-V2.html"/><meta name="DC.relation" content="../../../topics/sdk/burnsys/burner_offline_lite.html"/><meta name="DC.contributor" content="yan.wang"/><meta name="DC.contributor" content="yan.wang"/><meta name="DC.creator" content="yan.wang"/><meta name="DC.date.modified" content="2025-05-16"/><meta name="DC.format" content="HTML5"/><meta name="DC.identifier" content="mkfs_partition_image"/><meta name="DC.language" content="zh-CN"/><title>制作分区镜像</title><!-- Generated with build number 2025051600. --><meta name="wh-path2root" content="../../../"/><meta name="wh-toc-id" content="mkfs_partition_image-d3752e1636"/><meta name="wh-source-relpath" content="topics/sdk/app/mkfs_partition_image.dita"/><meta name="wh-out-relpath" content="topics/sdk/app/mkfs_partition_image.html"/>
2025-01-23 16:37:00 +08:00
2025-04-23 17:54:31 +08:00
<link rel="stylesheet" type="text/css" href="../../../webhelp/app/commons.css?buildId=2024041900"/>
<link rel="stylesheet" type="text/css" href="../../../webhelp/app/topic.css?buildId=2024041900"/>
2025-01-23 16:37:00 +08:00
2025-07-22 11:15:46 +08:00
<script src="../../../webhelp/app/options/properties.js?buildId=20250519091401"></script>
2025-04-23 17:54:31 +08:00
<script src="../../../webhelp/app/localization/strings.js?buildId=2024041900"></script>
2025-07-22 11:15:46 +08:00
<script src="../../../webhelp/app/search/index/keywords.js?buildId=20250519091401"></script>
2025-04-23 17:54:31 +08:00
<script defer="defer" src="../../../webhelp/app/commons.js?buildId=2024041900"></script>
<script defer="defer" src="../../../webhelp/app/topic.js?buildId=2024041900"></script>
<link rel="stylesheet" type="text/css" href="../../../webhelp/template/css/aic-styles-web-internal.css?buildId=2024041900"/><link rel="stylesheet" type="text/css" href="../../../webhelp/template/css/notes.css?buildId=2024041900"/><link rel="stylesheet" type="text/css" href="../../../webhelp/template/css/aic-common.css?buildId=2024041900"/><link rel="stylesheet" type="text/css" href="../../../webhelp/template/css/aic-images.css?buildId=2024041900"/><link rel="stylesheet" type="text/css" href="../../../webhelp/template/css/footnote.css?buildId=2024041900"/><link rel="stylesheet" type="text/css" href="../../../webhelp/template/css/aic-highlight-changes.css?buildId=2024041900"/><link rel="stylesheet" type="text/css" href="../../../webhelp/template/css/search-in-header.css?buildId=2024041900"/><link rel="stylesheet" type="text/css" href="../../../webhelp/template/css/topic-body-list.css?buildId=2024041900"/></head>
2025-01-23 16:37:00 +08:00
<body id="mkfs_partition_image" 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">
2025-04-23 17:54:31 +08:00
<div xmlns:whc="http://www.oxygenxml.com/webhelp/components" class="wh_header_flex_container navbar-nav navbar-expand-md navbar-dark">
2025-01-23 16:37:00 +08:00
<div class="wh_logo_and_publication_title_container">
<div class="wh_logo_and_publication_title">
2025-04-23 17:54:31 +08:00
<a href="https://www.artinchip.com" class=" wh_logo d-none d-sm-block "><img src="../../../company-logo.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>
2025-01-23 16:37:00 +08:00
</div>
</div>
<div class="wh_top_menu_and_indexterms_link collapse navbar-collapse" id="wh_top_menu_and_indexterms_link">
</div>
<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>
2025-04-23 17:54:31 +08:00
</div></div>
</div>
</header>
2025-01-23 16:37:00 +08:00
<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 "><ol class="d-print-none"><li><span class="home"><a href="../../../index.html"><span>主页</span></a></span></li><li><div class="topicref" data-id="concept_rcx_czh_pzb"><div class="title"><a href="../../../topics/sdk/chapter-app.html">应用场景</a><div class="wh-tooltip"><p class="shortdesc">描述了 SDK 在不同应用场景中的配置和使用包括系统更新、OTA、安全方案等。</p></div></div></div></li><li class="active"><div class="topicref" data-id="mkfs_partition_image"><div class="title"><a href="../../../topics/sdk/app/mkfs_partition_image.html">制作分区镜像</a></div></div></li></ol></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_navigation_links "><span id="topic_navigation_links" class="navheader">
2025-07-22 11:15:46 +08:00
<span class="navprev"><a class="- topic/link link" href="../../../topics/sdk/secure/spinenc-efuse-and-firmware-combined-V2.html" title="eFuse 与固件合并烧录" aria-label="上一主题: eFuse 与固件合并烧录" rel="prev"></a></span>
2025-04-23 17:54:31 +08:00
<span class="navnext"><a class="- topic/link link" href="../../../topics/sdk/burnsys/burner_offline_lite.html" title="离线烧录" aria-label="下一主题: 离线烧录" rel="next"></a></span> </span></div>
2025-01-23 16:37:00 +08:00
<div class=" wh_print_link print d-none d-md-inline-block "><button onClick="window.print()" title="打印此页" aria-label="打印此页"></button></div>
<button type="button" id="wh_toc_button" class="custom-toggler navbar-toggler collapsed wh_toggle_button navbar-light" aria-expanded="false" aria-label="Toggle publishing table of content" aria-controls="wh_publication_toc">
<span class="navbar-toggler-icon"></span>
</button>
</div>
</nav>
</div>
<div class="wh_content_area">
<div class="row">
<nav id="wh_publication_toc" class="col-lg-3 col-md-3 col-sm-12 d-md-block d-none d-print-none" aria-label="Table of Contents Container">
<div id="wh_publication_toc_content">
2025-07-22 11:15:46 +08:00
<div class=" wh_publication_toc " data-tooltip-position="right"><span class="expand-button-action-labels"><span id="button-expand-action" role="button" aria-label="Expand"></span><span id="button-collapse-action" role="button" aria-label="Collapse"></span><span id="button-pending-action" role="button" aria-label="Pending"></span></span><ul role="tree" aria-label="Table of Contents"><li role="treeitem"><div data-tocid="revinfo_linux-d3752e463" class="topicref" data-id="revinfo_linux" data-state="leaf"><span role="button" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/revinfo/revinfo_rtos.html" id="revinfo_linux-d3752e463-link">修订记录</a></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="id-d3752e480" class="topicref" data-id="id" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action id-d3752e480-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/env/sdk-compile.html" id="id-d3752e480-link">SDK 编译</a><div class="wh-tooltip"><p class="shortdesc">介绍不同编译环境下 SDK 的详细编译流程。</p></div></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="id-d3752e604" class="topicref" data-id="id" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action id-d3752e604-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/advanced/sdk-usage.html" id="id-d3752e604-link">使用指南</a><div class="wh-tooltip"><p class="shortdesc">命令详解,编译选项,镜像和分区配置,添加应用和驱动等的详细使用说明。</p></div></div></div></li><li role="treeitem" aria-expanded="true"><div data-tocid="concept_rcx_czh_pzb-d3752e1004" class="topicref" data-id="concept_rcx_czh_pzb" data-state="expanded"><span role="button" tabindex="0" aria-labelledby="button-collapse-action concept_rcx_czh_pzb-d3752e1004-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/chapter-app.html" id="concept_rcx_czh_pzb-d3752e1004-link">应用场景</a><div class="wh-tooltip"><p class="shortdesc">描述了 SDK 在不同应用场景中的配置和使用包括系统更新、OTA、安全方案等。</p></div></div></div><ul role="group" class="navbar-nav nav-list"><li role="treeitem"><div data-tocid="id-d3752e1021" class="topicref" data-id="id" data-state="leaf"><span role="button" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/usb/udisk.html" id="id-d3752e1021-link">挂载 U 盘 </a></div></div></li><li role="treeitem"><div data-tocid="id-d3752e1035" class="topicref" data-id="id" data-state="leaf"><span role="button" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/sdmc/sdcard.html" id="id-d3752e1035-link">挂载 SD 卡</a></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="id-d3752e1049" class="topicref" data-id="id" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action id-d3752e1049-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/burnsys/burnsys_user_guide.html" id="id-d3752e1049-link">系统更新</a></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="id-d3752e1163" class="topicref" data-id="id" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action id-d3752e1163-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/ota/ota_guide.html" id="id-d3752e1163-link">OTA 方案</a></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="id-d3752e1283" class="topicref" data-id="id" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action id-d3752e1283-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/xip/xip_user_guide.html" id="id-d3752e1283-link">XIP 方案 </a></div></div></li><li role="treeitem" aria-expanded="false"><div dat
2025-01-23 16:37:00 +08:00
</div>
</nav>
<div class="col-lg-7 col-md-9 col-sm-12" id="wh_topic_body">
<button id="wh_close_publication_toc_button" class="close-toc-button d-none" aria-label="Toggle publishing table of content" aria-controls="wh_publication_toc" aria-expanded="true">
<span class="close-toc-icon-container">
<span class="close-toc-icon"></span>
</span>
</button>
<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>
2025-04-23 17:54:31 +08:00
<div class=" wh_topic_content body "><main role="main"><article class="- topic/topic topic" 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://aicdocco/taskstopics/sdk/app/mkfs_partition_image.dita">Edit online</a></span><h1 class="- topic/title title topictitle1" id="ariaid-title1">制作分区镜像</h1>
2025-07-22 11:15:46 +08:00
<div class="date inPage">16 May 2025</div><div style="color: gray;">
2025-01-23 16:37:00 +08:00
Read time: 4 minute(s)
2025-04-23 17:54:31 +08:00
</div>
<div class="- topic/body body">
2025-07-22 11:15:46 +08:00
<p class="- topic/p p" data-ofbid="d173594e31__20250519091524">制作文件系统镜像时,需要将编译后的文件和资源打包成特定格式的镜像文件,以便烧录到目标设备上。制作文件系统镜像前,需要准备相应的资源文件。在 Luban Lite SDK
2025-04-23 17:54:31 +08:00
中,各模块可以通过配置 <code class="+ topic/ph pr-d/codeph ph codeph">INSTALL</code> 参数来指定需要安装的资源文件。这些资源文件会被复制到指定的目标目录中。</p>
2025-07-22 11:15:46 +08:00
<p class="- topic/p p" data-ofbid="d173594e37__20250519091524"><span class="- topic/ph ph">Luban-Lite</span> SDK 在编译的最后阶段会自动制作所需要的文件系统镜像。如需独立制作文件系统镜像,可参照本节的镜像制作流程。</p>
2025-04-23 17:54:31 +08:00
<section class="- topic/section section" id="mkfs_partition_image__section_bxm_cqf_c2c" data-ofbid="mkfs_partition_image__section_bxm_cqf_c2c"><h2 class="- topic/title title sectiontitle">安装资源文件</h2>
2025-01-23 16:37:00 +08:00
2025-07-22 11:15:46 +08:00
<div class="- topic/p p" data-ofbid="d173594e47__20250519091524">详细的配置流程如下所示:<ol class="- topic/ol ol" id="mkfs_partition_image__ol_abc_3lf_c2c" data-ofbid="mkfs_partition_image__ol_abc_3lf_c2c">
<li class="- topic/li li" data-ofbid="d173594e51__20250519091524">
<p class="- topic/p p" data-ofbid="d173594e53__20250519091524">安装各个模块所需的资源文件,以模块 A 和 B 为例:</p>
<div class="- topic/p p" data-ofbid="d173594e56__20250519091524">以下是两个模块 A 和 B 的示例配置,如图所示:<br/><div class="imagecenter"><img class="- topic/image image imagecenter" id="mkfs_partition_image__image_vsp_bjf_c2c" src="../../../images/app/mkfs_arch.png"/></div><br/><div class="table-container"><table class="- topic/table table frame-all" id="mkfs_partition_image__table_obl_ljf_c2c" data-ofbid="mkfs_partition_image__table_obl_ljf_c2c" data-cols="4"><caption class="- topic/title title tablecap" data-caption-side="top" data-is-repeated="true"><span class="table--title-label"><span class="table--title-label-number"> 1</span><span class="table--title-label-punctuation">. </span></span><span class="table--title">模块 A 和 B 文件系统安装示例</span></caption><colgroup><col style="width:4.508566275924256%"/><col style="width:12.623985572587918%"/><col style="width:18.66546438232642%"/><col style="width:64.2019837691614%"/></colgroup><thead class="- topic/thead thead">
2025-04-23 17:54:31 +08:00
<tr class="- topic/row">
2025-07-22 11:15:46 +08:00
<th class="- topic/entry entry colsep-1 rowsep-1" id="mkfs_partition_image__table_obl_ljf_c2c__entry__1"><p class="- topic/p p" data-ofbid="d173594e79__20250519091524">模块</p></th>
<th class="- topic/entry entry colsep-1 rowsep-1" id="mkfs_partition_image__table_obl_ljf_c2c__entry__2"><p class="- topic/p p" data-ofbid="d173594e83__20250519091524">安装文件</p></th>
<th class="- topic/entry entry colsep-1 rowsep-1" id="mkfs_partition_image__table_obl_ljf_c2c__entry__3"><p class="- topic/p p" data-ofbid="d173594e87__20250519091524">文件系统安装路径</p></th>
<th class="- topic/entry entry colsep-0 rowsep-1" id="mkfs_partition_image__table_obl_ljf_c2c__entry__4"><p class="- topic/p p" data-ofbid="d173594e91__20250519091524">SConscript 中配置示例</p></th>
2025-04-23 17:54:31 +08:00
</tr>
</thead><tbody class="- topic/tbody tbody">
<tr class="- topic/row">
2025-07-22 11:15:46 +08:00
<td class="- topic/entry entry colsep-1 rowsep-1" headers="mkfs_partition_image__table_obl_ljf_c2c__entry__1" rowspan="2"><p class="- topic/p p" data-ofbid="d173594e102__20250519091524">模块 A</p></td>
2025-04-23 17:54:31 +08:00
<td class="- topic/entry entry colsep-1 rowsep-1" headers="mkfs_partition_image__table_obl_ljf_c2c__entry__2">
2025-07-22 11:15:46 +08:00
<p class="- topic/p p" data-ofbid="d173594e107__20250519091524"><span class="+ topic/ph sw-d/filepath ph filepath">res/file1</span></p>
<p class="- topic/p p" data-ofbid="d173594e111__20250519091524"><span class="+ topic/ph sw-d/filepath ph filepath">res/file2</span></p>
2025-04-23 17:54:31 +08:00
</td>
2025-07-22 11:15:46 +08:00
<td class="- topic/entry entry colsep-1 rowsep-1" headers="mkfs_partition_image__table_obl_ljf_c2c__entry__3"><p class="- topic/p p" data-ofbid="d173594e117__20250519091524"><span class="+ topic/ph sw-d/filepath ph filepath">rodata/mod_a/</span></p></td>
<td class="- topic/entry entry colsep-0 rowsep-1" headers="mkfs_partition_image__table_obl_ljf_c2c__entry__4" rowspan="2"><div class="- topic/p p" data-ofbid="d173594e122__20250519091524">
2025-01-23 16:37:00 +08:00
<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="mkfs_partition_image__codeblock_xlt_mkf_c2c" data-ofbid="mkfs_partition_image__codeblock_xlt_mkf_c2c">install = [
(<span class="hl-string">'res/'</span>, <span class="hl-string">'rodata/mod_a/'</span>),
(<span class="hl-string">'file5'</span>, <span class="hl-string">'data/mod_a/file5'</span>)
]
group = DefineGroup(<span class="hl-string">'Module A'</span>, src, depend = [], CPPPATH = CPPPATH, CLFAGS = cc_flags, INSTALL = install)</pre>
2025-04-23 17:54:31 +08:00
</div></td>
</tr>
<tr class="- topic/row">
2025-07-22 11:15:46 +08:00
<td class="- topic/entry entry colsep-1 rowsep-1" headers="mkfs_partition_image__table_obl_ljf_c2c__entry__2"><p class="- topic/p p" data-ofbid="d173594e132__20250519091524"><span class="+ topic/ph sw-d/filepath ph filepath">file5</span></p></td>
<td class="- topic/entry entry colsep-1 rowsep-1" headers="mkfs_partition_image__table_obl_ljf_c2c__entry__3"><p class="- topic/p p" data-ofbid="d173594e137__20250519091524"><span class="+ topic/ph sw-d/filepath ph filepath">data/mod_a/file5</span></p></td>
2025-04-23 17:54:31 +08:00
</tr>
<tr class="- topic/row">
2025-07-22 11:15:46 +08:00
<td class="- topic/entry entry colsep-1 rowsep-0" headers="mkfs_partition_image__table_obl_ljf_c2c__entry__1" rowspan="2"><p class="- topic/p p" data-ofbid="d173594e145__20250519091524">模块 B</p></td>
2025-04-23 17:54:31 +08:00
<td class="- topic/entry entry colsep-1 rowsep-1" headers="mkfs_partition_image__table_obl_ljf_c2c__entry__2">
2025-07-22 11:15:46 +08:00
<p class="- topic/p p" data-ofbid="d173594e150__20250519091524"><span class="+ topic/ph sw-d/filepath ph filepath">res/file3</span></p>
<p class="- topic/p p" data-ofbid="d173594e154__20250519091524"><span class="+ topic/ph sw-d/filepath ph filepath">res/file2</span></p>
2025-04-23 17:54:31 +08:00
</td>
2025-07-22 11:15:46 +08:00
<td class="- topic/entry entry colsep-1 rowsep-1" headers="mkfs_partition_image__table_obl_ljf_c2c__entry__3"><p class="- topic/p p" data-ofbid="d173594e160__20250519091524"><span class="+ topic/ph sw-d/filepath ph filepath">rodata/mod_b/</span></p></td>
<td class="- topic/entry entry colsep-0 rowsep-0" headers="mkfs_partition_image__table_obl_ljf_c2c__entry__4" rowspan="2"><div class="- topic/p p" data-ofbid="d173594e165__20250519091524">
2025-01-23 16:37:00 +08:00
<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="mkfs_partition_image__codeblock_xbb_pkf_c2c" data-ofbid="mkfs_partition_image__codeblock_xbb_pkf_c2c">install = [
(<span class="hl-string">'res/'</span>, <span class="hl-string">'rodata/mod_b/'</span>),
(<span class="hl-string">'file7'</span>, <span class="hl-string">'data/mod_b/file7'</span>)
]
group = DefineGroup(<span class="hl-string">'Module B'</span>, src, depend = [], CPPPATH = CPPPATH, CLFAGS = cc_flags, INSTALL = install)</pre>
2025-04-23 17:54:31 +08:00
</div></td>
</tr>
<tr class="- topic/row">
2025-07-22 11:15:46 +08:00
<td class="- topic/entry entry colsep-1 rowsep-0" headers="mkfs_partition_image__table_obl_ljf_c2c__entry__2"><p class="- topic/p p" data-ofbid="d173594e175__20250519091524"><span class="+ topic/ph sw-d/filepath ph filepath">file7</span></p></td>
<td class="- topic/entry entry colsep-1 rowsep-0" headers="mkfs_partition_image__table_obl_ljf_c2c__entry__3"><p class="- topic/p p" data-ofbid="d173594e180__20250519091524"><span class="+ topic/ph sw-d/filepath ph filepath">data/mod_b/file7</span></p></td>
2025-04-23 17:54:31 +08:00
</tr>
</tbody></table></div></div>
2025-07-22 11:15:46 +08:00
<div class="- topic/p p" data-ofbid="d173594e188__20250519091524"><code class="+ topic/ph pr-d/codeph ph codeph">INSTALL = <var class="+ topic/keyword sw-d/varname keyword varname">install</var></code>
2025-01-23 16:37:00 +08:00
配置支持设置安装的源目录或文件,目标目录或文件。其中,源目录路径为该模块目录的相对路径,目标目录路径为编译输出的
<span class="+ topic/ph sw-d/filepath ph filepath">images</span> 目录的相对路径。在 SDK 编译的最后阶段,会执行
<span class="+ topic/ph sw-d/filepath ph filepath">fsinstall.py</span> 脚本,统一对上述的配置进行文件安装。<div class="- topic/note note note note_note" id="mkfs_partition_image__note_rjy_xkf_c2c" data-ofbid="mkfs_partition_image__note_rjy_xkf_c2c"><span class="note__title">注:</span> 上述安装目标文件夹名称可以任意配置,并不仅限于使用
<span class="+ topic/ph sw-d/filepath ph filepath">rodata</span>
2025-04-23 17:54:31 +08:00
<span class="+ topic/ph sw-d/filepath ph filepath">data</span>。使用其它名称时,务必同步修改镜像打包配置中的文件名称。</div></div>
</li>
2025-07-22 11:15:46 +08:00
<li class="- topic/li li" data-ofbid="d173594e210__20250519091524">
<div class="- topic/p p" data-ofbid="d173594e212__20250519091524">将安装的目录打包成文件系统镜像,并完成烧录。<ol class="- topic/ol ol" type="a" id="mkfs_partition_image__ol_ghp_nlf_c2c" data-ofbid="mkfs_partition_image__ol_ghp_nlf_c2c">
<li class="- topic/li li" data-ofbid="d173594e216__20250519091524">
<div class="- topic/p p" data-ofbid="d173594e218__20250519091524">按照所需镜像类别,在 menuconfig
2025-01-23 16:37:00 +08:00
中配置系统镜像文件:<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="mkfs_partition_image__codeblock_okm_plf_c2c" data-ofbid="mkfs_partition_image__codeblock_okm_plf_c2c">&gt; Application options ---&gt;
[*] Using File System Image <span class="hl-number">0</span> ---&gt;
[*] Using File System Image <span class="hl-number">1</span> ---&gt;</pre></div>
2025-04-23 17:54:31 +08:00
</li>
2025-07-22 11:15:46 +08:00
<li class="- topic/li li" data-ofbid="d173594e224__20250519091524">
<p class="- topic/p p" data-ofbid="d173594e226__20250519091524">配置 <code class="+ topic/ph pr-d/codeph ph codeph">Data Directory</code> 参数。 </p>
<div class="- topic/p p" data-ofbid="d173594e232__20250519091524">资源文件安装时,安装到了 <span class="+ topic/ph sw-d/filepath ph filepath">images</span>
2025-01-23 16:37:00 +08:00
下的指定文件夹,制作文件系统镜像时,也应该从对应的文件夹进行打包,生成镜像。 示例如下,从
<span class="+ topic/ph sw-d/filepath ph filepath">images</span> 目录下的
<span class="+ topic/ph sw-d/filepath ph filepath">rodata/</span> 文件夹进行打包,生成
<span class="+ topic/ph sw-d/filepath ph filepath">rodata.fatfs</span>
文件系统镜像。<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="mkfs_partition_image__codeblock_hlc_mmf_c2c" data-ofbid="mkfs_partition_image__codeblock_hlc_mmf_c2c">&gt; Application options ---&gt;
[*] Using File System Image <span class="hl-number">0</span> ---&gt;
Select File System Type (FATFS) ---&gt;
(rodata/) Data Directory
(rodata.fatfs) Image Name
[*] <strong class="hl-keyword">auto</strong> calcuate image size
[*] using <strong class="hl-keyword">default</strong> volume lable
</pre></div>
2025-04-23 17:54:31 +08:00
</li>
</ol></div>
</li>
</ol><div class="- topic/note note tip note_tip" id="mkfs_partition_image__note_nyv_5pf_c2c" data-ofbid="mkfs_partition_image__note_nyv_5pf_c2c"><span class="note__title">提示:</span>
2025-07-22 11:15:46 +08:00
<p class="- topic/p p" data-ofbid="d173594e254__20250519091524">如果希望进行简单的文件复制安装操作,可以将文件存放在工程的主目录中,例如
2025-01-23 16:37:00 +08:00
<span class="+ topic/ph sw-d/filepath ph filepath">target/d21x/demo128-nand/</span> 并添加安装命令到主目录的 SConscript
脚本中,例如 <span class="+ topic/ph sw-d/filepath ph filepath">target/d21x/demo128-nand/SConscript</span></p>
</div></div>
2025-04-23 17:54:31 +08:00
</section>
<section class="- topic/section section" id="mkfs_partition_image__section_u5z_cqq_gdc" data-ofbid="mkfs_partition_image__section_u5z_cqq_gdc"><h2 class="- topic/title title sectiontitle">制作 FATFS 镜像</h2>
2025-01-23 16:37:00 +08:00
2025-07-22 11:15:46 +08:00
<div class="- topic/p p" data-ofbid="d173594e270__20250519091524">
2025-04-23 17:54:31 +08:00
<ol class="- topic/ol ol" id="mkfs_partition_image__ol_rbh_2qq_gdc" data-ofbid="mkfs_partition_image__ol_rbh_2qq_gdc">
2025-07-22 11:15:46 +08:00
<li class="- topic/li li" data-ofbid="d173594e274__20250519091524">
<p class="- topic/p p" data-ofbid="d173594e276__20250519091524">确保编译主机上已经安装 Python3并进入 <span class="- topic/ph ph">Luban-Lite</span> SDK 的根目录。 </p>
2025-04-23 17:54:31 +08:00
</li>
2025-07-22 11:15:46 +08:00
<li class="- topic/li li" data-ofbid="d173594e283__20250519091524">
<div class="- topic/p p" data-ofbid="d173594e285__20250519091524">将需要打包的文件或文件夹,放到一个独立的文件夹内,例如: <ul class="- topic/ul ul" id="mkfs_partition_image__ul_ycv_hpb_wcc" data-ofbid="mkfs_partition_image__ul_ycv_hpb_wcc">
<li class="- topic/li li" data-ofbid="d173594e289__20250519091524">Linux: <span class="+ topic/ph sw-d/filepath ph filepath">~/fatfs_root/</span></li>
<li class="- topic/li li" data-ofbid="d173594e294__20250519091524">Windows: <span class="+ topic/ph sw-d/filepath ph filepath">D:\fatfs_root\</span></li>
2025-04-23 17:54:31 +08:00
</ul></div>
</li>
2025-07-22 11:15:46 +08:00
<li class="- topic/li li" data-ofbid="d173594e301__20250519091524">
<div class="- topic/p p" data-ofbid="d173594e303__20250519091524">根据资源文件大小制作镜像或制作指定大小的文件系统镜像。 <ul class="- topic/ul ul" id="mkfs_partition_image__ol_hfg_fqq_gdc" data-ofbid="mkfs_partition_image__ol_hfg_fqq_gdc">
<li class="- topic/li li" data-ofbid="d173594e307__20250519091524">
<div class="- topic/p p" data-ofbid="d173594e309__20250519091524">如需根据资源文件大小制作镜像,则执行下列命令:<div style="margin-bottom: 0;"><strong>Linux</strong></div><pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="mkfs_partition_image__codeblock_ykb_1sq_pdc" data-ofbid="mkfs_partition_image__codeblock_ykb_1sq_pdc">python3 ./tools/scripts/makefatfs.py --<strong class="hl-keyword">auto</strong> --cluster <span class="hl-number">8</span> --sector <span class="hl-number">512</span> --tooldir ./tools/scripts/ --inputdir ~/fatfs_root/ --outfile mytest.fatfs</pre><div style="margin-bottom: 0;"><strong>Windows</strong></div><pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="mkfs_partition_image__pre_ktl_xpb_wcc" data-ofbid="mkfs_partition_image__pre_ktl_xpb_wcc">python tools\scripts\makefatfs.py --<strong class="hl-keyword">auto</strong> --cluster <span class="hl-number">8</span> --sector <span class="hl-number">512</span> --tooldir tools\scripts\ --inputdir D:\fatfs_root\ --outfile mytest.fatfs</pre></div>
2025-04-23 17:54:31 +08:00
</li>
2025-07-22 11:15:46 +08:00
<li class="- topic/li li" data-ofbid="d173594e317__20250519091524">
<div class="- topic/p p" data-ofbid="d173594e319__20250519091524">如需制作指定大小的文件系统镜像,执行下列命令,以制作一个 100 MB 的 FATFS
2025-01-23 16:37:00 +08:00
镜像为例:<div style="margin-bottom: 0;"><strong>Linux</strong></div><pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="mkfs_partition_image__codeblock_z4h_dsq_pdc" data-ofbid="mkfs_partition_image__codeblock_z4h_dsq_pdc">python3 ./tools/scripts/makefatfs.py --raw --imgsize <span class="hl-number">104857600</span> --cluster <span class="hl-number">8</span> --sector <span class="hl-number">512</span> --tooldir ./tools/scripts/ --inputdir ~/fatfs_root/ --outfile mytest.fatfs</pre><div style="margin-bottom: 0;"><strong>Windows</strong></div><pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="mkfs_partition_image__pre_nky_ypb_wcc" data-ofbid="mkfs_partition_image__pre_nky_ypb_wcc">python tools\scripts\makefatfs.py --raw --imgsize <span class="hl-number">104857600</span> --cluster <span class="hl-number">8</span> --sector <span class="hl-number">512</span> --tooldir tools\scripts\ --inputdir D:\fatfs_root\ --outfile mytest.fatfs
</pre></div>
2025-07-22 11:15:46 +08:00
<p class="- topic/p p" data-ofbid="d173594e326__20250519091524">与格式化指定大小的磁盘的操作类似,需要复制填充资源文件。</p>
2025-04-23 17:54:31 +08:00
<ul class="- topic/ul ul" id="mkfs_partition_image__ul_xb1_msq_pdc" data-ofbid="mkfs_partition_image__ul_xb1_msq_pdc">
2025-07-22 11:15:46 +08:00
<li class="- topic/li li" data-ofbid="d173594e331__20250519091524">
<p class="- topic/p p" data-ofbid="d173594e333__20250519091524">由于设置了 <span class="+ topic/keyword pr-d/parmname keyword parmname">imgsize</span> 为 100
2025-01-23 16:37:00 +08:00
MB因此生成的镜像文件大小为 100 MB可以将该镜像文件烧录到 100 MB 的磁盘分区。</p>
2025-04-23 17:54:31 +08:00
</li>
2025-07-22 11:15:46 +08:00
<li class="- topic/li li" data-ofbid="d173594e340__20250519091524">
<div class="- topic/p p" data-ofbid="d173594e342__20250519091524">如果实际资源大小不足 100 MB工具会自动在镜像文件后面填充 0。如果不需要填充可以去掉命令参数中的
2025-01-23 16:37:00 +08:00
<span class="+ topic/keyword sw-d/cmdname keyword cmdname">--raw</span>,此时生成的镜像文件仅保留必要数据部分。详细示例如下:<div style="margin-bottom: 0;"><strong>Linux</strong></div><pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="mkfs_partition_image__codeblock_wfh_nsq_pdc" data-ofbid="mkfs_partition_image__codeblock_wfh_nsq_pdc">python3 ./tools/scripts/makefatfs.py --imgsize <span class="hl-number">104857600</span> --cluster <span class="hl-number">8</span> --sector <span class="hl-number">512</span> --tooldir ./tools/scripts/ --inputdir ~/fatfs_root/ --outfile mytest.fatfs</pre><div style="margin-bottom: 0;"><strong>Windows</strong></div><pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="mkfs_partition_image__codeblock_knh_dqq_gdc" data-ofbid="mkfs_partition_image__codeblock_knh_dqq_gdc">python tools\scripts\makefatfs.py --imgsize <span class="hl-number">104857600</span> --cluster <span class="hl-number">8</span> --sector <span class="hl-number">512</span> --tooldir tools\scripts\ --inputdir D:\fatfs_root\ --outfile mytest.fatfs</pre></div>
2025-04-23 17:54:31 +08:00
</li>
</ul>
</li>
</ul></div>
</li>
</ol>
2025-01-23 16:37:00 +08:00
</div>
2025-04-23 17:54:31 +08:00
</section>
<section class="- topic/section section" id="mkfs_partition_image__id3" data-ofbid="mkfs_partition_image__id3"><h2 class="- topic/title title sectiontitle">FATFS 镜像格式说明</h2>
2025-01-23 16:37:00 +08:00
2025-07-22 11:15:46 +08:00
<p class="- topic/p p" data-ofbid="d173594e365__20250519091524">按照<a class="- topic/xref xref" href="mkfs_partition_image.html#mkfs_partition_image__section_u5z_cqq_gdc">制作 FATFS 镜像</a>的流程,会生成一个 FATFS 镜像,其格式取决于指定的镜像大小,详情如下:</p>
2025-04-23 17:54:31 +08:00
<div class="table-container"><table class="- topic/table table longtable colwidths-given docutils align-default frame-all" id="mkfs_partition_image__id5" data-ofbid="mkfs_partition_image__id5" data-cols="3"><caption class="- topic/title title tablecap" data-caption-side="top" data-is-repeated="true"><span class="table--title-label"><span class="table--title-label-number"> 2</span><span class="table--title-label-punctuation">. </span></span><span class="table--title">FATFS 格式</span></caption><colgroup><col style="width:23.364485981308412%"/><col style="width:35.981308411214954%"/><col style="width:40.654205607476634%"/></colgroup><thead class="- topic/thead thead">
<tr class="- topic/row">
2025-07-22 11:15:46 +08:00
<th class="- topic/entry entry colsep-1 rowsep-1" id="mkfs_partition_image__id5__entry__1"><p class="- topic/p p" data-ofbid="d173594e390__20250519091524">文件系统</p></th>
<th class="- topic/entry entry colsep-1 rowsep-1" id="mkfs_partition_image__id5__entry__2"><p class="- topic/p p" data-ofbid="d173594e394__20250519091524">镜像大小</p></th>
<th class="- topic/entry entry colsep-0 rowsep-1" id="mkfs_partition_image__id5__entry__3"><p class="- topic/p p" data-ofbid="d173594e398__20250519091524">说明</p></th>
2025-04-23 17:54:31 +08:00
</tr>
</thead><tbody class="- topic/tbody tbody">
<tr class="- topic/row">
2025-07-22 11:15:46 +08:00
<td class="- topic/entry entry colsep-1 rowsep-1" headers="mkfs_partition_image__id5__entry__1"><p class="- topic/p p" data-ofbid="d173594e408__20250519091524">FAT12</p></td>
<td class="- topic/entry entry colsep-1 rowsep-1" headers="mkfs_partition_image__id5__entry__2"><p class="- topic/p p" data-ofbid="d173594e412__20250519091524">Size ≤ 16 MB</p></td>
<td class="- topic/entry entry colsep-0 rowsep-1" headers="mkfs_partition_image__id5__entry__3"><p class="- topic/p p" data-ofbid="d173594e416__20250519091524">生成 FAT12 文件系统镜像</p></td>
2025-04-23 17:54:31 +08:00
</tr>
<tr class="- topic/row">
2025-07-22 11:15:46 +08:00
<td class="- topic/entry entry colsep-1 rowsep-1" headers="mkfs_partition_image__id5__entry__1"><p class="- topic/p p" data-ofbid="d173594e423__20250519091524">FAT16</p></td>
<td class="- topic/entry entry colsep-1 rowsep-1" headers="mkfs_partition_image__id5__entry__2"><p class="- topic/p p" data-ofbid="d173594e427__20250519091524">16 MB &lt; Size ≤ 256 MB</p></td>
<td class="- topic/entry entry colsep-0 rowsep-1" headers="mkfs_partition_image__id5__entry__3"><p class="- topic/p p" data-ofbid="d173594e431__20250519091524">生成 FAT16 文件系统镜像</p></td>
2025-04-23 17:54:31 +08:00
</tr>
<tr class="- topic/row">
2025-07-22 11:15:46 +08:00
<td class="- topic/entry entry colsep-1 rowsep-0" headers="mkfs_partition_image__id5__entry__1"><p class="- topic/p p" data-ofbid="d173594e438__20250519091524">FAT32</p></td>
<td class="- topic/entry entry colsep-1 rowsep-0" headers="mkfs_partition_image__id5__entry__2"><p class="- topic/p p" data-ofbid="d173594e442__20250519091524">Size &gt; 256 MB</p></td>
<td class="- topic/entry entry colsep-0 rowsep-0" headers="mkfs_partition_image__id5__entry__3"><p class="- topic/p p" data-ofbid="d173594e446__20250519091524">生成 FAT32 文件系统镜像</p></td>
2025-04-23 17:54:31 +08:00
</tr>
</tbody></table></div>
</section>
<section class="- topic/section section" id="mkfs_partition_image__littlefs" data-ofbid="mkfs_partition_image__littlefs"><h2 class="- topic/title title sectiontitle">制作 LittleFS 镜像</h2>
2025-01-23 16:37:00 +08:00
2025-07-22 11:15:46 +08:00
<div class="- topic/p p" data-ofbid="d173594e460__20250519091524">以制作一个 10 MB 的 LittleFS 镜像文件为例,详细步骤如下所示:<ol class="- topic/ol ol" id="mkfs_partition_image__ol_cwg_jqq_gdc" data-ofbid="mkfs_partition_image__ol_cwg_jqq_gdc">
<li class="- topic/li li" data-ofbid="d173594e464__20250519091524">
<p class="- topic/p p" data-ofbid="d173594e466__20250519091524">确保编译主机上已经安装 <code class="+ topic/ph pr-d/codeph ph codeph">Python3</code> 并进入 <span class="- topic/ph ph">Luban-Lite</span> SDK 的
2025-01-23 16:37:00 +08:00
<span class="+ topic/ph sw-d/filepath ph filepath">tools/scripts/</span> 目录。</p>
2025-04-23 17:54:31 +08:00
</li>
2025-07-22 11:15:46 +08:00
<li class="- topic/li li" data-ofbid="d173594e479__20250519091524">
<div class="- topic/p p" data-ofbid="d173594e481__20250519091524">将需要打包的文件/文件夹,放到一个独立的文件夹内,例如:<ul class="- topic/ul ul" id="mkfs_partition_image__ul_cqj_hrb_wcc" data-ofbid="mkfs_partition_image__ul_cqj_hrb_wcc">
<li class="- topic/li li" data-ofbid="d173594e485__20250519091524">Linux: <span class="+ topic/ph sw-d/filepath ph filepath">~/littlefs_root/</span></li>
<li class="- topic/li li" data-ofbid="d173594e490__20250519091524">windows: <span class="+ topic/ph sw-d/filepath ph filepath">\littlefs_root\</span></li>
2025-04-23 17:54:31 +08:00
</ul></div>
</li>
2025-07-22 11:15:46 +08:00
<li class="- topic/li li" data-ofbid="d173594e497__20250519091524">
<div class="- topic/p p" data-ofbid="d173594e499__20250519091524">执行下列命令。<div style="margin-bottom: 0;"><strong>Windows</strong></div><pre class="+ topic/pre pr-d/codeblock pre codeblock Windows" id="mkfs_partition_image__codeblock_ywb_kqq_gdc" data-ofbid="mkfs_partition_image__codeblock_ywb_kqq_gdc"><code>python tools\scripts\makelittlefs.py --imgsize 10485760 --pagesize 256 --blocksize 4096 --tooldir tools\scripts\ --inputdir ~\littlefs_root\ --outfile mytest.lfs</code></pre><div style="margin-bottom: 0;"><strong>Linux</strong></div><pre class="+ topic/pre pr-d/codeblock pre codeblock Linux" id="mkfs_partition_image__codeblock_wvv_mqq_pdc" data-ofbid="mkfs_partition_image__codeblock_wvv_mqq_pdc"><code>python3 ./tools/scripts/makefatfs.py --auto --cluster 8 --sector 512 --tooldir ./tools/scripts/ --inputdir ~/fatfs_root/ --outfile mytest.fatfs</code></pre></div>
2025-04-23 17:54:31 +08:00
</li>
</ol></div>
</section>
</div>
</article></main></div>
2025-01-23 16:37:00 +08:00
</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="#mkfs_partition_image__section_bxm_cqf_c2c" data-tocid="mkfs_partition_image__section_bxm_cqf_c2c">安装资源文件</a></div></li><li class="section-item"><div class="section-title"><a href="#mkfs_partition_image__section_u5z_cqq_gdc" data-tocid="mkfs_partition_image__section_u5z_cqq_gdc">制作 FATFS 镜像</a></div></li><li class="section-item"><div class="section-title"><a href="#mkfs_partition_image__id3" data-tocid="mkfs_partition_image__id3">FATFS 镜像格式说明</a></div></li><li class="section-item"><div class="section-title"><a href="#mkfs_partition_image__littlefs" data-tocid="mkfs_partition_image__littlefs">制作 LittleFS 镜像</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>
2025-04-23 17:54:31 +08:00
<style>
2025-01-23 16:37:00 +08:00
.p1 {
font-family: FangZhengShuSong, Times, serif;
}
.p2 {
font-family: Arial, Helvetica, sans-serif;
}
.p3 {
font-family: "Lucida Console", "Courier New", monospace;
}
2025-04-23 17:54:31 +08:00
</style>
2025-01-23 16:37:00 +08:00
<div class="webhelp.fragment.footer">
2025-04-23 17:54:31 +08:00
<p class="p1">Copyright © 2019-2025 广东匠芯创科技有限公司. All rights reserved.</p>
</div>
<div>
2025-01-23 16:37:00 +08:00
<div class="generation_time">
2025-07-22 11:15:46 +08:00
Update Time: 2025-05-19
2025-01-23 16:37:00 +08:00
</div>
2025-04-23 17:54:31 +08:00
</div>
2025-01-23 16:37:00 +08:00
</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>