summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Kraft <george.kraft@calxeda.com>2013-06-24 15:18:02 -0500
committerGeorge Kraft <george.kraft@calxeda.com>2013-06-24 15:18:02 -0500
commitd2d8c251ef19981b021ae54cb24c25286cd95105 (patch)
tree0d93351c690d49fea03069db804a8f3be4f5dc0a
parent056b2d2f0166ea405dd3047f0aeb604f0c132736 (diff)
downloadcxmanage-d2d8c251ef19981b021ae54cb24c25286cd95105.tar.gz
CXMAN-205: Test TFTP download before doing firmware updates
Should ensure that TFTP communication is working before we start. We can't really test an upload, but uploads and downloads are pretty similar anyway. May want to add some kind of local crc32 check to verify that the downloaded image is actually valid.
-rw-r--r--cxmanage_api/image.py2
-rw-r--r--cxmanage_api/node.py4
2 files changed, 4 insertions, 2 deletions
diff --git a/cxmanage_api/image.py b/cxmanage_api/image.py
index 23642c4..87b73a0 100644
--- a/cxmanage_api/image.py
+++ b/cxmanage_api/image.py
@@ -152,7 +152,7 @@ class Image:
:rtype: boolean
"""
- if (self.type == "SOC_ELF"):
+ if (self.type == "SOC_ELF" and not self.simg):
try:
file_process = subprocess.Popen(["file", self.filename],
stdout=subprocess.PIPE)
diff --git a/cxmanage_api/node.py b/cxmanage_api/node.py
index 32f0a07..4908850 100644
--- a/cxmanage_api/node.py
+++ b/cxmanage_api/node.py
@@ -1403,7 +1403,9 @@ class Node(object):
raise PartitionInUseError(
"Can't upload to a CDB/BOOT_LOG partition that's in use")
- return True
+ # Try a TFTP download. Would try an upload too, but nowhere to put it.
+ partition = self._get_partition(fwinfo, "SOC_ELF", "FIRST")
+ self._download_image(partition)
def _get_next_priority(self, fwinfo, package):
""" Get the next priority """