aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLisa Nguyen <lisa.nguyen@linaro.org>2016-07-25 19:00:29 -0700
committerLisa Nguyen <lisa.nguyen@linaro.org>2016-09-12 16:40:13 -0700
commitaea49c3f425df8530f3306e1f033e25d2a1df33d (patch)
treed794f7fa311d03b4f989f9fb41ac6e8f89f8e8b7
parentaec8851f5f6583666396fa54dd598d91ef5b5ee3 (diff)
functions: Fix logic for get_os() function
To determine which OS the scripts are running on, check if the build.prop file exists instead of using the lsb_release command. If it does, then the scripts are running on Android; otherwise, it's Ubuntu. Signed-off-by: Lisa Nguyen <lisa.nguyen@linaro.org>
-rw-r--r--include/functions.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/include/functions.sh b/include/functions.sh
index dacf936..10b8de8 100644
--- a/include/functions.sh
+++ b/include/functions.sh
@@ -423,14 +423,15 @@ sigtrap() {
# currently we support ubuntu and android
get_os() {
- lsb_release -a 2>&1 | grep -i ubuntu > /dev/null
- if [ $? -eq 0 ]; then
+ build_prop_file="\system\build.prop"
+
+ if [ -e "$build_prop_file" ]; then
# for ubuntu
return 1
- else
- # for android (if needed can look for build.prop)
+ else
+ # for android
return 2
- fi
+ fi
}
is_root() {