Review comments addressed

* Updated the default argument to create less noise with argument
  passing.
* Reworded ChangeLog to match MbedTLS documentation/ announcement
  requirements

Signed-off-by: Archana <archana.madhavan@silabs.com>
This commit is contained in:
Archana 2021-12-19 13:34:30 +05:30
parent 21b20c72d3
commit 4a9e02632a
No known key found for this signature in database
GPG Key ID: 0F162FC9DB6BE502
4 changed files with 13 additions and 12 deletions

View File

@ -1,6 +1,5 @@
Features Changes
* Add support for driver wrapper codegen 1.0. This autogenerates * The file library/psa_crypto_driver_wrappers.c is now generated
the file library/psa_crypto_driver_wrappers.c. Rev 1.0 does not from a template. In the future, the generation will support
support any additional templating. For further info on how to driver descriptions. For the time being, to customize this file,
patch into the psa_crypto_driver_wrappers.c refer see docs/proposed/psa-driver-wrappers-codegen-migration-guide.md
docs/proposed/psa-driver-wrappers-codegen-migration-guide.md

View File

@ -164,7 +164,6 @@ if(GEN_FILES)
COMMAND COMMAND
${MBEDTLS_PYTHON_EXECUTABLE} ${MBEDTLS_PYTHON_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/generate_driver_wrappers.py ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/generate_driver_wrappers.py
--mbedtls-root ${CMAKE_CURRENT_SOURCE_DIR}/..
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/generate_driver_wrappers.py ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/generate_driver_wrappers.py

View File

@ -323,7 +323,7 @@ psa_crypto_driver_wrappers.c: ../scripts/generate_driver_wrappers.py
psa_crypto_driver_wrappers.c: ../scripts/data_files/driver_templates/psa_crypto_driver_wrappers.c.jinja psa_crypto_driver_wrappers.c: ../scripts/data_files/driver_templates/psa_crypto_driver_wrappers.c.jinja
psa_crypto_driver_wrappers.c: psa_crypto_driver_wrappers.c:
echo " Gen $@" echo " Gen $@"
$(PYTHON) ../scripts/generate_driver_wrappers.py --mbedtls-root .. . $(PYTHON) ../scripts/generate_driver_wrappers.py
clean: clean:
ifndef WINDOWS ifndef WINDOWS

View File

@ -49,19 +49,22 @@ def generate_driver_wrapper_file(mbedtls_root: str, output_dir: str) -> None:
with open(os.path.join(output_dir, "psa_crypto_driver_wrappers.c"), 'w') as out_file: with open(os.path.join(output_dir, "psa_crypto_driver_wrappers.c"), 'w') as out_file:
out_file.write(result) out_file.write(result)
out_file.close()
def main() -> int: def main() -> int:
""" """
Main with command line arguments. Main with command line arguments.
""" """
def_arg_mbedtls_root = build_tree.guess_mbedtls_root()
def_arg_output_dir = os.path.join(def_arg_mbedtls_root, 'library')
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument('--mbedtls-root', nargs='?', default=None, parser.add_argument('--mbedtls-root', nargs='?', default=def_arg_mbedtls_root,
help='root directory of mbedtls source code') help='root directory of mbedtls source code')
parser.add_argument('output_directory', nargs='?', parser.add_argument('output_directory', nargs='?',
default='library', help='output file\'s location') default=def_arg_output_dir, help='output file\'s location')
args = parser.parse_args() args = parser.parse_args()
mbedtls_root = os.path.abspath(args.mbedtls_root or build_tree.guess_mbedtls_root())
mbedtls_root = os.path.abspath(args.mbedtls_root)
output_directory = args.output_directory output_directory = args.output_directory
generate_driver_wrapper_file(mbedtls_root, output_directory) generate_driver_wrapper_file(mbedtls_root, output_directory)