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