@@ -684,21 +684,51 @@ deltask do_package_write_rpm
# 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
}
@@ -710,8 +740,8 @@ create_merged_usr_symlinks_sdk() {
create_merged_usr_symlinks ${SDK_OUTPUT}${SDKTARGETSYSROOT}
}
-ROOTFS_PREPROCESS_COMMAND += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', 'create_merged_usr_symlinks_rootfs', '',d)}"
-POPULATE_SDK_PRE_TARGET_COMMAND += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', 'create_merged_usr_symlinks_sdk', '',d)}"
+ROOTFS_POSTPROCESS_COMMAND:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', 'create_merged_usr_symlinks_rootfs', '',d)}"
+POPULATE_SDK_POST_TARGET_COMMAND:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', 'create_merged_usr_symlinks_sdk', '',d)}"
reproducible_final_image_task () {
if [ "$REPRODUCIBLE_TIMESTAMP_ROOTFS" = "" ]; then
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 | 50 ++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 10 deletions(-)