[PATCH] defaultenv: bin/devboot: propagate exit status of boot command

Ahmad Fatoum a.fatoum at pengutronix.de
Mon Sep 21 05:23:28 PDT 2026


The script ends with cd "${saved_pwd}", so its exit status is that of
the cd and not of the boot command before it.

Save the exit status of the boot command and exit with it after
changing back to the previous directory.

Fixes: 1003a9d70373 ("defaultenv: base: add new devboot script")
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 defaultenv/defaultenv-2-base/bin/devboot | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/defaultenv/defaultenv-2-base/bin/devboot b/defaultenv/defaultenv-2-base/bin/devboot
index 124bfec01ba3..64e4dabcb958 100644
--- a/defaultenv/defaultenv-2-base/bin/devboot
+++ b/defaultenv/defaultenv-2-base/bin/devboot
@@ -44,5 +44,7 @@ fi
 
 echo boot ${override_args} $*
 boot ${override_args} $*
+ret=$?
 
 cd "${saved_pwd}"
+exit $ret
-- 
2.47.3




More information about the barebox mailing list