Skip to content

recipes-core/systemd: reuse the prebuilt ldconfig cache on SOTA deployments - #479

Open
Saksham Singh (saks) (saks-singh) wants to merge 1 commit into
qualcomm-linux:mainfrom
saks-singh:fix/systemd-prebuilt-ldconfig-cache
Open

Saksham Singh (saks) (saks-singh) wants to merge 1 commit into
qualcomm-linux:mainfrom
saks-singh:fix/systemd-prebuilt-ldconfig-cache

Conversation

@saks-singh

Copy link
Copy Markdown

systemd: restore the prebuilt ldconfig cache atomically

Override ldconfig.service for qcom-distro SOTA images to reuse the linker cache generated during rootfs construction instead of scanning all libraries again on first boot, effectively saving 600-700ms running the service.

Copy the cache to a temporary file and atomically rename it into place so concurrently starting processes cannot observe a truncated cache. Fall back to ldconfig -X when either cache is unavailable.

Tested on devices IQ-9075EVK and IQ-8275EVK

SOTA deployments cause ldconfig.service to rescan all libraries during
first boot even though OpenEmbedded generated a cache while constructing
the root filesystem. This adds about 600-700 ms to startup.

Install a service drop-in that invokes a helper to restore the prebuilt
cache through a temporary file and atomic rename. Fall back to
ldconfig -X when the required cache files are unavailable.

Assisted-by: Codex:GPT-5
Signed-off-by: Saksham Singh <saks@qti.qualcomm.com>
FILES:${PN}:append:qcom-distro:sota = " \
${systemd_system_unitdir}/ldconfig.service.d/10-use-prebuilt-ldconfig-cache.conf \
${libexecdir}/qcom-ldconfig-update \
" No newline at end of file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing new line

do_install:append:qcom-distro:sota() {
install -Dm 0644 \
${UNPACKDIR}/10-use-prebuilt-ldconfig-cache.conf \
${D}${systemd_system_unitdir}/ldconfig.service.d/10-use-prebuilt-ldconfig-cache.conf

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the target 10-use-prebuilt-ldconfig-cache.conf is the same it can be ommited

${D}${systemd_system_unitdir}/ldconfig.service.d/10-use-prebuilt-ldconfig-cache.conf
install -Dm 0755 \
${UNPACKDIR}/qcom-ldconfig-update \
${D}${libexecdir}/qcom-ldconfig-update

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants