Add support for relocatable SDK to ADT installer and some fixes
cover Add support for relocatable SDK to ADT installer and some fixes
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 | 37 +++---- 5 files changed, 126 insertions(+), 39 deletions(-)
Signature · 1 line
1.7.9.5
PATCH 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
@@ -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
PATCH 2/3 package.bbclass: change RPATHs for cross-canadian binaries
In reply to Laurentiu PalcuWhen 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
@@ -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
PATCH 3/3 adt-installer: add support for relocatable SDK
In reply to Laurentiu PalcuSince we made the SDK relocatable, we have to add this functionality to adt-installer too.
Other:
- Changed tabs to spaces in the recipe file too.
--- .../installer/adt-installer/adt_installer | 11 ++ .../adt-installer/scripts/adt_installer_internal | 111 ++++++++++++++++---- .../installer/adt-installer_1.0.bb | 37 +++---- 3 files changed, 123 insertions(+), 36 deletions(-)
meta/recipes-devtools/installer/adt-installer/adt_installer +11 -0
@@ -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 +19 -18
@@ -30,7 +30,7 @@ ALLOW_EMPTY = "1" PACKAGES = "" -PR = "r9" +PR = "r10" ADT_DEPLOY = "${TMPDIR}/deploy/sdk/" ADT_DIR = "${WORKDIR}/adt-installer/"
@@ -56,23 +56,24 @@ ADTREPO = "http://adtrepo.yoctoproject.org/${SDK_VERSION}" do_populate_adt[umask] = "022" fakeroot do_populate_adt () { - cd ${WORKDIR} - mkdir -p ${ADT_DEPLOY} - rm -f ${ADT_DEPLOY}/adt-installer.tar.bz2 - rm -rf ${ADT_DIR} - mkdir -p ${ADT_DIR}/opkg/build - cp -r opkg ${ADT_DIR}/ - sed -i -e 's#ADTREPO_URL#${ADTREPO}#' ${ADT_DIR}/opkg/conf/*.conf - cp -r trunk ${ADT_DIR}/opkg/build/ - mv ${ADT_DIR}/opkg/build/trunk ${ADT_DIR}/opkg/build/opkg-svn - cp -r scripts ${ADT_DIR}/ - 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 - tar cfj adt_installer.tar.bz2 adt-installer - cp ${WORKDIR}/adt_installer.tar.bz2 ${ADT_DEPLOY} + cd ${WORKDIR} + mkdir -p ${ADT_DEPLOY} + rm -f ${ADT_DEPLOY}/adt-installer.tar.bz2 + rm -rf ${ADT_DIR} + mkdir -p ${ADT_DIR}/opkg/build + cp -r opkg ${ADT_DIR}/ + sed -i -e 's#ADTREPO_URL#${ADTREPO}#' ${ADT_DIR}/opkg/conf/*.conf + cp -r trunk ${ADT_DIR}/opkg/build/ + mv ${ADT_DIR}/opkg/build/trunk ${ADT_DIR}/opkg/build/opkg-svn + cp -r scripts ${ADT_DIR}/ + 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 '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} } do_populate_adt[nostamp] = "1"
Signature · 1 line
1.7.9.5
Re: [PATCH 3/3] adt-installer: add support for relocatable SDK
Quoted 5 lines · Laurentiu Palcu
Since we made the SDK relocatable, we have to add this functionality to adt-installer too.
Other:
- Changed tabs to spaces in the recipe file too.
Shell functions use tabs, python uses spaces. The OE TSC has thought long and hard about this and that is the decision. Its not perfect but the alternatives will cause more problems than any benefit is worth.
Cheers,
Richard
Re: [PATCH 3/3] adt-installer: add support for relocatable SDK
Quoted 10 lines · Richard Purdie
Quoted 5 lines · Laurentiu Palcu
Since we made the SDK relocatable, we have to add this functionality to adt-installer too.
Other:
- Changed tabs to spaces in the recipe file too.Shell functions use tabs, python uses spaces. The OE TSC has thought long and hard about this and that is the decision. Its not perfect but the alternatives will cause more problems than any benefit is worth.
I saw so many warnings lately with "variable do_xxx contains tabs, please remove these" I got carried by the wave! :| I'll resend the patches and restore the tabs!
Thanks,
Laurentiu
Quoted 12 lines
Cheers,
Richard
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Re: [PATCH 3/3] adt-installer: add support for relocatable SDK
In reply to Richard PurdieQuoted 10 lines · Richard Purdie
Quoted 5 lines · Laurentiu Palcu
Since we made the SDK relocatable, we have to add this functionality to adt-installer too.
Other:
- Changed tabs to spaces in the recipe file too.Shell functions use tabs, python uses spaces. The OE TSC has thought long and hard about this and that is the decision. Its not perfect but the alternatives will cause more problems than any benefit is worth.
Is there some report/log/styleguide helping me to understand why we use two tab/space strategies instead of having spaces for all?
Andreas
Quoted 4 lines
Cheers,
Richard
Re: [PATCH 3/3] adt-installer: add support for relocatable SDK
Quoted 6 lines · Andreas Müller
Quoted 4 lines · Richard Purdie
Quoted 3 lines · Laurentiu Palcu
Since we made the SDK relocatable, we have to add this functionality to adt-installer too.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Other:
- Changed tabs to spaces in the recipe file too.Shell functions use tabs, python uses spaces. The OE TSC has thought long and hard about this and that is the decision. Its not perfect but the alternatives will cause more problems than any benefit is worth.
Is there some report/log/styleguide helping me to understand why we use two tab/space strategies instead of having spaces for all?
This is the style the bulk of the metadata uses. We really don't want patches changing a significant portion of the metadata for cosmetic reasons. It would create a world of pain for people handling/merging patches, a lot of needless code churn and significant problems for people trying to backport changes to older versions of the code base amongst other reasons.
Cheers,
Richard