# 系統初始化腳本

`meta-qcom-hwe` 新增系統 initscripts 至影像如下：

| 系統初始化腳本 | 說明 |
| --- | --- |
| `var-persist.mount` | 將 `/dev/disk/by-partlabel/persist` 分割磁碟磁碟掛載到 `/var/persist`。 |
| `android-tools-adbd.service` | 在裝置上提供 adbd 守護進程。 |
| `logrotate.service` | 歸檔舊的日誌。<br><br><br>修改 Qualcomm Linux 中的 `rsyslog.logrotate` 組態檔案以管理裝置日誌。修改的 `rsyslog.logrotate` 檔案位於 `meta-qcom-hwe/dynamic-layers/openembedded-layer/recipes-devtools/rsyslog/rsyslog/rsyslog.logrotate` 目錄中。此檔案會覆寫 `meta-openembedded/meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.logrotate` 提供的預設組態檔案。 |
| `pd-mapper.service` | 設定及管理保護網域。Qualcomm Linux BSP 層中的 `pd-mapper_git.bbappend` 會更新 `pd-mapper.service.in` 檔案並以系統使用者而非根使用者身分執行服務。<br><br><br>do_install:prepend() {<br>        # convert the service from root user to system user<br>        sed -i "/ExecStart=/i\User=system\nGroup=system" pd-mapper.service.in<br>    }<br>    Copy to clipboard |
| `property-vault.service` | 提供 `property_get` 及 `property_set` 功能。欲深入瞭解此服務，請參閱 [配置 property-vault 屬性](https://docs.qualcomm.com/doc/80-70020-27TC/topic/configure_properties.html#configure-properties)。 |
| `persist-property-vault.service` | 執行 `set-persist-prop.sh` 並將 `le.persistprop.enable` 旗標設為 true。此屬性允許使用儲存在檔案系統中，即使重新啟動也不會消失的永久屬性。 |
| `resize-partition@.service` | 根據分割磁碟的大小，在開機時調整文件系統的大小。<br><br><br>ExecStart=/bin/sh -c "/sbin/e2fsck -n /dev/disk/by-partlabel/%i; if [ $? -gt 1 ]; then /sbin/mkfs.ext4 /dev/disk/by-partlabel/%i; fi; /sbin/resize2fs /dev/disk/by-partlabel/%i"<br>    Copy to clipboard |
| `rsyslog.service` | 根據指定的配置重新導向日誌。 |
| `sys-kernel-debug.mount` | 在建置 `perf` 變體時遮蔽 `sys-kernel-debug.mount` 單元。此 systemd 單元的條件性遮蔽是在 `meta-qcom-hwe/recipes-core/systemd/systemd_%.bbappend` 的 `do_install:append:qcom` 任務中完成。 |

Last Published: Dec 23, 2025

[Previous Topic
Qualcomm Linux 軟體元件](https://docs.qualcomm.com/bundle/publicresource/80-70020-27TC/topics/qualcomm_linux_software_components.md) [Next Topic
使用 systemd-boot 和 UKI 進行開機設定與安全開機配置](https://docs.qualcomm.com/bundle/publicresource/80-70020-27TC/topics/configure_and_secure_boot_with_systemd_boot_and_uki.md)