On Thu Jul 16, 2026 at 8:15 AM CEST, Himani Ramesh Barde via 
lists.openembedded.org wrote:
> When packages are installed outside of Yocto's normal image creation
> (e.g., using multistrap, debootstrap, or dpkg directly on a host),
> the postinst script fails to enable systemd services.
>
> The issue is that the entire enable logic is gated behind
> "if systemctl >/dev/null 2>/dev/null". In cross-install scenarios:
> - If systemctl is absent on the host: the check fails, script is skipped
> - If host systemctl is present: it cannot find target unit files
>
> Fix this by separating the offline ($D set) and online ($D unset)
> code paths into distinct branches. The previous code used a single
> OPTS variable to switch between "--root=$D" (offline) and "" (online)
> within one unified block. This variable is removed because the two
> scenarios now have dedicated branches with different logic:
>
> - Offline ($D set): Tries "systemctl --root=$D preset" first, which
>   reads preset files from the target rootfs and creates symlinks
>   without needing the host systemctl to understand the target's unit
>   files. Falls back to "systemctl --root=$D enable" per service.
>
> - Online ($D unset): Same as before - enable, daemon-reload, preset,
>   restart. No behavioral change for on-target installs.
>
> The OPTS variable is no longer needed because each branch now directly
> uses the appropriate systemctl invocation for its context, making the
> intent clearer and the offline path functional.
>
> Fixes [YOCTO #14118]
>
> Signed-off-by: Himani Ramesh Barde <[email protected]>
> ---

Hi Himani Ramesh,

I tried to pick this patch, but I can see some conflicts with the master
branch. Can you confirm this is targeting the master branch and based on
a recent master?

Thanks,
Mathieu

-- 
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#241221): 
https://lists.openembedded.org/g/openembedded-core/message/241221
Mute This Topic: https://lists.openembedded.org/mt/120294886/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

  • [OE-core] [PATCH] systemd... Himani Ramesh Barde via lists.openembedded.org
    • Re: [OE-core] [PATCH... Mathieu Dubois-Briand via lists.openembedded.org

Reply via email to