public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: ChenQi <Qi.Chen@windriver.com>
To: yw.byun@lge.com, openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH] Fix create_merged_usr_symlinks in populate_sdk_base.bbclass and image.bbclass
Date: Fri, 5 Dec 2025 16:30:07 +0800	[thread overview]
Message-ID: <0ca726c7-9016-4fdb-a795-68ab13cab05f@windriver.com> (raw)
In-Reply-To: <20251205044553.397572-1-yw.byun@lge.com>

I can guess why you're dong this. The 'install' command overrides your 
custom '/usr/bin' perms setting, right?
Please add more details in the commit message.

Another concern is about the ':append'. Could you please explain what 
problem would be without using ':append'?

Regards,
Qi

On 12/5/25 12:45, Yangwoo Byun via lists.openembedded.org wrote:
> Modifying FILESYSTEM_PERMS_TABLES does not change the UID and GID of
> /usr/bin
>
> I modified create_merged_usr_symlinks and
> moved its execution order back
>
> Signed-off-by: Yangwoo Byun <yw.byun@lge.com>
> ---
>   meta/classes-recipe/image.bbclass             |  2 +-
>   meta/classes-recipe/populate_sdk_base.bbclass | 48 +++++++++++++++----
>   2 files changed, 40 insertions(+), 10 deletions(-)
>
> diff --git a/meta/classes-recipe/image.bbclass b/meta/classes-recipe/image.bbclass
> index 53f1a9dc45b..2d90b29c8c5 100644
> --- a/meta/classes-recipe/image.bbclass
> +++ b/meta/classes-recipe/image.bbclass
> @@ -686,7 +686,7 @@ create_merged_usr_symlinks_rootfs() {
>       create_merged_usr_symlinks ${IMAGE_ROOTFS}
>   }
>   
> -ROOTFS_PREPROCESS_COMMAND += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', 'create_merged_usr_symlinks_rootfs', '',d)}"
> +ROOTFS_POSTPROCESS_COMMAND:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', 'create_merged_usr_symlinks_rootfs', '',d)}"
>   
>   reproducible_final_image_task () {
>       if [ "$REPRODUCIBLE_TIMESTAMP_ROOTFS" = "" ]; then
> diff --git a/meta/classes-recipe/populate_sdk_base.bbclass b/meta/classes-recipe/populate_sdk_base.bbclass
> index 8e671cf28fa..cafd9a5698a 100644
> --- a/meta/classes-recipe/populate_sdk_base.bbclass
> +++ b/meta/classes-recipe/populate_sdk_base.bbclass
> @@ -186,21 +186,51 @@ POPULATE_SDK_POST_HOST_COMMAND:append:task-populate-sdk = " write_host_sdk_manif
>   # Prepare the root links to point to the /usr counterparts.
>   create_merged_usr_symlinks() {
>       root="$1"
> -    install -d $root${base_bindir} $root${base_sbindir} $root${base_libdir}
> -    ln -rs $root${base_bindir} $root/bin
> -    ln -rs $root${base_sbindir} $root/sbin
> -    ln -rs $root${base_libdir} $root/${baselib}
> +
> +    if [ ! -d "$root${base_bindir}" ]; then
> +        install -d "$root${base_bindir}"
> +    fi
> +
> +    if [ ! -d "$root${base_sbindir}" ]; then
> +        install -d "$root${base_sbindir}"
> +    fi
> +
> +    if [ ! -d "$root${base_libdir}" ]; then
> +        install -d "$root${base_libdir}"
> +    fi
> +
> +    if [ ! -e "$root/bin" ]; then
> +        ln -rs "$root${base_bindir}" "$root/bin"
> +    fi
> +
> +    if [ ! -e "$root/sbin" ]; then
> +        ln -rs "$root${base_sbindir}" "$root/sbin"
> +    fi
> +
> +    if [ ! -e "$root/${baselib}" ]; then
> +        ln -rs "$root${base_libdir}" "$root/${baselib}"
> +    fi
>   
>       if [ "${nonarch_base_libdir}" != "${base_libdir}" ]; then
> -       install -d $root${nonarch_base_libdir}
> -       ln -rs $root${nonarch_base_libdir} $root/lib
> +        if [ ! -d "$root${nonarch_base_libdir}" ]; then
> +            install -d "$root${nonarch_base_libdir}"
> +        fi
> +
> +        if [ ! -e "$root/lib" ]; then
> +            ln -rs "$root${nonarch_base_libdir}" "$root/lib"
> +        fi
>       fi
>   
>       # create base links for multilibs
>       multi_libdirs="${@d.getVar('MULTILIB_VARIANTS')}"
>       for d in $multi_libdirs; do
> -        install -d $root${exec_prefix}/$d
> -        ln -rs $root${exec_prefix}/$d $root/$d
> +        if [ ! -d "$root${exec_prefix}/$d" ]; then
> +            install -d "$root${exec_prefix}/$d"
> +        fi
> +
> +        if [ ! -e "$root/$d" ]; then
> +            ln -rs "$root${exec_prefix}/$d" "$root/$d"
> +        fi
>       done
>   }
>   
> @@ -208,7 +238,7 @@ create_merged_usr_symlinks_sdk() {
>       create_merged_usr_symlinks ${SDK_OUTPUT}${SDKTARGETSYSROOT}
>   }
>   
> -POPULATE_SDK_PRE_TARGET_COMMAND += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', 'create_merged_usr_symlinks_sdk', '',d)}"
> +POPULATE_SDK_POST_TARGET_COMMAND:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', 'create_merged_usr_symlinks_sdk', '',d)}"
>   
>   SDK_PACKAGING_COMMAND = "${@'${SDK_PACKAGING_FUNC}' if '${SDK_PACKAGING_FUNC}' else ''}"
>   SDK_POSTPROCESS_COMMAND = "create_sdk_files check_sdk_sysroots archive_sdk ${SDK_PACKAGING_COMMAND}"
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#227331): https://lists.openembedded.org/g/openembedded-core/message/227331
> Mute This Topic: https://lists.openembedded.org/mt/116625831/7304865
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [Qi.Chen@eng.windriver.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>



  reply	other threads:[~2025-12-05  8:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-05  4:45 [PATCH] Fix create_merged_usr_symlinks in populate_sdk_base.bbclass and image.bbclass Yangwoo Byun
2025-12-05  8:30 ` ChenQi [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-01-05  2:50 Yangwoo Byun
2026-01-07  7:36 ` [OE-core] " Mathieu Dubois-Briand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0ca726c7-9016-4fdb-a795-68ab13cab05f@windriver.com \
    --to=qi.chen@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=yw.byun@lge.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox