summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/populate_sdk_base.bbclass9
1 files changed, 6 insertions, 3 deletions
diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
index f0b88b34c3..c15a4d4629 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -187,6 +187,9 @@ if [ "$answer" != "Y" -a "$answer" != "y" ]; then
187 exit 1 187 exit 1
188fi 188fi
189 189
190# Try to create the directory (this will not succeed if user doesn't have rights)
191mkdir -p $target_sdk_dir >/dev/null 2>&1
192
190# if don't have the right to access dir, gain by sudo 193# if don't have the right to access dir, gain by sudo
191if [ ! -x $target_sdk_dir -o ! -w $target_sdk_dir -o ! -r $target_sdk_dir ]; then 194if [ ! -x $target_sdk_dir -o ! -w $target_sdk_dir -o ! -r $target_sdk_dir ]; then
192 SUDO_EXEC=$(which "sudo") 195 SUDO_EXEC=$(which "sudo")
@@ -198,10 +201,10 @@ if [ ! -x $target_sdk_dir -o ! -w $target_sdk_dir -o ! -r $target_sdk_dir ]; the
198 # test sudo could gain root right 201 # test sudo could gain root right
199 $SUDO_EXEC pwd >/dev/null 2>&1 202 $SUDO_EXEC pwd >/dev/null 2>&1
200 [ $? -ne 0 ] && echo "Sorry, you are not allowed to execute as root." && exit 1 203 [ $? -ne 0 ] && echo "Sorry, you are not allowed to execute as root." && exit 1
201fi
202 204
203# create dir and don't care about the result. 205 # now that we have sudo rights, create the directory
204$SUDO_EXEC mkdir -p $target_sdk_dir >/dev/null 2>&1 206 $SUDO_EXEC mkdir -p $target_sdk_dir >/dev/null 2>&1
207fi
205 208
206payload_offset=$(($(grep -na -m1 "^MARKER:$" $0|cut -d':' -f1) + 1)) 209payload_offset=$(($(grep -na -m1 "^MARKER:$" $0|cut -d':' -f1) + 1))
207 210