You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

180 lines
13 KiB

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libubootenv: fw_env_config</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">libubootenv
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
</div><!-- top -->
<div class="PageDoc"><div class="header">
<div class="headertitle">
<div class="title">fw_env_config </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><h1>fw_env.config Configuration File- Legacy format </h1>
<p>This is the configuration file for fw_{printenv,setenv} utility. It was defined in U-Boot project and it is defined here as legacy format.</p>
<p>Up to two entries are valid, in this case the redundant environment sector is assumed present. Notice, that the "Number of Sectors" is not required on NOR and SPI dataflash. Futhermore, if the Flash Sector Size is omitted, this value is assumed to be the same as the Environment Size, which is valid for NOR and SPI dataflash. Device Offset must be prefixed with 0x to be parsed as a hexadecimal value.</p>
<h2>Structure of the Configuration File </h2>
<p>Entries must be separated by spaces or tabs.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadNone">Device Name </th><th class="markdownTableHeadNone">Device Offset </th><th class="markdownTableHeadNone">Environment Size </th><th class="markdownTableHeadNone">Flash Sector Size </th><th class="markdownTableHeadNone">Number of Sectors </th><th class="markdownTableHeadNone">Disable Lock Mechanism </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone"></td><td class="markdownTableBodyNone"></td><td class="markdownTableBodyNone"></td><td class="markdownTableBodyNone"></td><td class="markdownTableBodyNone"></td><td class="markdownTableBodyNone"></td></tr>
</table>
<ul>
<li>Device Name: device or file where environment is stored (mandatory)</li>
<li>Device Offset: offset from start of file or device (mandatory)</li>
<li>Environment Size: size of environment (in bytes)</li>
<li>Flash Sector Size: (optional) if not set, it is read from kernel</li>
<li>Number of Sectors: (optional) number of sectors for environment (mainly used with raw NAND)</li>
<li>Disable Lock Mechanism : (optional), 0|1, default=0 (LOCK enabled)</li>
</ul>
<h2>NOR Example </h2>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadNone">Device Name </th><th class="markdownTableHeadNone">Device Offset </th><th class="markdownTableHeadNone">Environment Size </th><th class="markdownTableHeadNone">Flash Sector Size </th><th class="markdownTableHeadNone">Number of Sectors </th><th class="markdownTableHeadNone">Disable Lock Mechanism </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone">/dev/mtd1 </td><td class="markdownTableBodyNone">0x0 </td><td class="markdownTableBodyNone">0x4000 </td><td class="markdownTableBodyNone">0x4000 </td><td class="markdownTableBodyNone"></td><td class="markdownTableBodyNone"></td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone">/dev/mtd2 </td><td class="markdownTableBodyNone">0x0 </td><td class="markdownTableBodyNone">0x4000 </td><td class="markdownTableBodyNone">0x4000 </td><td class="markdownTableBodyNone"></td><td class="markdownTableBodyNone"></td></tr>
</table>
<h2>MTD SPI Dataflash Example </h2>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadNone">Device Name </th><th class="markdownTableHeadNone">Device Offset </th><th class="markdownTableHeadNone">Environment Size </th><th class="markdownTableHeadNone">Flash Sector Size </th><th class="markdownTableHeadNone">Number of Sectors </th><th class="markdownTableHeadNone">Disable Lock Mechanism </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone">/dev/mtd5 </td><td class="markdownTableBodyNone">0x4200 </td><td class="markdownTableBodyNone">0x4000 </td><td class="markdownTableBodyNone"></td><td class="markdownTableBodyNone"></td><td class="markdownTableBodyNone"></td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone">/dev/mtd6 </td><td class="markdownTableBodyNone">0x4200 </td><td class="markdownTableBodyNone">0x4000 </td><td class="markdownTableBodyNone"></td><td class="markdownTableBodyNone"></td><td class="markdownTableBodyNone"></td></tr>
</table>
<h2>NAND Example </h2>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadNone">Device Name </th><th class="markdownTableHeadNone">Device Offset </th><th class="markdownTableHeadNone">Environment Size </th><th class="markdownTableHeadNone">Flash Sector Size </th><th class="markdownTableHeadNone">Number of Sectors </th><th class="markdownTableHeadNone">Disable Lock Mechanism </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone">/dev/mtd0 </td><td class="markdownTableBodyNone">0x4000 </td><td class="markdownTableBodyNone">0x4000 </td><td class="markdownTableBodyNone">0x20000 </td><td class="markdownTableBodyNone">2 </td><td class="markdownTableBodyNone"></td></tr>
</table>
<h2>Block Device Example </h2>
<p>On a block device a negative offset is treated as a backwards offset from the end of the device/partition, rather than a forwards offset from the start.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadNone">Device Name </th><th class="markdownTableHeadNone">Device Offset </th><th class="markdownTableHeadNone">Environment Size </th><th class="markdownTableHeadNone">Flash Sector Size </th><th class="markdownTableHeadNone">Number of Sectors </th><th class="markdownTableHeadNone">Disable Lock Mechanism </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone">/dev/mmcblk0 </td><td class="markdownTableBodyNone">0xC0000 </td><td class="markdownTableBodyNone">0x20000 </td><td class="markdownTableBodyNone"></td><td class="markdownTableBodyNone"></td><td class="markdownTableBodyNone"></td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone">/dev/mmcblk0 </td><td class="markdownTableBodyNone">-0x20000 </td><td class="markdownTableBodyNone">0x20000 </td><td class="markdownTableBodyNone"></td><td class="markdownTableBodyNone"></td><td class="markdownTableBodyNone"></td></tr>
</table>
<h2>VFAT Example </h2>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadNone">Device Name </th><th class="markdownTableHeadNone">Device Offset </th><th class="markdownTableHeadNone">Environment Size </th><th class="markdownTableHeadNone">Flash Sector Size </th><th class="markdownTableHeadNone">Number of Sectors </th><th class="markdownTableHeadNone">Disable Lock Mechanism </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone">/boot/uboot.env </td><td class="markdownTableBodyNone">0x0 </td><td class="markdownTableBodyNone">0x4000 </td><td class="markdownTableBodyNone"></td><td class="markdownTableBodyNone"></td><td class="markdownTableBodyNone"></td></tr>
</table>
<h2>UBI Volume Example </h2>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadNone">Device Name </th><th class="markdownTableHeadNone">Device Offset </th><th class="markdownTableHeadNone">Environment Size </th><th class="markdownTableHeadNone">Flash Sector Size </th><th class="markdownTableHeadNone">Number of Sectors </th><th class="markdownTableHeadNone">Disable Lock Mechanism </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone">/dev/ubi0_0 </td><td class="markdownTableBodyNone">0x0 </td><td class="markdownTableBodyNone">0x1f000 </td><td class="markdownTableBodyNone">0x1f000 </td><td class="markdownTableBodyNone"></td><td class="markdownTableBodyNone"></td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone">/dev/ubi0_1 </td><td class="markdownTableBodyNone">0x0 </td><td class="markdownTableBodyNone">0x1f000 </td><td class="markdownTableBodyNone">0x1f000 </td><td class="markdownTableBodyNone"></td><td class="markdownTableBodyNone"></td></tr>
</table>
<h2>UBI Volume by Name Example </h2>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadNone">Device Name </th><th class="markdownTableHeadNone">Device Offset </th><th class="markdownTableHeadNone">Environment Size </th><th class="markdownTableHeadNone">Flash Sector Size </th><th class="markdownTableHeadNone">Number of Sectors </th><th class="markdownTableHeadNone">Disable Lock Mechanism </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone">/dev/ubi0:env </td><td class="markdownTableBodyNone">0x0 </td><td class="markdownTableBodyNone">0x1f000 </td><td class="markdownTableBodyNone">0x1f000 </td><td class="markdownTableBodyNone"></td><td class="markdownTableBodyNone"></td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone">/dev/ubi0:redund </td><td class="markdownTableBodyNone">0x0 </td><td class="markdownTableBodyNone">0x1f000 </td><td class="markdownTableBodyNone">0x1f000 </td><td class="markdownTableBodyNone"></td><td class="markdownTableBodyNone"></td></tr>
</table>
<h1>Configuration File in YAML </h1>
<p>A YAML format is defined to allow multiple sets of variable. This lets have same features (redundancy, power-cut safe) for environment that are not bound to the U-Boot bootloader.</p>
<div class="fragment"><div class="line">uboot:</div>
<div class="line"> size : 0x4000</div>
<div class="line"> lockfile : /var/lock/fw_printenv.lock</div>
<div class="line"> devices:</div>
<div class="line"> - path : /dev/mtd0</div>
<div class="line"> offset : 0xA0000</div>
<div class="line"> sectorsize : 0x10000</div>
<div class="line"> unlock : yes</div>
<div class="line"> - path : /dev/mtd0</div>
<div class="line"> offset : 0xB0000</div>
<div class="line"> sectorsize : 0x10000</div>
<div class="line"> disable-lock : yes</div>
<div class="line"> </div>
<div class="line">appvar:</div>
<div class="line"> size : 0x4000</div>
<div class="line"> lockfile : /var/lock/appvar.lock</div>
<div class="line"> devices:</div>
<div class="line"> - path : /dev/mtd1</div>
<div class="line"> offset : 0</div>
<div class="line"> sectorsize : 0x10000</div>
<div class="line"> unlock : yes</div>
<div class="line"> - path : /dev/mtd1</div>
<div class="line"> offset : 0x10000</div>
<div class="line"> sectorsize : 0x10000</div>
</div><!-- fragment --> </div></div><!-- contents -->
</div><!-- PageDoc -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>