diff options
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/populate_sdk_base.bbclass | 48 |
1 files changed, 42 insertions, 6 deletions
diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass index c025d4083c..923f9257a6 100644 --- a/meta/classes/populate_sdk_base.bbclass +++ b/meta/classes/populate_sdk_base.bbclass | |||
@@ -136,7 +136,10 @@ DEFAULT_INSTALL_DIR="${SDKPATH}" | |||
136 | SUDO_EXEC="" | 136 | SUDO_EXEC="" |
137 | target_sdk_dir="" | 137 | target_sdk_dir="" |
138 | answer="" | 138 | answer="" |
139 | while getopts ":yd:" OPT; do | 139 | relocate=1 |
140 | savescripts=0 | ||
141 | verbose=0 | ||
142 | while getopts ":yd:DRS" OPT; do | ||
140 | case $OPT in | 143 | case $OPT in |
141 | y) | 144 | y) |
142 | answer="Y" | 145 | answer="Y" |
@@ -145,15 +148,33 @@ while getopts ":yd:" OPT; do | |||
145 | d) | 148 | d) |
146 | target_sdk_dir=$OPTARG | 149 | target_sdk_dir=$OPTARG |
147 | ;; | 150 | ;; |
151 | D) | ||
152 | verbose=1 | ||
153 | ;; | ||
154 | R) | ||
155 | relocate=0 | ||
156 | savescripts=1 | ||
157 | ;; | ||
158 | S) | ||
159 | savescripts=1 | ||
160 | ;; | ||
148 | *) | 161 | *) |
149 | echo "Usage: $(basename $0) [-y] [-d <dir>]" | 162 | echo "Usage: $(basename $0) [-y] [-d <dir>]" |
150 | echo " -y Automatic yes to all prompts" | 163 | echo " -y Automatic yes to all prompts" |
151 | echo " -d <dir> Install the SDK to <dir>" | 164 | echo " -d <dir> Install the SDK to <dir>" |
165 | echo "======== Advanced DEBUGGING ONLY OPTIONS ========" | ||
166 | echo " -S Save relocation scripts" | ||
167 | echo " -R Do not relocate executables" | ||
168 | echo " -D use set -x to see what is going on" | ||
152 | exit 1 | 169 | exit 1 |
153 | ;; | 170 | ;; |
154 | esac | 171 | esac |
155 | done | 172 | done |
156 | 173 | ||
174 | if [ $verbose = 1 ] ; then | ||
175 | set -x | ||
176 | fi | ||
177 | |||
157 | printf "Enter target directory for SDK (default: $DEFAULT_INSTALL_DIR): " | 178 | printf "Enter target directory for SDK (default: $DEFAULT_INSTALL_DIR): " |
158 | if [ "$target_sdk_dir" = "" ]; then | 179 | if [ "$target_sdk_dir" = "" ]; then |
159 | read target_sdk_dir | 180 | read target_sdk_dir |
@@ -231,10 +252,23 @@ if [ "$dl_path" = "" ] ; then | |||
231 | exit 1 | 252 | exit 1 |
232 | fi | 253 | fi |
233 | executable_files=$($SUDO_EXEC find $native_sysroot -type f -perm +111) | 254 | executable_files=$($SUDO_EXEC find $native_sysroot -type f -perm +111) |
234 | $SUDO_EXEC ${env_setup_script%/*}/relocate_sdk.py $target_sdk_dir $dl_path $executable_files | 255 | |
235 | if [ $? -ne 0 ]; then | 256 | tdir=`mktemp -d` |
236 | echo "SDK could not be set up. Relocate script failed. Abort!" | 257 | if [ x$tdir = x ] ; then |
237 | exit 1 | 258 | echo "SDK relocate failed, could not create a temporary directory" |
259 | exit 1 | ||
260 | fi | ||
261 | echo "#!/bin/bash" > $tdir/relocate_sdk.sh | ||
262 | echo exec ${env_setup_script%/*}/relocate_sdk.py $target_sdk_dir $dl_path $executable_files >> $tdir/relocate_sdk.sh | ||
263 | $SUDO_EXEC mv $tdir/relocate_sdk.sh ${env_setup_script%/*}/relocate_sdk.sh | ||
264 | $SUDO_EXEC chmod 755 ${env_setup_script%/*}/relocate_sdk.sh | ||
265 | rm -rf $tdir | ||
266 | if [ $relocate = 1 ] ; then | ||
267 | $SUDO_EXEC ${env_setup_script%/*}/relocate_sdk.sh | ||
268 | if [ $? -ne 0 ]; then | ||
269 | echo "SDK could not be set up. Relocate script failed. Abort!" | ||
270 | exit 1 | ||
271 | fi | ||
238 | fi | 272 | fi |
239 | 273 | ||
240 | # replace ${SDKPATH} with the new prefix in all text files: configs/scripts/etc | 274 | # replace ${SDKPATH} with the new prefix in all text files: configs/scripts/etc |
@@ -249,7 +283,9 @@ echo done | |||
249 | 283 | ||
250 | # delete the relocating script, so that user is forced to re-run the installer | 284 | # delete the relocating script, so that user is forced to re-run the installer |
251 | # if he/she wants another location for the sdk | 285 | # if he/she wants another location for the sdk |
252 | $SUDO_EXEC rm ${env_setup_script%/*}/relocate_sdk.py | 286 | if [ $savescripts = 0 ] ; then |
287 | $SUDO_EXEC rm ${env_setup_script%/*}/relocate_sdk.py ${env_setup_script%/*}/relocate_sdk.sh | ||
288 | fi | ||
253 | 289 | ||
254 | echo "SDK has been successfully set up and is ready to be used." | 290 | echo "SDK has been successfully set up and is ready to be used." |
255 | 291 | ||