meta-phosphor: phosphor-mmc-init: fix multi-word variable expansion
The $gpiopresent expansion needs to be unquoted, because gpioget needs
to take the gpiochip and line number (both of which gpiofind produces)
as separate arguments.
Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Change-Id: Iaa5943cf247e523a9c901325ce2290a4f537a50f
diff --git a/meta-phosphor/recipes-phosphor/initrdscripts/phosphor-mmc-init/mmc-init.sh b/meta-phosphor/recipes-phosphor/initrdscripts/phosphor-mmc-init/mmc-init.sh
index cc1c0dd..12cf53a 100644
--- a/meta-phosphor/recipes-phosphor/initrdscripts/phosphor-mmc-init/mmc-init.sh
+++ b/meta-phosphor/recipes-phosphor/initrdscripts/phosphor-mmc-init/mmc-init.sh
@@ -63,7 +63,10 @@
mkdir -p /var/lock
resetval=$(fw_printenv -n rwreset 2>/dev/null)
if gpiopresent=$(gpiofind factory-reset-toggle) ; then
- gpioval=$(gpioget "$gpiopresent")
+ # gpiopresent contains both the gpiochip and line number as
+ # separate words, and gpioget needs to see them as such.
+ # shellcheck disable=SC2086
+ gpioval=$(gpioget $gpiopresent)
else
gpioval=""
fi