Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/4] SDK and adt_installer fixes
@ 2012-09-18  9:21 Laurentiu Palcu
  2012-09-18  9:21 ` [PATCH 1/4] adt-installer: fix package installation issue Laurentiu Palcu
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Laurentiu Palcu @ 2012-09-18  9:21 UTC (permalink / raw)
  To: openembedded-core

Hi,

This patchset contains some SDK/adt-installer fixes.

Thanks,
Laurentiu

The following changes since commit 913944d904266bf90af0cad94b4f0fb3652bd29d:

  upstream_tracking: update lsb and ltp (2012-09-14 17:12:52 +0100)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib lpalcu/adt_sdk_fixes
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=lpalcu/adt_sdk_fixes

Laurentiu Palcu (4):
  adt-installer: fix package installation issue
  SDK: fix installation into symlinked directories
  adt-installer: ensure directory exists before copying/removing
  SDK: remove references to Poky distro from tarball installer

 meta/classes/populate_sdk_base.bbclass             |   12 +++--
 .../installer/adt-installer/adt_installer          |    6 ++-
 .../adt-installer/scripts/adt_installer_internal   |   56 ++++++++++----------
 3 files changed, 42 insertions(+), 32 deletions(-)

-- 
1.7.9.5




^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/4] adt-installer: fix package installation issue
  2012-09-18  9:21 [PATCH 0/4] SDK and adt_installer fixes Laurentiu Palcu
@ 2012-09-18  9:21 ` Laurentiu Palcu
  2012-09-18 17:34   ` Zhang, Jessica
  2012-09-18  9:21 ` [PATCH 2/4] SDK: fix installation into symlinked directories Laurentiu Palcu
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Laurentiu Palcu @ 2012-09-18  9:21 UTC (permalink / raw)
  To: openembedded-core

When the cross canadian toolchains are installed, for different
architectures, they might contain common files. This leads to
installation failures since the opkg, by default, does not overwrite
files. This issue happens, for example, for binutils packages (that
contain the same locale files) or gdb (which installs some syscalls xml
files). The locale files could be removed from the binutils
cross-canadian package but we cannot do the same for the syscalls GDB
files which are used by GDB to display user friendly names for the
syscall numbers. Hence, the best solution is to force opkg to overwrite
these files.

[YOCTO #3109]

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
---
 .../adt-installer/scripts/adt_installer_internal   |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 78ea6d0..f113aa4 100755
--- a/meta/recipes-devtools/installer/adt-installer/scripts/adt_installer_internal
+++ b/meta/recipes-devtools/installer/adt-installer/scripts/adt_installer_internal
@@ -112,7 +112,7 @@ check_result
 
 #install below must sdk-host packages
 OPKG_INSTALL_CMD="$OPKG_CMD "
-OPKG_INSTALL_NATIVE_CMD="$OPKG_INSTALL_CMD  -f $OPKG_CONFIG_FILE -o $NATIVE_INSTALL_DIR install"
+OPKG_INSTALL_NATIVE_CMD="$OPKG_INSTALL_CMD  --force-overwrite -f $OPKG_CONFIG_FILE -o $NATIVE_INSTALL_DIR install"
 
 BASE_HOSTSDK_PKGNAMES="pseudo opkg pkgconfig libtool autoconf automake"
 for pkg in $BASE_HOSTSDK_PKGNAMES; do
-- 
1.7.9.5




^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/4] SDK: fix installation into symlinked directories
  2012-09-18  9:21 [PATCH 0/4] SDK and adt_installer fixes Laurentiu Palcu
  2012-09-18  9:21 ` [PATCH 1/4] adt-installer: fix package installation issue Laurentiu Palcu
@ 2012-09-18  9:21 ` Laurentiu Palcu
  2012-09-18  9:21 ` [PATCH 3/4] adt-installer: ensure directory exists before copying/removing Laurentiu Palcu
  2012-09-18  9:21 ` [PATCH 4/4] SDK: remove references to Poky distro from tarball installer Laurentiu Palcu
  3 siblings, 0 replies; 7+ messages in thread
From: Laurentiu Palcu @ 2012-09-18  9:21 UTC (permalink / raw)
  To: openembedded-core

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@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 1c151d7..78669cf 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
 
 echo -n "You are about to install Poky SDK to \"$target_sdk_dir\". Proceed[Y/n]?"
 read answer
@@ -154,7 +158,7 @@ echo "done"
 
 echo -n "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|\
-- 
1.7.9.5




