diff options
author | Laurentiu Palcu <laurentiu.palcu@intel.com> | 2014-02-26 15:54:45 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-02-28 14:01:12 +0000 |
commit | 5c6d9a14adf600f7b28ee6d643a07df9abb97999 (patch) | |
tree | 90206903cd8f2654c9e3476fd4e05ed095564db4 /meta/recipes-devtools | |
parent | 8d13b43f16ea289afc93f14d5dfbff5d81520a01 (diff) | |
download | poky-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/recipes-devtools')
-rwxr-xr-x | meta/recipes-devtools/installer/adt-installer/scripts/adt_installer_internal | 61 |
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 | ||
69 | get_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 | ||
137 | done | 170 | done |
138 | 171 | ||
139 | if [ "$YOCTOADT_QEMU" == "Y" ] || [ "$YOCTOADT_QEMU" = "y" ]; then | 172 | if [ "$YOCTOADT_QEMU" == "Y" ] || [ "$YOCTOADT_QEMU" = "y" ]; then |
@@ -232,15 +265,8 @@ echo_info "\nSuccessfully installed selected native ADT!" | |||
232 | install_target() | 265 | install_target() |
233 | { | 266 | { |
234 | 267 | ||
235 | # rootfs extraction directory | 268 | target_sysroot=`get_target_rootfs_location $1` |
236 | target_sysroot_var="\$YOCTOADT_TARGET_SYSROOT_LOC_$1" | 269 | [ -z "$target_sysroot" ] && return 0 |
237 | target_sysroot=`eval echo $target_sysroot_var` | ||
238 | |||
239 | if [ "$target_sysroot" == "" ]; then | ||
240 | return 0 | ||
241 | else | ||
242 | target_sysroot=`readlink -m $target_sysroot` | ||
243 | fi | ||
244 | 270 | ||
245 | target_sysroot_image_var="\$YOCTOADT_TARGET_SYSROOT_IMAGE_$1" | 271 | target_sysroot_image_var="\$YOCTOADT_TARGET_SYSROOT_IMAGE_$1" |
246 | target_sysroot_image=`eval echo $target_sysroot_image_var` | 272 | target_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 |
263 | check_result | 289 | check_result |
264 | |||
265 | echo_info "Updating environment script with target sysroot location." | ||
266 | if [ "$1" == "x86" ]; then | ||
267 | env_filename=`ls $INSTALL_FOLDER/environment-setup-i586*` | ||
268 | else | ||
269 | env_filename=`ls $INSTALL_FOLDER/environment-setup-$1*` | ||
270 | fi | ||
271 | |||
272 | if [ ! -z "$env_filename" ]; then | ||
273 | SUDO=$(get_sudo_app $INSTALL_FOLDER) | ||
274 | $SUDO sed -i -e "s%##SDKTARGETSYSROOT##%$target_sysroot%g" $env_filename | ||
275 | else | ||
276 | echo_info "[ADT_INST] Error: Failed to find environment script for arch: $1" | ||
277 | return 1 | ||
278 | fi | ||
279 | |||
280 | |||
281 | } | 290 | } |
282 | 291 | ||
283 | 292 | ||