From 9a65182ece4454367a71ec21a2537cda2b125848 Mon Sep 17 00:00:00 2001 From: Chirag Jain Date: Tue, 21 Nov 2023 19:30:52 +0530 Subject: [PATCH] android-gadget-setup: fix conditional argument to assign serial variable 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 --- .../qcom/android-gadget-setup.machine | 1 + 1 file changed, 1 insertion(+) diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/android-tools/android-tools-conf-configfs/qcom/android-gadget-setup.machine b/dynamic-layers/openembedded-layer/recipes-devtools/android-tools/android-tools-conf-configfs/qcom/android-gadget-setup.machine index 37f26bbf4..09ca8d55a 100644 --- a/dynamic-layers/openembedded-layer/recipes-devtools/android-tools/android-tools-conf-configfs/qcom/android-gadget-setup.machine +++ b/dynamic-layers/openembedded-layer/recipes-devtools/android-tools/android-tools-conf-configfs/qcom/android-gadget-setup.machine @@ -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