^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/4] adt-installer: ensure directory exists before copying/removing
  2012-09-18  9:21 [PATCH 0/4] SDK and adt_installer fixes Laurentiu Palcu
  2012-09-18  9:21 ` [PATCH 1/4] adt-installer: fix package installation issue Laurentiu Palcu
  2012-09-18  9:21 ` [PATCH 2/4] SDK: fix installation into symlinked directories Laurentiu Palcu
@ 2012-09-18  9:21 ` Laurentiu Palcu
  2012-09-18  9:21 ` [PATCH 4/4] SDK: remove references to Poky distro from tarball installer Laurentiu Palcu
  3 siblings, 0 replies; 7+ messages in thread
From: Laurentiu Palcu @ 2012-09-18  9:21 UTC (permalink / raw)
  To: openembedded-core

If the installation is done in a directory which already contains a
valid installation, opkg will not install anything and the moving the
contents of /install/dir/opt/poky/1.2 (for example) to /install/dir will
throw some errors. However, the install directory will not be affected.
This patch will ensure that the /install/dir/opt/poky/1.2 exists.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
---
 .../adt-installer/scripts/adt_installer_internal   |   52 ++++++++++----------
 1 file changed, 27 insertions(+), 25 deletions(-)

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 76acaa7..fbcd2ce 100755
--- a/meta/recipes-devtools/installer/adt-installer/scripts/adt_installer_internal
+++ b/meta/recipes-devtools/installer/adt-installer/scripts/adt_installer_internal
@@ -158,31 +158,33 @@ fi
 # the entire directory structure. We could patch opkg to do that but it's far
 # simpler to do that here and achieve the same result.
 # This is done in two steps:
