From 942c06a7348070b92f722fa5c439c8c4404485b7 Mon Sep 17 00:00:00 2001 From: hongxu Date: Tue, 10 Aug 2021 21:33:56 +0800 Subject: sdk: fix relocate symlink failed Install SDK to non-default dir, sysmlink mkfs.vfat is invalid $ ./sdk.sh -y -d ./dnf-2 -S -D $ ls sysroots/x86_64-wrlinuxsdk-linux/usr/bin/mkfs.vfat -al lrwxrwxrwx 1 hjia users 99 Aug 10 20:38 sysroots/x86_64-wrlinuxsdk-linux/usr/bin/mkfs.vfat -> /opt/windriver/wrlinux-graphics/21.32/sysroots/x86_64-wrlinuxsdk-linux/usr/bin/mkfs.vfat.dosfstools Since commit [bc4ee54535 sdk: Decouple default install path from built in path] applied, sdk relocates symlink failed, it should replace $SDK_BUILD_PATH rather than $DEFAULT_INSTALL_DIR, just like above commit did Without this commit: ... |+ for l in $($SUDO_EXEC find $native_sysroot -type l) |++ readlink path-to/sysroots/x86_64-wrlinuxsdk-linux/usr/bin/mkfs.vfat |++ sed -e s:/usr/local/oecore-x86_64:path-to: |+ ln -sfn /opt/windriver/wrlinux-graphics/21.32/sysroots/x86_64-wrlinuxsdk-linux/ usr/bin/mkfs.vfat.dosfstools path-to//sysroots/x86_64-wrlinuxsdk-linux/usr/bin/mkfs.vfat ... After appling this commit: ... |+ for l in $($SUDO_EXEC find $native_sysroot -type l) |++ readlink path-to/sysroots/x86_64-wrlinuxsdk-linux/usr/bin/mkfs.vfat |++ sed -e s:/opt/windriver/wrlinux-graphics/21.31:path-to: |+ ln -sfn path-to/sysroots/x86_64-wrlinuxsdk-linux/usr/bin/mkfs.vfat.dosfstools path-to/sysroots/x86_64-wrlinuxsdk-linux/usr/bin/mkfs.vfat ... Signed-off-by: Hongxu Jia Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- meta/files/toolchain-shar-relocate.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/files/toolchain-shar-relocate.sh b/meta/files/toolchain-shar-relocate.sh index 8ea6194eca..3ece04db0a 100644 --- a/meta/files/toolchain-shar-relocate.sh +++ b/meta/files/toolchain-shar-relocate.sh @@ -72,7 +72,7 @@ fi # change all symlinks pointing to @SDKPATH@ for l in $($SUDO_EXEC find $native_sysroot -type l); do - $SUDO_EXEC ln -sfn $(readlink $l|$SUDO_EXEC sed -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:") $l + $SUDO_EXEC ln -sfn $(readlink $l|$SUDO_EXEC sed -e "s:$SDK_BUILD_PATH:$target_sdk_dir:") $l if [ $? -ne 0 ]; then echo "Failed to setup symlinks. Relocate script failed. Abort!" exit 1 -- cgit 1.2.3-korg