summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Kraft <george.kraft@calxeda.com>2012-07-17 15:21:05 -0500
committerGeorge Kraft <george.kraft@calxeda.com>2012-07-17 15:21:05 -0500
commit7a1b39c070c6940900ee83ce364ed426de1f80ec (patch)
tree29288314aecf66056aa47636b16237308b67ce44
parent45d496594966324e52799abe49f900b07eca09e0 (diff)
downloadcxmanage-7a1b39c070c6940900ee83ce364ed426de1f80ec.tar.gz
infodump: Add u-boot environment to dump
-rw-r--r--cxmanage/infodump.py14
-rw-r--r--cxmanage/target.py7
2 files changed, 20 insertions, 1 deletions
diff --git a/cxmanage/infodump.py b/cxmanage/infodump.py
index 810628e..3c14c1b 100644
--- a/cxmanage/infodump.py
+++ b/cxmanage/infodump.py
@@ -51,6 +51,8 @@ def print_info_dump(work_dir, tftp, target):
firmware(work_dir, tftp, target)
fabric(work_dir, tftp, target)
+ print_ubootenv(work_dir, tftp, target)
+
print_cdb(target)
print_registers(target)
@@ -187,8 +189,18 @@ def fabric(work_dir, tftp, target):
value = ipmitool(target, 'cxoem fabric get %s node %i'
% (item, node_id))
print 'Node %i, %s: %s' % (node_id, item, value)
- print
+ print
+
+def print_ubootenv(work_dir, tftp, target):
+ print '[ U-Boot Environment ]'
+ try:
+ ubootenv = target.get_ubootenv(work_dir, tftp)
+ for variable in sorted(ubootenv.variables):
+ print '%s=%s' % (variable, ubootenv.variables[variable])
+ except Exception as e:
+ print '%s: %s' % (e.__class__.__name__, e)
+ print
def print_cdb(target, cids=None):
""" Print info for each CDB entry. """
diff --git a/cxmanage/target.py b/cxmanage/target.py
index 980a36f..4a8a7bd 100644
--- a/cxmanage/target.py
+++ b/cxmanage/target.py
@@ -323,6 +323,13 @@ class Target:
output = subprocess.check_output(command, stderr=subprocess.STDOUT)
return output.rstrip().lstrip()
+ def get_ubootenv(self, work_dir, tftp):
+ """ Get the active uboot environment """
+ fwinfo = self.get_firmware_info()
+ slot = self._get_slot(fwinfo, "UBOOTENV", "ACTIVE")
+
+ return self._download_ubootenv(work_dir, tftp, slot)
+
def _get_slot(self, fwinfo, image_type, slot_arg):
""" Get a slot for this image type based on the slot argument """
# Filter slots for this type