diff --git a/board/bsh/imx8mn-bsh-smm-s2/post-build.sh b/board/bsh/imx8mn-bsh-smm-s2/post-build.sh
index 49df4cd6fb10..ede1738ecbc5 100755
--- a/board/bsh/imx8mn-bsh-smm-s2/post-build.sh
+++ b/board/bsh/imx8mn-bsh-smm-s2/post-build.sh
@@ -1,4 +1,6 @@
 #!/bin/sh
+set -eu
+
 BOARD_DIR="$(dirname $0)"
 
 cp ${BOARD_DIR}/nand-full.lst ${BINARIES_DIR}
