diff --git a/doc/developer-guides/doc_guidelines.rst b/doc/developer-guides/doc_guidelines.rst index 1e94d4d40..4e9153a89 100644 --- a/doc/developer-guides/doc_guidelines.rst +++ b/doc/developer-guides/doc_guidelines.rst @@ -741,12 +741,9 @@ example: .. code-block:: xml - - - Build an image for release (``y``) or debug (``n``). - In a **release** image, assertions are not enforced and debugging - features are disabled, including logs, serial console, and the - hypervisor shell. + + + Identify build type. Debug mode enables debug shell, prints, and logs. Release mode optimizes the ACRN binary for deployment and turns off all debug infrastructure. These can only be changed at build time. @@ -755,8 +752,8 @@ in the ``.xsd`` files are extracted and transformed into reStructuredText using an XSLT transformation found in ``doc/scripts/configdoc.xsl``. The generated option documentation is organized and formatted to make it easy to create links to specific option descriptions using an ``:option:`` role, for example, -``:option:`hv.DEBUG_OPTIONS.RELEASE``` would link to -:option:`hv.DEBUG_OPTIONS.RELEASE`. +``:option:`hv.DEBUG_OPTIONS.BUILD_TYPE``` would link to +:option:`hv.DEBUG_OPTIONS.BUILD_TYPE`. The transformed option documentation is created in the ``_build/rst/reference/configdoc.txt`` file and included by diff --git a/hypervisor/scripts/makefile/config.mk b/hypervisor/scripts/makefile/config.mk index 19a8b9828..24426b681 100644 --- a/hypervisor/scripts/makefile/config.mk +++ b/hypervisor/scripts/makefile/config.mk @@ -92,7 +92,11 @@ ifdef RELEASE ifneq ($(RELEASE),$(CONFIG_RELEASE)) $$(warning The command line sets RELEASE to be '$(RELEASE)', but an existing build is configured with '$(CONFIG_RELEASE)') $$(warning The configuration will be modified for RELEASE=$(RELEASE)) - $$(shell sed -i "s@\(\)[yn]\(\)@\1$(RELEASE)\2@g" $(HV_SCENARIO_XML)) + ifeq ($(RELEASE),y) + $$(shell sed -i "s@\(\).*\(\)@\1release\2@g" $(HV_SCENARIO_XML)) + else + $$(shell sed -i "s@\(\).*\(\)@\1debug\2@g" $(HV_SCENARIO_XML)) + endif endif endif else diff --git a/misc/config_tools/data/cfl-k700-i7/hybrid.xml b/misc/config_tools/data/cfl-k700-i7/hybrid.xml index 975d03c51..844fedf04 100644 --- a/misc/config_tools/data/cfl-k700-i7/hybrid.xml +++ b/misc/config_tools/data/cfl-k700-i7/hybrid.xml @@ -1,7 +1,7 @@ - n + debug /dev/ttyS0 5 5 diff --git a/misc/config_tools/data/cfl-k700-i7/hybrid_rt.xml b/misc/config_tools/data/cfl-k700-i7/hybrid_rt.xml index 0d329d179..85e2ae14f 100644 --- a/misc/config_tools/data/cfl-k700-i7/hybrid_rt.xml +++ b/misc/config_tools/data/cfl-k700-i7/hybrid_rt.xml @@ -1,7 +1,7 @@ - n + debug /dev/ttyS0 5 5 diff --git a/misc/config_tools/data/cfl-k700-i7/partitioned.xml b/misc/config_tools/data/cfl-k700-i7/partitioned.xml index f2297e51b..4ed1602f0 100644 --- a/misc/config_tools/data/cfl-k700-i7/partitioned.xml +++ b/misc/config_tools/data/cfl-k700-i7/partitioned.xml @@ -1,7 +1,7 @@ - n + debug /dev/ttyS0 5 5 diff --git a/misc/config_tools/data/cfl-k700-i7/shared.xml b/misc/config_tools/data/cfl-k700-i7/shared.xml index 726b4f05f..f2a79e781 100644 --- a/misc/config_tools/data/cfl-k700-i7/shared.xml +++ b/misc/config_tools/data/cfl-k700-i7/shared.xml @@ -1,7 +1,7 @@ - n + debug /dev/ttyS0 5 5 diff --git a/misc/config_tools/data/generic_board/hybrid.xml b/misc/config_tools/data/generic_board/hybrid.xml index d6b3fd8a6..3e2556557 100644 --- a/misc/config_tools/data/generic_board/hybrid.xml +++ b/misc/config_tools/data/generic_board/hybrid.xml @@ -1,7 +1,7 @@ - n + debug /dev/ttyS0 5 5 diff --git a/misc/config_tools/data/generic_board/hybrid_rt.xml b/misc/config_tools/data/generic_board/hybrid_rt.xml index 5ce6c4f8e..a1161a3b2 100644 --- a/misc/config_tools/data/generic_board/hybrid_rt.xml +++ b/misc/config_tools/data/generic_board/hybrid_rt.xml @@ -1,7 +1,7 @@ - n + debug /dev/ttyS0 5 5 diff --git a/misc/config_tools/data/generic_board/partitioned.xml b/misc/config_tools/data/generic_board/partitioned.xml index 960154afa..8f41a5a89 100644 --- a/misc/config_tools/data/generic_board/partitioned.xml +++ b/misc/config_tools/data/generic_board/partitioned.xml @@ -1,7 +1,7 @@ - n + debug /dev/ttyS0 5 5 diff --git a/misc/config_tools/data/generic_board/shared.xml b/misc/config_tools/data/generic_board/shared.xml index 879b106ee..a7315ae86 100644 --- a/misc/config_tools/data/generic_board/shared.xml +++ b/misc/config_tools/data/generic_board/shared.xml @@ -1,7 +1,7 @@ - n + debug /dev/ttyS0 5 5 diff --git a/misc/config_tools/data/nuc11tnbi5/hybrid.xml b/misc/config_tools/data/nuc11tnbi5/hybrid.xml index 786afc414..07acc415d 100644 --- a/misc/config_tools/data/nuc11tnbi5/hybrid.xml +++ b/misc/config_tools/data/nuc11tnbi5/hybrid.xml @@ -1,7 +1,7 @@ - n + debug /dev/ttyS0 5 5 diff --git a/misc/config_tools/data/nuc11tnbi5/partitioned.xml b/misc/config_tools/data/nuc11tnbi5/partitioned.xml index d01612cb6..9d62e33ae 100644 --- a/misc/config_tools/data/nuc11tnbi5/partitioned.xml +++ b/misc/config_tools/data/nuc11tnbi5/partitioned.xml @@ -1,7 +1,7 @@ - n + debug /dev/ttyS0 5 5 diff --git a/misc/config_tools/data/nuc11tnbi5/shared.xml b/misc/config_tools/data/nuc11tnbi5/shared.xml index aabaec630..e217f94e6 100644 --- a/misc/config_tools/data/nuc11tnbi5/shared.xml +++ b/misc/config_tools/data/nuc11tnbi5/shared.xml @@ -1,7 +1,7 @@ - n + debug /dev/ttyS0 5 5 diff --git a/misc/config_tools/data/qemu/shared.xml b/misc/config_tools/data/qemu/shared.xml index f3e423b88..0356ab141 100644 --- a/misc/config_tools/data/qemu/shared.xml +++ b/misc/config_tools/data/qemu/shared.xml @@ -1,7 +1,7 @@ - n + debug /dev/ttyS0 5 5 diff --git a/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/hybrid.xml b/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/hybrid.xml index 70d4afc9f..e16d18563 100644 --- a/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/hybrid.xml +++ b/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/hybrid.xml @@ -1,7 +1,7 @@ - n + debug /dev/ttyS0 5 5 diff --git a/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/partitioned.xml b/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/partitioned.xml index c4cd2c073..1e6a4b86f 100644 --- a/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/partitioned.xml +++ b/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/partitioned.xml @@ -1,7 +1,7 @@ - n + debug /dev/ttyS0 5 5 diff --git a/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/shared.xml b/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/shared.xml index ea22f11a0..c9ca45004 100644 --- a/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/shared.xml +++ b/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/shared.xml @@ -1,7 +1,7 @@ - n + debug /dev/ttyS0 5 5 diff --git a/misc/config_tools/data/whl-ipc-i5/hybrid.xml b/misc/config_tools/data/whl-ipc-i5/hybrid.xml index 8308199ae..188c94fe5 100644 --- a/misc/config_tools/data/whl-ipc-i5/hybrid.xml +++ b/misc/config_tools/data/whl-ipc-i5/hybrid.xml @@ -1,7 +1,7 @@ - n + debug /dev/ttyS0 5 5 diff --git a/misc/config_tools/data/whl-ipc-i5/hybrid_rt.xml b/misc/config_tools/data/whl-ipc-i5/hybrid_rt.xml index 718e1e457..b92c56534 100644 --- a/misc/config_tools/data/whl-ipc-i5/hybrid_rt.xml +++ b/misc/config_tools/data/whl-ipc-i5/hybrid_rt.xml @@ -1,7 +1,7 @@ - n + debug /dev/ttyS0 5 5 diff --git a/misc/config_tools/data/whl-ipc-i5/partitioned.xml b/misc/config_tools/data/whl-ipc-i5/partitioned.xml index fe6456439..d6d050ba3 100644 --- a/misc/config_tools/data/whl-ipc-i5/partitioned.xml +++ b/misc/config_tools/data/whl-ipc-i5/partitioned.xml @@ -1,7 +1,7 @@ - n + debug /dev/ttyS0 5 5 diff --git a/misc/config_tools/data/whl-ipc-i5/sdc.xml b/misc/config_tools/data/whl-ipc-i5/sdc.xml index b2981ea69..32dfd56ba 100644 --- a/misc/config_tools/data/whl-ipc-i5/sdc.xml +++ b/misc/config_tools/data/whl-ipc-i5/sdc.xml @@ -1,7 +1,7 @@ - n + debug /dev/ttyS0 5 5 diff --git a/misc/config_tools/data/whl-ipc-i5/shared.xml b/misc/config_tools/data/whl-ipc-i5/shared.xml index 6a9e4362b..38a8c7276 100644 --- a/misc/config_tools/data/whl-ipc-i5/shared.xml +++ b/misc/config_tools/data/whl-ipc-i5/shared.xml @@ -1,7 +1,7 @@ - n + debug /dev/ttyS0 5 5 diff --git a/misc/config_tools/scenario_config/upgrader.py b/misc/config_tools/scenario_config/upgrader.py index cdb1c0a4e..f3df2dc96 100755 --- a/misc/config_tools/scenario_config/upgrader.py +++ b/misc/config_tools/scenario_config/upgrader.py @@ -220,6 +220,17 @@ class ScenarioUpgrader(ScenarioTransformer): old_data_node = old_hv_vm_node.xpath(xpath) return old_data_node + def move_build_type(self, xsd_element_node, xml_parent_node, new_nodes): + old_data_node = self.get_node(self.old_xml_etree, f"//hv//RELEASE") + if old_data_node is not None: + new_node = etree.Element(xsd_element_node.get("name")) + new_node.text = "release" if old_data_node.text == "y" else "debug" + new_nodes.append(new_node) + self.old_data_nodes.discard(old_data_node) + else: + self.move_data_by_xpath(".//BUILD_TYPE", xsd_element_node, xml_parent_node, new_nodes) + return False + def move_legacy_vuart(self, xsd_element_node, xml_parent_node, new_nodes): # Preserve the legacy vuart for console only. legacy_vuart = self.get_from_old_data(xml_parent_node, ".//legacy_vuart[@id = '0']") @@ -357,6 +368,7 @@ class ScenarioUpgrader(ScenarioTransformer): "hide_mtrr_support": partialmethod(move_guest_flag, "GUEST_FLAG_HIDE_MTRR"), "security_vm": partialmethod(move_guest_flag, "GUEST_FLAG_SECURITY_VM"), + "BUILD_TYPE": move_build_type, "legacy_vuart": move_legacy_vuart, "vuart_connections": move_vuart_connections, "IVSHMEM": move_ivshmem, diff --git a/misc/config_tools/schema/config.xsd b/misc/config_tools/schema/config.xsd index 0e6852901..3069173d3 100644 --- a/misc/config_tools/schema/config.xsd +++ b/misc/config_tools/schema/config.xsd @@ -13,8 +13,8 @@ - - + + Build an image for release (``y``) or debug (``n``). In a **release** image, assertions are not enforced and debugging features are disabled, including logs, serial console, and the diff --git a/misc/config_tools/schema/types.xsd b/misc/config_tools/schema/types.xsd index 7d611eeef..ccb14249a 100644 --- a/misc/config_tools/schema/types.xsd +++ b/misc/config_tools/schema/types.xsd @@ -26,6 +26,16 @@ + + + A string that indicates the build type of the hypervisor. + + + + + + + Either empty, or an Integer value in hexadecimal format. diff --git a/misc/config_tools/xforms/config.h.xsl b/misc/config_tools/xforms/config.h.xsl index 25cb2939e..d7789a391 100644 --- a/misc/config_tools/xforms/config.h.xsl +++ b/misc/config_tools/xforms/config.h.xsl @@ -60,7 +60,7 @@ - + diff --git a/misc/config_tools/xforms/config.mk.xsl b/misc/config_tools/xforms/config.mk.xsl index edc3d9409..8cd4b0513 100644 --- a/misc/config_tools/xforms/config.mk.xsl +++ b/misc/config_tools/xforms/config.mk.xsl @@ -63,7 +63,7 @@ - + diff --git a/misc/config_tools/xforms/config_common.xsl b/misc/config_tools/xforms/config_common.xsl index df5ae9fd8..677101e0d 100644 --- a/misc/config_tools/xforms/config_common.xsl +++ b/misc/config_tools/xforms/config_common.xsl @@ -43,8 +43,9 @@ - + +