Skip to contentSkip to conversation

Add support for relocatable SDK to ADT installer and some fixes

PATCH Applied Laurentiu Palcu 2 participants 5 messages Aug 17, 2012

lore
Share & tools
lore
#0 lore raw

v2 cover Add support for relocatable SDK to ADT installer and some fixes

Changes in V2:

	- addressed Richard's comments and restored the spaces back to tabs in do_populate_adt
	  shell function;

Hi,

This patchset adds support for relocating SDK to ADT installer and a couple of fixes.

Thanks,
Laurentiu

The following changes since commit af847d36375aa53f0c1ee2a00c97ba9f38837d1b:

bitbake: bitbake: build.py: Add stampdir argument to cached_mtime_noerror (2012-08-16 12:27:41 +0100)

are available in the git repository at:

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

Laurentiu Palcu (3):
populate_sdk_base.bbclass: fix SDK relocation issues package.bbclass: change RPATHs for cross-canadian binaries
adt-installer: add support for relocatable SDK

 meta/classes/package.bbclass                       |    2 +-
 meta/classes/populate_sdk_base.bbclass             |    4 +-
 .../installer/adt-installer/adt_installer          |   11 ++
 .../adt-installer/scripts/adt_installer_internal   |  111 ++++++++++++++++----
 .../installer/adt-installer_1.0.bb                 |    7 +-
 5 files changed, 111 insertions(+), 24 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v2 1/3 populate_sdk_base.bbclass: fix SDK relocation issues

The problem appears if multiple setup environment scripts are found. In order to find only the script we're interested in, I removed globbing in matching pattern with ${REAL_MULTIMACH_TARGET_SYS} that will be expanded to the correct string.

Also, fix a problem when changing the scripts/configs. The grep pattern matched also files that contained "text" in their name.

---
 meta/classes/populate_sdk_base.bbclass |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/classes/populate_sdk_base.bbclass +2 -2
index 0d19741..a1cb12a 100644
@@ -154,7 +154,7 @@ echo "done"
 
 echo -n "Setting it up..."
 # fix environment paths
-env_setup_script=$(find $target_sdk_dir -name "environment-setup*")
+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
@@ -168,7 +168,7 @@ if [ $? -ne 0 ]; then
 fi
 
 # replace ${SDKPATH} with the new prefix in all text files: configs/scripts/etc
-find $native_sysroot -type f -exec file '{}' \;|grep text|cut -d':' -f1|xargs sed -i -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:g"
+find $native_sysroot -type f -exec file '{}' \;|grep ":.*ASCII.*text"|cut -d':' -f1|xargs sed -i -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:g"
 
 echo done
 
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH v2 2/3 package.bbclass: change RPATHs for cross-canadian binaries

In reply to Laurentiu Palcu

When building the meta-toolchain, the binaries didn't get relocatable RPATHs. They were hardcoded to the default path. Hence, if one had already installed one SDK in the default path and one in another location, the later toolchain's binaries would search and load libraries from the first location, ending in a "Segmentation Fault".

[YOCTO #2927]

---
 meta/classes/package.bbclass |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/package.bbclass +1 -1
index d122cd9..278f0f0 100644
@@ -448,7 +448,7 @@ python perform_packagecopy () {
     subprocess.call('tar -cf - -C %s -ps . | tar -xf - -C %s' % (dest, dvar), shell=True)
 
     # replace RPATHs for the nativesdk binaries, to make them relocatable
-    if bb.data.inherits_class('nativesdk', d):
+    if bb.data.inherits_class('nativesdk', d) or bb.data.inherits_class('cross-canadian', d):
         rpath_replace (dvar, d)
 }
 
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH v2 3/3 adt-installer: add support for relocatable SDK

In reply to Laurentiu Palcu

Since we made the SDK relocatable, we have to add this functionality to adt-installer too.

---
 .../installer/adt-installer/adt_installer          |   11 ++
 .../adt-installer/scripts/adt_installer_internal   |  111 ++++++++++++++++----
 .../installer/adt-installer_1.0.bb                 |    7 +-
 3 files changed, 108 insertions(+), 21 deletions(-)
meta/recipes-devtools/installer/adt-installer/adt_installer +11 -0
index 1a53eb9..2d252b7 100755
@@ -332,6 +332,17 @@ if [ -f "$YOCTOADT_INSTALL_LOG_FILE" ]; then
   rm $YOCTOADT_INSTALL_LOG_FILE
 fi
 
+echo -n "Please enter the install location (default: $DEFAULT_INSTALL_FOLDER): "
+read INSTALL_FOLDER
+
+if [ "$INSTALL_FOLDER" = "" ]; then
+    INSTALL_FOLDER=$DEFAULT_INSTALL_FOLDER
+fi
+
+eval INSTALL_FOLDER=$INSTALL_FOLDER
+export INSTALL_FOLDER=$(readlink -m $INSTALL_FOLDER)
+
+clear
 
 usage
 
meta/recipes-devtools/installer/adt-installer/scripts/adt_installer_internal +93 -18

155 lines not on this page · raw message

meta/recipes-devtools/installer/adt-installer_1.0.bb +4 -3
index e1edf2f..becdef6 100644
@@ -30,7 +30,7 @@ ALLOW_EMPTY = "1"
 
 PACKAGES = ""
 
-PR = "r9"
+PR = "r10"
 
 ADT_DEPLOY = "${TMPDIR}/deploy/sdk/"
 ADT_DIR = "${WORKDIR}/adt-installer/"
@@ -69,8 +69,9 @@ fakeroot do_populate_adt () {
 	cp adt_installer ${ADT_DIR}
 	cp adt_installer.conf ${ADT_DIR}
 	sed -i -e 's#YOCTOADT_VERSION#${SDK_VERSION}#' ${ADT_DIR}/adt_installer.conf
-        echo 'SDK_VENDOR=${SDK_VENDOR}' >> ${ADT_DIR}/scripts/data_define
-        echo 'INSTALL_FOLDER=${SDKPATH}' >> ${ADT_DIR}/scripts/data_define
+	echo 'SDK_VENDOR=${SDK_VENDOR}' >> ${ADT_DIR}/scripts/data_define
+	echo 'DEFAULT_INSTALL_FOLDER=${SDKPATH}' >> ${ADT_DIR}/scripts/data_define
+	cp ${COREBASE}/scripts/relocate_sdk.py ${ADT_DIR}/scripts/
 	tar cfj adt_installer.tar.bz2 adt-installer
 	cp ${WORKDIR}/adt_installer.tar.bz2 ${ADT_DEPLOY}
 }
Signature · 1 line
1.7.9.5
#4 lore raw
In reply to Laurentiu Palcu
Quoted 18 lines · Laurentiu Palcu

Changes in V2:

	- addressed Richard's comments and restored the spaces back to tabs in do_populate_adt
	  shell function;

Hi,

This patchset adds support for relocating SDK to ADT installer and a couple of fixes.

Thanks,
Laurentiu

The following changes since commit af847d36375aa53f0c1ee2a00c97ba9f38837d1b:

bitbake: bitbake: build.py: Add stampdir argument to cached_mtime_noerror (2012-08-16 12:27:41 +0100)

are available in the git repository at:

Quoted 7 lines

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

Laurentiu Palcu (3):
populate_sdk_base.bbclass: fix SDK relocation issues package.bbclass: change RPATHs for cross-canadian binaries
adt-installer: add support for relocatable SDK

Merged to master, thanks.

Richard