Skip to content

Commit

Permalink
android-gadget-setup: fix conditional argument to assign serial variable
Browse files Browse the repository at this point in the history
Change the conditional argument to check if androidserial is non-empty. The
condition `[ -n ]` when `androidserial` is empty is equated to `false` which
results in an non-zero status from `android-gadget-setup.machine`.
/usr/bin/android-gadget-setup starts with `set -e` is used to change
behavior of the shell in various ways. `-e` option causes the shell to exit as
soon a command exits with a non-zero status. Hence, executing `true` in
the end results in a zero exit status in all cases, which suffices the
condition  for `set -e`, hence unblocking android-tools-adbd service when
`androidserial` is not defined.

Signed-off-by: Chirag Jain <[email protected]>
  • Loading branch information
chirag-jn committed Nov 21, 2023
1 parent 1842039 commit 9a65182
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ manufacturer=Qualcomm
model=`hostname`
androidserial="$(sed -n -e '/androidboot.serialno/ s/.*androidboot.serialno=\([^ ]*\).*/\1/gp ' /proc/cmdline)"
[ -n "$androidserial" ] && serial="$androidserial"
true

0 comments on commit 9a65182

Please sign in to comment.