summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Kraft <george.kraft@calxeda.com>2012-08-06 13:46:50 -0500
committerGeorge Kraft <george.kraft@calxeda.com>2012-08-06 13:46:50 -0500
commit3fac15889dec0f15a2ba10e79c799a7d160f3268 (patch)
tree0cadb6ee458729444da988f2669ce4740d9ca5c8
parent0340058a6bc73d3096fedf5bb609432b9d4e9ac9 (diff)
downloadcxmanage-3fac15889dec0f15a2ba10e79c799a7d160f3268.tar.gz
cxmanage: Add "info ubootenv" command
Downloads and prints the active u-boot environment on all targets.
-rw-r--r--cxmanage/controller.py19
-rwxr-xr-xscripts/cxmanage5
2 files changed, 23 insertions, 1 deletions
diff --git a/cxmanage/controller.py b/cxmanage/controller.py
index 4c7388e..defb984 100644
--- a/cxmanage/controller.py
+++ b/cxmanage/controller.py
@@ -496,6 +496,25 @@ class Controller:
return len(errors) > 0
+ def info_ubootenv(self):
+ """ Print u-boot environment for all targets """
+ results, errors = self._run_command("get_ubootenv", self.tftp)
+
+ # Print results
+ if len(results) > 0:
+ for target in self.targets:
+ if target.address in results:
+ ubootenv = results[target.address]
+ print "[ U-Boot Environment from %s ]" % target.address
+ for variable in ubootenv.variables:
+ print "%s=%s" % (variable, ubootenv.variables[variable])
+ print
+
+ # Print errors
+ self._print_errors(errors)
+
+ return len(errors) > 0
+
def info_dump(self):
""" Dump info from all targets """
for target in self.targets:
diff --git a/scripts/cxmanage b/scripts/cxmanage
index dd6cdc1..de0ca09 100755
--- a/scripts/cxmanage
+++ b/scripts/cxmanage
@@ -194,6 +194,7 @@ def build_parser():
help='info type to get', type=lambda string: string.lower(),
choices=list(sorted([
'basic',
+ 'ubootenv',
'dump'
])))
p['info'].set_defaults(func=info_command)
@@ -369,7 +370,9 @@ def info_command(controller, args):
"""print info from a cluster or host"""
if args.info_type in [None, 'basic']:
return controller.info_basic()
- if args.info_type == 'dump':
+ elif args.info_type == 'ubootenv':
+ return controller.info_ubootenv()
+ elif args.info_type == 'dump':
return controller.info_dump()
else:
return True