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

View file

@ -164,7 +164,6 @@ if(GEN_FILES)
COMMAND
${MBEDTLS_PYTHON_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/generate_driver_wrappers.py
--mbedtls-root ${CMAKE_CURRENT_SOURCE_DIR}/..
${CMAKE_CURRENT_BINARY_DIR}
DEPENDS
${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:
echo " Gen $@"
$(PYTHON) ../scripts/generate_driver_wrappers.py --mbedtls-root .. .
$(PYTHON) ../scripts/generate_driver_wrappers.py
clean:
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:
out_file.write(result)
out_file.close()
def main() -> int:
"""
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.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')
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()
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
generate_driver_wrapper_file(mbedtls_root, output_directory)