[oe-commits] Laurentiu Palcu : SDK: fix installation into symlinked directories
git at git.openembedded.org
git at git.openembedded.org
Fri Sep 21 10:18:08 UTC 2012
Module: openembedded-core.git
Branch: master
Commit: 9e6a25e2e9a7f37c3baa0b2949a43ac4127868da
URL: http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=9e6a25e2e9a7f37c3baa0b2949a43ac4127868da
Author: Laurentiu Palcu <laurentiu.palcu at intel.com>
Date: Mon Sep 17 11:19:08 2012 +0300
SDK: fix installation into symlinked directories
The SDK installation scripts should not canonicalize symlinked
directories because the entire relocation would be done to the directory
to which the symlink points. Instead, if the installation is a symlink,
use that path to relocate the binaries.
For example, if we have the following symlink: /opt/sdk -> ~/my/test/sdk
the binaries will be relocated to /opt/sdk not ~/my/test/sdk as it is
done now.
[YOCTO #3102]
Signed-off-by: Laurentiu Palcu <laurentiu.palcu at intel.com>
Signed-off-by: Saul Wold <sgw at linux.intel.com>
---
meta/classes/populate_sdk_base.bbclass | 8 ++++++--
.../installer/adt-installer/adt_installer | 6 +++++-
.../adt-installer/scripts/adt_installer_internal | 2 +-
3 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
index 2bff41f..1b55e70 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -126,7 +126,11 @@ if [ "$target_sdk_dir" = "" ]; then
fi
eval target_sdk_dir=$target_sdk_dir
-target_sdk_dir=$(readlink -m $target_sdk_dir)
+if [ -d $target_sdk_dir ]; then
+ target_sdk_dir=$(cd $target_sdk_dir; pwd)
+else
+ target_sdk_dir=$(readlink -m $target_sdk_dir)
+fi
printf "You are about to install Poky SDK to \"$target_sdk_dir\". Proceed[Y/n]?"
read answer
@@ -154,7 +158,7 @@ echo "done"
printf "Setting it up..."
# fix environment paths
-env_setup_script=$(find $target_sdk_dir -name "environment-setup-${REAL_MULTIMACH_TARGET_SYS}")
+env_setup_script=$(find $target_sdk_dir/ -name "environment-setup-${REAL_MULTIMACH_TARGET_SYS}")
sed -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:g" -i $env_setup_script
# fix dynamic loader paths in all ELF SDK binaries
diff --git a/meta/recipes-devtools/installer/adt-installer/adt_installer b/meta/recipes-devtools/installer/adt-installer/adt_installer
index 2d252b7..0be5a1d 100755
--- a/meta/recipes-devtools/installer/adt-installer/adt_installer
+++ b/meta/recipes-devtools/installer/adt-installer/adt_installer
@@ -340,7 +340,11 @@ if [ "$INSTALL_FOLDER" = "" ]; then
fi
eval INSTALL_FOLDER=$INSTALL_FOLDER
-export INSTALL_FOLDER=$(readlink -m $INSTALL_FOLDER)
+if [ -d $INSTALL_FOLDER ]; then
+ export INSTALL_FOLDER=$(cd $INSTALL_FOLDER; pwd)
+else
+ export INSTALL_FOLDER=$(readlink -m $INSTALL_FOLDER)
+fi
clear
diff --git a/meta/recipes-devtools/installer/adt-installer/scripts/adt_installer_internal b/meta/recipes-devtools/installer/adt-installer/scripts/adt_installer_internal
index f113aa4..76acaa7 100755
--- a/meta/recipes-devtools/installer/adt-installer/scripts/adt_installer_internal
+++ b/meta/recipes-devtools/installer/adt-installer/scripts/adt_installer_internal
@@ -207,7 +207,7 @@ $SUDO scripts/relocate_sdk_tmp.py $INSTALL_FOLDER $dl_path $executable_files
check_result
# replace /opt/${DISTRO}/${SDK_VERSION} with the install folder in all configs
-env_setup_script=$(find $NATIVE_INSTALL_DIR -name "environment-setup-*")
+env_setup_script=$(find $NATIVE_INSTALL_DIR/ -name "environment-setup-*")
$SUDO sed -i -e "s:$DEFAULT_INSTALL_FOLDER:$NATIVE_INSTALL_DIR:g" $env_setup_script
find $OECORE_NATIVE_SYSROOT -type f -exec file '{}' \;|grep ":.*ASCII.*text"|cut -d':' -f1|\
More information about the Openembedded-commits
mailing list