From ca042588ab0e57aaa406a8d84a71f715edf131d4 Mon Sep 17 00:00:00 2001 From: Ryan Roberts Date: Mon, 8 Jul 2024 10:53:25 +0100 Subject: [PATCH 1/3] docs: Move rtdbuild.py to the _scripts directory Let's keep this out of the way of the documentation source in the _scripts directory where other documenation scripts are kept. Signed-off-by: Ryan Roberts --- .gitlab-ci.yml | 6 +++--- documentation/{ => _scripts}/rtdbuild.py | 0 2 files changed, 3 insertions(+), 3 deletions(-) rename documentation/{ => _scripts}/rtdbuild.py (100%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7014b61..c2d61da 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -84,10 +84,10 @@ build-documentation: - pip3 install requests - | if [ ${CI_COMMIT_BRANCH} == ${CI_DEFAULT_BRANCH} ]; then - ./documentation/rtdbuild.py --domain https://readthedocs.com --token ${READTHEDOCS_TOKEN} --project ${READTHEDOCS_PROJECT} --branch latest --state active + ./documentation/_scripts/rtdbuild.py --domain https://readthedocs.com --token ${READTHEDOCS_TOKEN} --project ${READTHEDOCS_PROJECT} --branch latest --state active else - ./documentation/rtdbuild.py --domain https://readthedocs.com --token ${READTHEDOCS_TOKEN} --project ${READTHEDOCS_PROJECT} --branch main --state inactive - ./documentation/rtdbuild.py --domain https://readthedocs.com --token ${READTHEDOCS_TOKEN} --project ${READTHEDOCS_PROJECT} --branch ${CI_COMMIT_BRANCH} --state inactive + ./documentation/_scripts/rtdbuild.py --domain https://readthedocs.com --token ${READTHEDOCS_TOKEN} --project ${READTHEDOCS_PROJECT} --branch main --state inactive + ./documentation/_scripts/rtdbuild.py --domain https://readthedocs.com --token ${READTHEDOCS_TOKEN} --project ${READTHEDOCS_PROJECT} --branch ${CI_COMMIT_BRANCH} --state inactive fi prep-test-assets: diff --git a/documentation/rtdbuild.py b/documentation/_scripts/rtdbuild.py similarity index 100% rename from documentation/rtdbuild.py rename to documentation/_scripts/rtdbuild.py -- GitLab From 19282220fdc935d4834b4d6ceefdcb55f797c752 Mon Sep 17 00:00:00 2001 From: Ryan Roberts Date: Mon, 8 Jul 2024 11:23:31 +0100 Subject: [PATCH 2/3] docs: Fix genconfigstore.py to generate docs without hand-edits Previously some of the whitespace generated by genconfigstore.py wasn't quite as expected, which meant that the generated rsts were hand edited, then when running the tool subsequently, there would be spurious diffs against these hand edits. Let's fix that so that the tool is ully automatic and correct. Includes some updates generated rst files where they were previously inconsistent. Signed-off-by: Ryan Roberts --- config/cca-4world.yaml | 1 - documentation/_scripts/genconfigstore.py | 33 +++++++++++++------ .../userguide/configstore/bootwrapper.rst | 4 +-- .../userguide/configstore/ffa-tftf.rst | 18 +++++----- 4 files changed, 34 insertions(+), 22 deletions(-) diff --git a/config/cca-4world.yaml b/config/cca-4world.yaml index cbdb64e..5949c66 100644 --- a/config/cca-4world.yaml +++ b/config/cca-4world.yaml @@ -23,7 +23,6 @@ description: >- .. code-block:: shell # cat /sys/devices/arm-ffa-*/uuid - b4b5671e-4a90-4fe1-b81f-fb13dae1dacb d1582309-f023-47b9-827c-4464f5578fc8 79b55c73-1d8c-44b9-8593-61e1770ad8d2 diff --git a/documentation/_scripts/genconfigstore.py b/documentation/_scripts/genconfigstore.py index e8e32b0..c9f9192 100755 --- a/documentation/_scripts/genconfigstore.py +++ b/documentation/_scripts/genconfigstore.py @@ -22,26 +22,39 @@ def make_rst_table(headers, data): colwidths.append(colwidth) def track_str(colwidths): - return ' '.join(['=' * w for w in colwidths]) + '\n' + return ' '.join(['=' * w for w in colwidths]) def row_str(colwidths, data): - return ' '.join([f'{d:{w}}' for d, w in zip(data, colwidths)]) + '\n' + return ' '.join([f'{d:{w}}' for d, w in zip(data, colwidths)]) - table = '' - table += track_str(colwidths) - table += row_str(colwidths, headers) - table += track_str(colwidths) + table = [] + table.append(track_str(colwidths)) + table.append(row_str(colwidths, headers)) + table.append(track_str(colwidths)) for row in data: - table += row_str(colwidths, row) - table += track_str(colwidths) + table.append(row_str(colwidths, row)) + table.append(track_str(colwidths)) - return table + table = [r.rstrip() for r in table] + return '\n'.join(table) + '\n' def make_rst_table_from_dict(headers, data): return make_rst_table(headers, [(k, v) for k, v in data.items()]) +def fix_whitespace(text): + lines = [] + for line in text.splitlines(): + line = line.rstrip() + if not line.startswith((' ', '\t')): + line += '\n' + lines.append(line) + if (len(lines)): + lines[-1] = lines[-1].rstrip() + return '\n'.join(lines) + + index = """.. # Copyright (c) 2023, Arm Limited. # @@ -113,7 +126,7 @@ with open(os.path.join(docsdir, 'index.rst'), 'w') as indexf: '#' * len(c['name']), c['name'], '#' * len(c['name']), - c['description'].replace('\n', '\n\n'), + fix_whitespace(c['description']), c['concrete'], make_rst_table_from_dict(('btvar', 'default'), c['btvars']), make_rst_table_from_dict(('rtvar', 'default'), c['rtvars'])) diff --git a/documentation/userguide/configstore/bootwrapper.rst b/documentation/userguide/configstore/bootwrapper.rst index d17626b..a401f2f 100644 --- a/documentation/userguide/configstore/bootwrapper.rst +++ b/documentation/userguide/configstore/bootwrapper.rst @@ -33,8 +33,8 @@ Run-Time Variables ============== ======= rtvar default ============== ======= -LOCAL_NET_PORT 8022 -BOOTWRAPPER +LOCAL_NET_PORT 8022 +BOOTWRAPPER ROOTFS ============== ======= diff --git a/documentation/userguide/configstore/ffa-tftf.rst b/documentation/userguide/configstore/ffa-tftf.rst index d377cb6..308f74b 100644 --- a/documentation/userguide/configstore/ffa-tftf.rst +++ b/documentation/userguide/configstore/ffa-tftf.rst @@ -29,16 +29,16 @@ Run-Time Variables ################## ============== =============================================================== -rtvar default +rtvar default ============== =============================================================== -LOCAL_NET_PORT 8022 -BL1 ${artifact:BL1} -FIP ${artifact:FIP} -DTB ${artifact:DTB} +LOCAL_NET_PORT 8022 +BL1 ${artifact:BL1} +FIP ${artifact:FIP} +DTB ${artifact:DTB} CMDLINE console=ttyAMA0 earlycon=pl011,0x1c090000 root=/dev/vda ip=dhcp -KERNEL -ROOTFS -SHARE -EDK2FLASH ${artifact:EDK2FLASH} +KERNEL +ROOTFS +SHARE +EDK2FLASH ${artifact:EDK2FLASH} ============== =============================================================== -- GitLab From fdd7aa6588c635d50d9a572a1fcbcb9041c0532a Mon Sep 17 00:00:00 2001 From: Ryan Roberts Date: Mon, 8 Jul 2024 11:26:06 +0100 Subject: [PATCH 3/3] docs: Add configstore docs for ns-edk2-optee.yaml Auto-generated with genconfigstore.py. Signed-off-by: Ryan Roberts --- documentation/userguide/configstore/index.rst | 1 + .../userguide/configstore/ns-edk2-optee.rst | 44 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 documentation/userguide/configstore/ns-edk2-optee.rst diff --git a/documentation/userguide/configstore/index.rst b/documentation/userguide/configstore/index.rst index 252dc9d..c7c0f41 100644 --- a/documentation/userguide/configstore/index.rst +++ b/documentation/userguide/configstore/index.rst @@ -19,5 +19,6 @@ out-of-the-box: cca-3world.rst cca-4world.rst ffa-tftf.rst + ns-edk2-optee.rst ns-edk2.rst ns-preload.rst diff --git a/documentation/userguide/configstore/ns-edk2-optee.rst b/documentation/userguide/configstore/ns-edk2-optee.rst new file mode 100644 index 0000000..e388751 --- /dev/null +++ b/documentation/userguide/configstore/ns-edk2-optee.rst @@ -0,0 +1,44 @@ +.. + # Copyright (c) 2023, Arm Limited. + # + # SPDX-License-Identifier: MIT + +################## +ns-edk2-optee.yaml +################## + +Description +########### + +Brings together a software stack to demonstrate OPTEE in secure EL1 with TF-A in secure EL3 but without FF-A and secure EL2(Hafnium). Secure partition dispatcher exists inside OPTEE. + +Concrete +######## + +True + +Build-Time Variables +#################### + +===== ======= +btvar default +===== ======= +===== ======= + +Run-Time Variables +################## + +============== =============================================================== +rtvar default +============== =============================================================== +LOCAL_NET_PORT 8022 +BL1 ${artifact:BL1} +FIP ${artifact:FIP} +DTB ${artifact:DTB} +CMDLINE console=ttyAMA0 earlycon=pl011,0x1c090000 root=/dev/vda ip=dhcp +KERNEL +ROOTFS +SHARE +EDK2FLASH ${artifact:EDK2FLASH} +============== =============================================================== + -- GitLab