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:42:01 -0700
commit43ec86a37d4d5dd813db2d53b27f393250354386 (patch)
treed794f7fa311d03b4f989f9fb41ac6e8f89f8e8b7
parent7220c1700511103aa514f4f33b8d323d7dc69549 (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() {