📄 persistent-state-flash.html
字号:
<!-- Copyright (C) 2003 Red Hat, Inc. -->
<!-- This material may be distributed only subject to the terms -->
<!-- and conditions set forth in the Open Publication License, v1.0 -->
<!-- or later (the latest version is presently available at -->
<!-- http://www.opencontent.org/openpub/). -->
<!-- Distribution of the work or derivative of the work in any -->
<!-- standard (paper) book form is prohibited unless prior -->
<!-- permission is obtained from the copyright holder. -->
<HTML
><HEAD
><TITLE
>Persistent State Flash-based Configuration and Control</TITLE
><meta name="MSSmartTagsPreventParsing" content="TRUE">
<META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="eCos Reference Manual"
HREF="ecos-ref.html"><LINK
REL="UP"
TITLE="RedBoot Commands and Examples"
HREF="redboot-commands-and-examples.html"><LINK
REL="PREVIOUS"
TITLE="fis write"
HREF="fis-write-command.html"><LINK
REL="NEXT"
TITLE="Executing Programs from RedBoot"
HREF="executing-programs.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>eCos Reference Manual</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="fis-write-command.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 2. RedBoot Commands and Examples</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="executing-programs.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="PERSISTENT-STATE-FLASH">Persistent State Flash-based Configuration and Control</H1
><P
></P
><P
>RedBoot provides flash management support for storage in the flash memory
of multiple executable images and of non-volatile information such as IP addresses
and other network information.</P
><P
>RedBoot on platforms that support flash based configuration information
will report the following message the first time that RedBoot is booted on
the target:</P
><TABLE
BORDER="5"
BGCOLOR="#E0E0F0"
WIDTH="70%"
><TR
><TD
><PRE
CLASS="SCREEN"
>flash configuration checksum error or invalid key</PRE
></TD
></TR
></TABLE
><P
>This error can be ignored if no flash based configuration is desired,
or can be silenced by running the <B
CLASS="COMMAND"
>fconfig</B
>
command as described below. At this point you may also wish to run the <B
CLASS="COMMAND"
>fis init</B
> command. See other fis commands in <A
HREF="flash-image-system.html"
>the Section called <I
>Flash Image System (FIS)</I
></A
>.</P
><P
>Certain control and configuration information used by RedBoot can be
stored in flash. </P
><P
>The details of what information is maintained in flash differ, based
on the platform and the configuration. However, the basic operation used to
maintain this information is the same. Using the <B
CLASS="COMMAND"
>fconfig -l</B
> command, the information may be displayed and/or changed.</P
><P
>If the optional flag <TT
CLASS="COMPUTEROUTPUT"
>-i</TT
> is specified,
then the configuration database will be reset to its default
state. This is also needed the first time RedBoot is installed on the
target, or when updating to a newer RedBoot with different
configuration keys.</P
><P
>If the optional flag <TT
CLASS="COMPUTEROUTPUT"
>-l</TT
> is specified,
the configuration data is simply listed. Otherwise, each configuration parameter
will be displayed and you are given a chance to change it. The entire value
must be typed - typing just carriage return will leave a value unchanged.
Boolean values may be entered using the first letter (<TT
CLASS="COMPUTEROUTPUT"
>t</TT
>
for true, <TT
CLASS="COMPUTEROUTPUT"
>f</TT
> for false). At any time the editing
process may be stopped simply by entering a period (.) on the line. Entering
the caret (^) moves the editing back to the previous item. See “RedBoot
Editing Commands”, <A
HREF="redboot-editing-commands.html"
>the Section called <I
>RedBoot Editing Commands</I
> in Chapter 1</A
>. </P
><P
>If any changes are made in the configuration, then the updated data
will be written back to flash after getting acknowledgment from the user.</P
><P
>If the optional flag <TT
CLASS="COMPUTEROUTPUT"
>-n</TT
> is specified
(with or without <TT
CLASS="COMPUTEROUTPUT"
>-l</TT
>) then “nicknames”
of the entries are used. These are shorter and less descriptive than
“full” names. The full name may also be displayed by adding the
<TT
CLASS="COMPUTEROUTPUT"
>-f</TT
> flag.</P
><P
>The reason for telling you nicknames is that a quick way to set a single
entry is provided, using the format
<TABLE
BORDER="5"
BGCOLOR="#E0E0F0"
WIDTH="70%"
><TR
><TD
><PRE
CLASS="SCREEN"
> RedBoot> <TT
CLASS="USERINPUT"
><B
>fconfig <TT
CLASS="REPLACEABLE"
><I
>nickname</I
></TT
> <TT
CLASS="REPLACEABLE"
><I
>value</I
></TT
></B
></TT
></PRE
></TD
></TR
></TABLE
>
If no
value is supplied, the command will list and prompt for only that entry.
If a value is supplied, then the entry will be set to that value. You will
be prompted whether to write the new information into flash if any change
was made. For example
<TABLE
BORDER="5"
BGCOLOR="#E0E0F0"
WIDTH="70%"
><TR
><TD
><PRE
CLASS="SCREEN"
> RedBoot> <TT
CLASS="USERINPUT"
><B
>fconfig -l -n</B
></TT
>
boot_script: false
bootp: false
bootp_my_ip: 10.16.19.176
bootp_server_ip: 10.16.19.66
dns_ip: 10.16.19.1
gdb_port: 9000
net_debug: false
RedBoot> <TT
CLASS="USERINPUT"
><B
>fconfig bootp_my_ip 10.16.19.177</B
></TT
>
bootp_my_ip: 10.16.19.176 Setting to 10.16.19.177
Update RedBoot non-volatile configuration - continue (y/n)? <TT
CLASS="USERINPUT"
><B
>y</B
></TT
>
... Unlock from 0x507c0000-0x507e0000: .
... Erase from 0x507c0000-0x507e0000: .
... Program from 0x0000a8d0-0x0000acd0 at 0x507c0000: .
... Lock from 0x507c0000-0x507e0000: .
RedBoot></PRE
></TD
></TR
></TABLE
></P
><P
>Additionally, nicknames can be used like aliases via the format %{nickname}.
This allows the values stored by <TT
CLASS="USERINPUT"
><B
>fconfig</B
></TT
> to be used
directly by scripts and commands.</P
><P
>Depending on how your terminal program is connected and its
capabilities, you might find that you are unable to use line-editing to
delete the ‘old’ value when using the default behaviour of
<B
CLASS="COMMAND"
>fconfig <TT
CLASS="REPLACEABLE"
><I
>nickname</I
></TT
></B
> or just
plain <B
CLASS="COMMAND"
>fconfig</B
>, as shown in this example:
<TABLE
BORDER="5"
BGCOLOR="#E0E0F0"
WIDTH="70%"
><TR
><TD
><PRE
CLASS="SCREEN"
>RedBoot> <TT
CLASS="USERINPUT"
><B
>fco bootp</B
></TT
>
bootp: false_</PRE
></TD
></TR
></TABLE
>
The user deletes the word “false;” and enters “true”
so the display looks like this:
<TABLE
BORDER="5"
BGCOLOR="#E0E0F0"
WIDTH="70%"
><TR
><TD
><PRE
CLASS="SCREEN"
>RedBoot> <TT
CLASS="USERINPUT"
><B
>fco bootp</B
></TT
>
bootp: <TT
CLASS="USERINPUT"
><B
>true</B
></TT
>
Update RedBoot non-volatile configuration - continue (y/n)? y
... Unlock from ...
RedBoot> _</PRE
></TD
></TR
></TABLE
></P
><P
>To edit when you cannot backspace, use the optional flag
<TT
CLASS="COMPUTEROUTPUT"
>-d</TT
> (for “dumb terminal”)
to provide a simpler interface thus:
<TABLE
BORDER="5"
BGCOLOR="#E0E0F0"
WIDTH="70%"
><TR
><TD
><PRE
CLASS="SCREEN"
>RedBoot> <TT
CLASS="USERINPUT"
><B
>fco -d bootp</B
></TT
>
bootp: false ? _</PRE
></TD
></TR
></TABLE
>
and you enter the value in the obvious manner thus:
<TABLE
BORDER="5"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -