summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorLaurentiu Palcu <laurentiu.palcu@intel.com>2014-02-26 15:54:45 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-02-28 14:01:12 +0000
commit5c6d9a14adf600f7b28ee6d643a07df9abb97999 (patch)
tree90206903cd8f2654c9e3476fd4e05ed095564db4 /meta
parent8d13b43f16ea289afc93f14d5dfbff5d81520a01 (diff)
downloadpoky-5c6d9a14adf600f7b28ee6d643a07df9abb97999.tar.gz
adt_installer: fix issue with x86_64
When the default tune for x86_64 was changed to core2-64, the environment setup script name did not contain x86 anymore. Hence, the adt_installer failed for x86_64. This commit contains a generic fix and is supposed to work with any kind of machine/tune setting. It's actually extracting the environment script name using 'opkg files meta-environment-MACHINE'. So, no need to do any other sort of searches. We know exactly which is the environment setup script for the specified machine. [YOCTO #5806] (From OE-Core rev: a88c386239ddc5816d9045d12cf6db4872fa86da) Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rwxr-xr-xmeta/recipes-devtools/installer/adt-installer/scripts/adt_installer_internal61
1 files changed, 35 insertions, 26 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 e3422f5046..432ba41237 100755
--- a/meta/recipes-devtools/installer/adt-installer/scripts/adt_installer_internal
+++ b/meta/recipes-devtools/installer/adt-installer/scripts/adt_installer_internal
@@ -64,6 +64,23 @@ get_sudo_app()
64 fi 64 fi
65} 65}
66 66
67# this function accepts arch_type (x86, x86_64, arm, ppc, mips) as the first
68# argument, returning the location of the target rootfs
69get_target_rootfs_location() {
70 [ -z "$1" ] && return
71
72 arch_type=$1
73 # rootfs extraction directory
74 target_sysroot_var="\$YOCTOADT_TARGET_SYSROOT_LOC_$arch_type"
75 target_sysroot=`eval echo $target_sysroot_var`
76
77 if [ "$target_sysroot" == "" ]; then
78 return
79 else
80 echo "`readlink -m $target_sysroot`"
81 fi
82}
83
67 84
68#let us install a qemu-native firstly 85#let us install a qemu-native firstly
69#installation step 2 86#installation step 2
@@ -134,6 +151,22 @@ for target_type in $YOCTOADT_TARGETS; do
134 echo_info "Installing cross canadian packages for $machine ..." 151 echo_info "Installing cross canadian packages for $machine ..."
135 $OPKG_INSTALL_NATIVE_CMD packagegroup-cross-canadian-$machine &>> $YOCTOADT_INSTALL_LOG_FILE 152 $OPKG_INSTALL_NATIVE_CMD packagegroup-cross-canadian-$machine &>> $YOCTOADT_INSTALL_LOG_FILE
136 check_result 153 check_result
154
155 target_sysroot=`get_target_rootfs_location $target_type`
156 [ -z "$target_sysroot" ] && continue
157
158 # get the environment setup script paths: original (the one before relocation)
159 # and relocated
160 env_script_original=`$OPKG_CMD -f $OPKG_CONFIG_FILE -o $NATIVE_INSTALL_DIR files meta-environment-$machine|\
161 grep environment-setup`
162 env_script_relocated=$INSTALL_FOLDER/${env_script_original##*/}
163
164 # opkg will not install packagegroup-cross-canadian package if it was already
165 # installed. So, the environment script is in one place or the other.
166 [ -e "$env_script_original" ] && env_script=$env_script_original
167 [ -e "$env_script_relocated" ] && env_script=$env_script_relocated
168
169 $SUDO sed -i -e "s%##SDKTARGETSYSROOT##%$target_sysroot%g" $env_script
137done 170done
138 171
139if [ "$YOCTOADT_QEMU" == "Y" ] || [ "$YOCTOADT_QEMU" = "y" ]; then 172if [ "$YOCTOADT_QEMU" == "Y" ] || [ "$YOCTOADT_QEMU" = "y" ]; then
@@ -232,15 +265,8 @@ echo_info "\nSuccessfully installed selected native ADT!"
232install_target() 265install_target()
233{ 266{
234 267
235# rootfs extraction directory 268target_sysroot=`get_target_rootfs_location $1`
236target_sysroot_var="\$YOCTOADT_TARGET_SYSROOT_LOC_$1" 269[ -z "$target_sysroot" ] && return 0
237target_sysroot=`eval echo $target_sysroot_var`
238
239if [ "$target_sysroot" == "" ]; then
240 return 0
241else
242 target_sysroot=`readlink -m $target_sysroot`
243fi
244 270
245target_sysroot_image_var="\$YOCTOADT_TARGET_SYSROOT_IMAGE_$1" 271target_sysroot_image_var="\$YOCTOADT_TARGET_SYSROOT_IMAGE_$1"
246target_sysroot_image=`eval echo $target_sysroot_image_var` 272target_sysroot_image=`eval echo $target_sysroot_image_var`
@@ -261,23 +287,6 @@ SUDO=$(get_sudo_app $target_sysroot)
261 287
262$SUDO scripts/extract_rootfs $sysroot_image_name $target_sysroot $OECORE_NATIVE_SYSROOT $user_inst_type 288$SUDO scripts/extract_rootfs $sysroot_image_name $target_sysroot $OECORE_NATIVE_SYSROOT $user_inst_type
263check_result 289check_result
264
265echo_info "Updating environment script with target sysroot location."
266if [ "$1" == "x86" ]; then
267 env_filename=`ls $INSTALL_FOLDER/environment-setup-i586*`
268else
269 env_filename=`ls $INSTALL_FOLDER/environment-setup-$1*`
270fi
271
272if [ ! -z "$env_filename" ]; then
273 SUDO=$(get_sudo_app $INSTALL_FOLDER)
274 $SUDO sed -i -e "s%##SDKTARGETSYSROOT##%$target_sysroot%g" $env_filename
275else
276 echo_info "[ADT_INST] Error: Failed to find environment script for arch: $1"
277 return 1
278fi
279
280
281} 290}
282 291
283 292