# 配置

Source: [https://docs.qualcomm.com/doc/80-70014-11Y/topic/configure.html](https://docs.qualcomm.com/doc/80-70014-11Y/topic/configure.html)

Qualcomm TEE 配置可以通过设备配置 (devcfg) 框架进行调整。

Note: 请记住在 SELinux Permissive 模式下运行所有 SSH 命令。将来会支持 Enforcing 模式。有关如何连接到设备的说明，请参见 [Qualcomm Linux 编译指南 ➝ 操作方法 ➝ 如何使用 SSH](https://docs.qualcomm.com/bundle/publicresource/topics/80-70014-254/how_to.html)。

TrustZone 通过 XML 文件（如 trustzone\_images/ssg/securemsm/trustzone/qsee/mink/oem/config/&lt;chipset&gt;/oem\_config.xml 文件）提供配置选项。

XML 配置文件内置于 `devcfg.mbn` 中。以下命令用于从 TZ.XF.5.0 中编译 devcfg 镜像：

    cd trustzone_images/build/ms$python3 build_all.py -b TZ.XF.5.0 CHIPSET=<chipset> devcfg
    devcfg.mbn image is generated under below location
    trustzone_images/build/ms/bin/<build_flavor>Copy to clipboard

有关生成 (build) 和编译的说明，请参见 [Qualcomm Linux 编译指南 ➝ GitHub 工作流（固件和附加功能）](https://docs.qualcomm.com/bundle/publicresource/topics/80-70014-254/build_addn_info.html)。

## 设备配置

| 属性 | 说明 |
| --- | --- |
| `OEM_pil_secure_app_load_region_size` | 定制 TA 大小的配置。 |
| `OEM_pil_subsys_load_region_start` | 配置用于在默认内存映射发生任何更改时定制 PIL 负载起始地址。 |
| `OEM_pil_subsys_load_region_size` | 配置用于在默认内存映射发生任何更改时定制 PIL 大小。 |
| `OEM_enable_app_fatal_err` | 此属性可用于在特定 TA 崩溃时强制 TZ 系统出现致命错误。与 `OEM_crash_ta_name` 搭配使用。 |
| `OEM_crash_ta_name` | 将条目替换为预期崩溃的 TA 名称和安全内核预期崩溃的 TA。 |
| `OEM_sec_wdog_bark_time` | 更改设备安全看门狗 bark 时间的默认配置。 |
| `OEM_sec_wdog_bite_time` | 更改设备安全看门狗 bite 时间的默认配置。 |
| `OEM_tz_log_level` | 设置 TZ 日志级别：<br><br><br>                                <ul class="ul" id="configure__ul_y4m_dm3_p1c"><br>                                    <li class="li">致命：0</li><br><br>                                    <li class="li">错误：1</li><br><br>                                    <li class="li">调试：2</li><br><br>                                </ul> |

## 基于 RPMB 的 SFS 防回滚保护

可以在位于以下位置的 XML 配置文件中启用或禁用基于 RPMB 的 SFS 防回滚保护： trustzone\_images/ssg/securemsm/trustzone/qsee/mink/oem/config/common/ cmnlib\_oem\_config.xml

| `cmnlib_gppo_rpmb_enablement` | <ul class="ul" id="configure__ul_nhr_smm_q1c"><br>                                    <li class="li">已启用（默认值。仅在需要时更改。）</li><br><br>                                    <li class="li">禁用</li><br><br>                                </ul> |
| --- | --- |

## SELinux 配置

1. 通过 SSH 连接到设备。
2. 使用以下命令更改 SELinux 模式。

    - 要将设备切换到 Enforcing 模式，请执行以下操作：

            setenforce 1Copy to clipboard
    - 要将设备切换到 Permissive 模式：

            setenforce 0Copy to clipboard
    - 要检查设备的当前配置（Enforcing 或 Permissive 模式）：

            getenforceCopy to clipboard

- **[启用安全启动](https://docs.qualcomm.com/doc/80-70014-11Y/topic/enable-secure-boot.html)**  

通过熔断一组属于 QFPROM 的硬件熔丝来启用安全启动。根证书的哈希值被熔断到用作主要 RoT 的硬件熔丝中。
- **[启用 SELinux](https://docs.qualcomm.com/doc/80-70014-11Y/topic/enable-selinux.html)**  

启用 SELinux 后，所有系统对象（包括文件、目录、进程、套接字、驱动程序等）都标有安全上下文。
- **[启用 UEFI 安全启动](https://docs.qualcomm.com/doc/80-70014-11Y/topic/enable-uefi-secure-boot.html)**  

可以设置初始 UEFI 安全启动配置，并将密钥和证书转换为 UEFI 可以理解的格式。
- **[示例 OpenSSL 配置](https://docs.qualcomm.com/doc/80-70014-11Y/topic/appendix-openssl-configuration.html)**  

此示例显示了用于生成密钥和证书请求的配置文件。
- **[安装或升级 QCS5430 SoftSKU 功能包](https://docs.qualcomm.com/doc/80-70014-11Y/topic/upgrade-qualcomm-wes-feature-pack.html)**  

您可以使用 Qualcomm^®^ 无线边缘服务 (Qualcomm WES) 许可证升级 QCS5430 软库存管理单元 (SKU) 功能包。

Last Published: Aug 27, 2024

[Previous Topic
启动](https://docs.qualcomm.com/bundle/publicresource/80-70014-11Y/topics/bring-up.md) [Next Topic
启用安全启动](https://docs.qualcomm.com/bundle/publicresource/80-70014-11Y/topics/enable-secure-boot.md)