From 71ea039a057c7fc6c957bb865e9542a3d5dd8f7e 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 ]` used is an incomplete conditional test. In bash and similar shells, `[ -n ]` without a string following `-n` is considered incomplete. /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. The condition `[ -n ]` causes the script to stop and hence, android-tools-adbd service doesn't start. Signed-off-by: Chirag Jain --- .../qcom/android-gadget-setup.machine | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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..59d4c70f5 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 @@ -1,4 +1,4 @@ manufacturer=Qualcomm model=`hostname` androidserial="$(sed -n -e '/androidboot.serialno/ s/.*androidboot.serialno=\([^ ]*\).*/\1/gp ' /proc/cmdline)" -[ -n "$androidserial" ] && serial="$androidserial" +[ -n "$androidserial" ] && serial="$androidserial" || true