mgnv
mgnv (mgnv) is a tool to read/write the non-volatile configuration data.
Version: 2.0
Status: Done
Description
If you want to know the inner workings of the configuration storage, including the map of the known configuration items, see NVRAM page.
Usage
mgnv -b <filename>
Backup 1000 byte NV config to <filename>. Include %03d in file
to get config numbering.
Example:
mgnv -b config-%03d.bin
mgnv -r <filename>
Restore 1000 byte NV config from <filename>.
Example:
mgnv -r config-012.bin
mgnv <format> <field1> [<field2> [... [<fieldN>]]]
Read value from NV config data and print as formatted string.
Fields must be in the following format: {b|w|s}:<address>
Example:
mgnv "%d.%d.%d.%d= %s" b:223 b:222 b:221 b:220 s:316
will output something like this:
192.168.0.4 = /tftpboot/mg35/romfs.m35
mgnv {b|w|s}:<address>=<value>
Write bytes, words or strings to NV config.
Example 1:
mgnv b:172=1
will write byte to offset 172 in config.
Example 2:
mgnv b:223=192 b:222=168 b:221=1 b:220=1
will update the TFTP server IP address.
Note that mgnv doesn't (yet) enforce the NV config format. It will read and write what you tell it to, including writing strings to spaces that are too small for them. Use with caution.
Download
Build procedure
License
Copyright (C) 2008, John <gardez@users.sf.net>
Copyright (C) 2007, Gadgetmind
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Todo
- Finish backup, restore, template commands
History
- Version 2.0 [2008, John]
- Split out flash/config writing into separate libraries
- Integrated standard, extended configuration into single app
- Added basic structures for backup, restore, templates, etc.
- Version 1.0 [2007, Gadgetmind]
- First simple interface to read/write NVRAM
- Fails randomly and at inopportune moments
Comments
Comments (0)
You don't have permission to comment on this page.