Index: .gitignore =================================================================== diff -u -raa972ea5f72fad9a83255715eada6731a9966a83 -r28ee439966c2b482352f1cadd913d558fcac2a05 --- .gitignore (.../.gitignore) (revision aa972ea5f72fad9a83255715eada6731a9966a83) +++ .gitignore (.../.gitignore) (revision 28ee439966c2b482352f1cadd913d558fcac2a05) @@ -1,50 +1,17 @@ -# These are some examples of commonly ignored file patterns. -# You should customize this list as applicable to your project. -# Learn more about .gitignore: -# https://www.atlassian.com/git/tutorials/saving-changes/gitignore - -# Node artifact files -node_modules/ -dist/ - -# Compiled Java class files -*.class - -# Compiled Python bytecode -*.py[cod] - -# Log files -*.log - -# Package files -*.jar - -# Maven -target/ -dist/ - -# JetBrains IDE +# Ignore folders +__pycache__/ +document/html/ +document/latex/ .idea/ +venv/ +.cache +# The reposfolder will be used to clone +# the software stack repositories +repos/ -# Unit test reports -TEST*.xml - -# Generated by MacOS -.DS_Store - -# Generated by Windows -Thumbs.db - -# Applications -*.app -*.exe -*.war - -# Large media files -*.mp4 -*.tiff -*.avi -*.flv -*.mov -*.wmv - +# Ignore files with these extensions +*.log +*.json +*.xlsx +*.~lock.* +*.ods Index: run.update_package.py =================================================================== diff -u --- run.update_package.py (revision 0) +++ run.update_package.py (revision 28ee439966c2b482352f1cadd913d558fcac2a05) @@ -0,0 +1,33 @@ + +from scripts.update_package_script.update_package import SoftwareUpdateScript +import sys +import time +sys.path.append("..") + +def main(): + + packages_directory = sys.argv[1] + input_arguments_status = True + + if packages_directory is '': + print("################################ PLEASE PROVIDE A WORKSPACE DIRECTORY ################################") # TODO update + input_arguments_status = False + + # If there is no project is defined (i.e HD, DG), exit + if sys.argv[2] is None: + print('################################ PLEASE SELECT A PROJECT! ######################################' + '######') # TODO update + input_arguments_status = False + + if input_arguments_status is True: + + stack = sys.argv[2] if sys.argv[2] != '' else None + + start = time.time() + update = SoftwareUpdateScript() + update.update_software_packages(packages_directory, stack) + print('Report Generation Time: {:.1f}s'.format(time.time() - start)) + + +if __name__ == "__main__": + main() Index: scripts/__init__.py =================================================================== diff -u --- scripts/__init__.py (revision 0) +++ scripts/__init__.py (revision 28ee439966c2b482352f1cadd913d558fcac2a05) @@ -0,0 +1 @@ \ No newline at end of file Index: scripts/base/__init__.py =================================================================== diff -u --- scripts/base/__init__.py (revision 0) +++ scripts/base/__init__.py (revision 28ee439966c2b482352f1cadd913d558fcac2a05) @@ -0,0 +1 @@ \ No newline at end of file Index: scripts/base/base.py =================================================================== diff -u --- scripts/base/base.py (revision 0) +++ scripts/base/base.py (revision 28ee439966c2b482352f1cadd913d558fcac2a05) @@ -0,0 +1,13 @@ + +import os +import shutil + +class Base: + + SW_UPDATE_FLASH_BUFFER_SIZE = 128 + SIGNATURE_START = "SIGNATURE_START===================" + SIGNATURE_END = "SIGNATURE_END===================" + + def __init__(self): + pass + Index: scripts/update_package_script/__init__.py =================================================================== diff -u --- scripts/update_package_script/__init__.py (revision 0) +++ scripts/update_package_script/__init__.py (revision 28ee439966c2b482352f1cadd913d558fcac2a05) @@ -0,0 +1 @@ \ No newline at end of file Index: scripts/update_package_script/update_package.py =================================================================== diff -u --- scripts/update_package_script/update_package.py (revision 0) +++ scripts/update_package_script/update_package.py (revision 28ee439966c2b482352f1cadd913d558fcac2a05) @@ -0,0 +1,31 @@ +import can +from scripts.base.base import Base + + +class SoftwareUpdateScript(Base): + + def __init__(self): + + super().__init__() + + def _verify_signature(self): + pass + + def _verify_key(self): + pass + + def _get_target_stack(self): + pass + + + def update_software_packages(self, packages_dir: str, stack_to_update: str = None): + # 1. Verify signature + # 2. Verify key + # 3. Read XML file for to find the packages to update + # 4. Decrypt the content + # 5. Send the data to bootloader + # 6. Wait for the bootloader to ack/nack or timeout after 3000 ms + # 7. Send the entire file + # 8. Show progress + pass + \ No newline at end of file