# 配置

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

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

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

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

有关编译的说明，参见 [Qualcomm Linux 编译指南 ➝ GitHub 工作流程（固件和附加组件）](https://docs.qualcomm.com/bundle/publicresource/topics/80-70015-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 崩溃时强制 TrustZone 系统出现致命错误。与 `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` | 设置 TrustZone 日志级别：<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 配置文件 (trustzone\_images/ssg/securemsm/trustzone/qsee/mink/oem/config/common/ cmnlib\_oem\_config.xml) 中启用或禁用基于 RPMB 的 SFS 防回滚保护。

| `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 配置

如果启用了 SELinux，则可能不允许您更新防回滚保护标志。

检查设备的当前 SELinux 配置（Enforcing 或 Permissive 模式）：

    getenforceCopy to clipboard

如果设置为 Enforcing 模式，则运行 `setenforce` 命令以更改模式。

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-70015-11SC/topic/enable-secure-boot.html)**  

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

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

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

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

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

Last Published: Dec 03, 2024

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