-# Step 1: copy ./opt/${DISTRO}/${SDK_VERSION} contents to $NATIVE_INSTALL_DIR.
-# We cannot use move if $NATIVE_INSTALL_DIR is not empty (for example: contains
-# another SDK)
-$SUDO cp -r $NATIVE_INSTALL_DIR/$DEFAULT_INSTALL_FOLDER/* $NATIVE_INSTALL_DIR
-
-# delete the source directory now
-$SUDO rm -rf $NATIVE_INSTALL_DIR/$DEFAULT_INSTALL_FOLDER/*
-
-# Step 2: Delete the ./opt/${DISTRO}/${SDK_VERSION} directories too, they should be empty
-dir=$NATIVE_INSTALL_DIR/$DEFAULT_INSTALL_FOLDER
-while [ "$dir" != "$NATIVE_INSTALL_DIR" ]; do
-    # if the user chose / as the install folder, then we should leave /opt in place
-    if [ "$dir" = "/opt" ]; then
-        break
-    fi
-
-    # try to delete the directory, only if it's empty
-    $SUDO rmdir $dir
-    if [ $? -ne 0 ]; then
-        break
-    fi
-
-    # go to the next directory
-    dir=$(dirname $dir)
-done
+if [ -d $NATIVE_INSTALL_DIR/$DEFAULT_INSTALL_FOLDER ]; then
+    # Step 1: copy ./opt/${DISTRO}/${SDK_VERSION} contents to $NATIVE_INSTALL_DIR.
+    # We cannot use move if $NATIVE_INSTALL_DIR is not empty (for example: contains
+    # another SDK)
+    $SUDO cp -r $NATIVE_INSTALL_DIR/$DEFAULT_INSTALL_FOLDER/* $NATIVE_INSTALL_DIR
+
+    # delete the source directory now
+    $SUDO rm -rf $NATIVE_INSTALL_DIR/$DEFAULT_INSTALL_FOLDER/*
+
+    # Step 2: Delete the ./opt/${DISTRO}/${SDK_VERSION} directories too, they should be empty
+    dir=$NATIVE_INSTALL_DIR/$DEFAULT_INSTALL_FOLDER
+    while [ "$dir" != "$NATIVE_INSTALL_DIR" ]; do
+        # if the user chose / as the install folder, then we should leave /opt in place
+        if [ "$dir" = "/opt" ]; then
+            break
+        fi
+
+        # try to delete the directory, only if it's empty
+        $SUDO rmdir $dir
+        if [ $? -ne 0 ]; then
+            break
+        fi
+
+        # go to the next directory
+        dir=$(dirname $dir)
+    done
+fi
 
 # Link the ld.so.cache file into the hosts filesystem
 if [ ! -f "$OECORE_NATIVE_SYSROOT/etc/ld.so.cache" ]; then
-- 
1.7.9.5




^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/4] SDK: remove references to Poky distro from tarball installer
  2012-09-18  9:21 [PATCH 0/4] SDK and adt_installer fixes Laurentiu Palcu
                   ` (2 preceding siblings ...)
  2012-09-18  9:21 ` [PATCH 3/4] adt-installer: ensure directory exists before copying/removing Laurentiu Palcu
@ 2012-09-18  9:21 ` Laurentiu Palcu
  3 siblings, 0 replies; 7+ messages in thread
From: Laurentiu Palcu @ 2012-09-18  9:21 UTC (permalink / raw)
  To: openembedded-core

The installer should be generic.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
---
 meta/classes/populate_sdk_base.bbclass |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
index 78669cf..f20a6ac 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -118,7 +118,7 @@ fakeroot create_shar() {
 
 DEFAULT_INSTALL_DIR="${SDKPATH}"
 
-echo -n "Enter target directory for Poky SDK (default: $DEFAULT_INSTALL_DIR): "
+echo -n "Enter target directory for SDK (default: $DEFAULT_INSTALL_DIR): "
 read target_sdk_dir
 
 if [ "$target_sdk_dir" = "" ]; then
@@ -132,7 +132,7 @@ else
 	target_sdk_dir=$(readlink -m $target_sdk_dir)
 fi
 
-echo -n "You are about to install Poky SDK to \"$target_sdk_dir\". Proceed[Y/n]?"
+echo -n "You are about to install the SDK to \"$target_sdk_dir\". Proceed[Y/n]?"
 read answer
 
 if [ "$answer" = "" ]; then
-- 
1.7.9.5




^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/4] adt-installer: fix package installation issue
  2012-09-18  9:21 ` [PATCH 1/4] adt-installer: fix package installation issue Laurentiu Palcu
@ 2012-09-18 17:34   ` Zhang, Jessica
  2012-09-18 18:54     ` Laurentiu Palcu
  0 siblings, 1 reply; 7+ messages in thread
From: Zhang, Jessica @ 2012-09-18 17:34 UTC (permalink / raw)
  To: Palcu, Laurentiu, openembedded-core@lists.openembedded.org

Hi Laurentiu,

Why this is only an issue for installation to a directory other than the default e.g. /opt/poky ?

Thanks,
Jessica

-----Original Message-----
From: openembedded-core-bounces@lists.openembedded.org [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of Laurentiu Palcu
Sent: Tuesday, September 18, 2012 2:22 AM
To: openembedded-core@lists.openembedded.org
Subject: [OE-core] [PATCH 1/4] adt-installer: fix package installation issue

When the cross canadian toolchains are installed, for different architectures, they might contain common files. This leads to installation failures since the opkg, by default, does not overwrite files. This issue happens, for example, for binutils packages (that contain the same locale files) or gdb (which installs some syscalls xml files). The locale files could be removed from the binutils cross-canadian package but we cannot do the same for the syscalls GDB files which are used by GDB to display user friendly names for the syscall numbers. Hence, the best solution is to force opkg to overwrite these files.

[YOCTO #3109]

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
---
 .../adt-installer/scripts/adt_installer_internal   |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 78ea6d0..f113aa4 100755
--- a/meta/recipes-devtools/installer/adt-installer/scripts/adt_installer_internal
+++ b/meta/recipes-devtools/installer/adt-installer/scripts/adt_installe
+++ r_internal
@@ -112,7 +112,7 @@ check_result

 #install below must sdk-host packages
 OPKG_INSTALL_CMD="$OPKG_CMD "
-OPKG_INSTALL_NATIVE_CMD="$OPKG_INSTALL_CMD  -f $OPKG_CONFIG_FILE -o $NATIVE_INSTALL_DIR install"
+OPKG_INSTALL_NATIVE_CMD="$OPKG_INSTALL_CMD  --force-overwrite -f $OPKG_CONFIG_FILE -o $NATIVE_INSTALL_DIR install"

 BASE_HOSTSDK_PKGNAMES="pseudo opkg pkgconfig libtool autoconf automake"
 for pkg in $BASE_HOSTSDK_PKGNAMES; do
--
1.7.9.5


_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/4] adt-installer: fix package installation issue
  2012-09-18 17:34   ` Zhang, Jessica
@ 2012-09-18 18:54     ` Laurentiu Palcu
  0 siblings, 0 replies; 7+ messages in thread
From: Laurentiu Palcu @ 2012-09-18 18:54 UTC (permalink / raw)
  To: Zhang, Jessica; +Cc: openembedded-core@lists.openembedded.org



On 09/18/2012 08:34 PM, Zhang, Jessica wrote:
> Hi Laurentiu,
> 
> Why this is only an issue for installation to a directory other than the default e.g. /opt/poky ?
Because of the internal opkg logic. Opkg keeps an internal database of
all packages installed and the files that each package provides. By
default all packages were built to install to /opt/poky/1.2+snapshot (I
took this path as an example). When we provide an offline root directory
(with -o option), let's assume it's /opt/poky/1.2+snapshot, all packages
will be installed to /opt/poky/1.2+snapshot/opt/poky/1.2+snapshot.
However, opkg will detect that the offline root matches the beginning of
the files paths and will record the files without the first part: that
is /opt/poky/1.2+snapshot/file instead of
/opt/poky/1.2+snapshot/opt/poky/1.2+snapshot/file.

When another package is installed, opkg will look into its database and
will try to see if the file to be installed in
/opt/poky/1.2+snapshot/opt/poky/1.2+snapshot will overwrite any files in
/opt/poky/1.2+snapshot. The answer is, of course, NO (since the paths
are different) and the installation will go on.

On the other hand, if we choose another offline directory(different from
the default one), let's say /my/test, the files in it's internal
database will contain the entire paths: that is
/my/test/opt/poky/1.2+snapshot.

When another package is installed to the same /my/test directory, opkg
will now look into its database and see if the files to be installed in
/my/test/opt/poky/1.2+snapshot overwrites any files in the same path.
Since paths are now the same, installing two packages providing the same
files will, of course, be detected and installation stopped.

I hope this answers your question,
Laurentiu

> 
> Thanks,
> Jessica
> 
> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of Laurentiu Palcu
> Sent: Tuesday, September 18, 2012 2:22 AM
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core] [PATCH 1/4] adt-installer: fix package installation issue
> 
> When the cross canadian toolchains are installed, for different architectures, they might contain common files. This leads to installation failures since the opkg, by default, does not overwrite files. This issue happens, for example, for binutils packages (that contain the same locale files) or gdb (which installs some syscalls xml files). The locale files could be removed from the binutils cross-canadian package but we cannot do the same for the syscalls GDB files which are used by GDB to display user friendly names for the syscall numbers. Hence, the best solution is to force opkg to overwrite these files.
> 
> [YOCTO #3109]
> 
> Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
> ---
>  .../adt-installer/scripts/adt_installer_internal   |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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 78ea6d0..f113aa4 100755
> --- a/meta/recipes-devtools/installer/adt-installer/scripts/adt_installer_internal
> +++ b/meta/recipes-devtools/installer/adt-installer/scripts/adt_installe
> +++ r_internal
> @@ -112,7 +112,7 @@ check_result
> 
>  #install below must sdk-host packages
>  OPKG_INSTALL_CMD="$OPKG_CMD "
> -OPKG_INSTALL_NATIVE_CMD="$OPKG_INSTALL_CMD  -f $OPKG_CONFIG_FILE -o $NATIVE_INSTALL_DIR install"
> +OPKG_INSTALL_NATIVE_CMD="$OPKG_INSTALL_CMD  --force-overwrite -f $OPKG_CONFIG_FILE -o $NATIVE_INSTALL_DIR install"
> 
>  BASE_HOSTSDK_PKGNAMES="pseudo opkg pkgconfig libtool autoconf automake"
>  for pkg in $BASE_HOSTSDK_PKGNAMES; do
> --
> 1.7.9.5
> 
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
> 



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-09-18 19:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-18  9:21 [PATCH 0/4] SDK and adt_installer fixes Laurentiu Palcu
2012-09-18  9:21 ` [PATCH 1/4] adt-installer: fix package installation issue Laurentiu Palcu
2012-09-18 17:34   ` Zhang, Jessica
2012-09-18 18:54     ` Laurentiu Palcu
2012-09-18  9:21 ` [PATCH 2/4] SDK: fix installation into symlinked directories Laurentiu Palcu
2012-09-18  9:21 ` [PATCH 3/4] adt-installer: ensure directory exists before copying/removing Laurentiu Palcu
2012-09-18  9:21 ` [PATCH 4/4] SDK: remove references to Poky distro from tarball installer Laurentiu Palcu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox