[v2,10/10] board: imx8mn-bsh-smm-s2/pro: install a script for testing DRM

Message ID 20240911150733.2914626-10-dario.binacchi@amarulasolutions.com
State New
Headers show
Series
  • [v2,01/10] board: imx8mn-bsh-smm-s2-pro add boot script
Related show

Commit Message

Dario Binacchi Sept. 11, 2024, 3:07 p.m. UTC
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 .../rootfs_overlay/etc/init.d/S99displaytest  | 42 +++++++++++++++++++
 configs/imx8mn_bsh_smm_s2_pro_defconfig       |  1 +
 2 files changed, 43 insertions(+)
 create mode 100755 board/bsh/common/imx8mn-bsh-smm-s2/rootfs_overlay/etc/init.d/S99displaytest

Patch

diff --git a/board/bsh/common/imx8mn-bsh-smm-s2/rootfs_overlay/etc/init.d/S99displaytest b/board/bsh/common/imx8mn-bsh-smm-s2/rootfs_overlay/etc/init.d/S99displaytest
new file mode 100755
index 000000000000..5428ecbbf251
--- /dev/null
+++ b/board/bsh/common/imx8mn-bsh-smm-s2/rootfs_overlay/etc/init.d/S99displaytest
@@ -0,0 +1,42 @@ 
+#!/bin/sh
+#
+
+start() {
+	printf "Starting fb-test:"
+	/usr/bin/fb-test -p 6
+	if [ $? -eq 0 ]; then
+		echo "OK"
+		sleep 2
+	else
+		echo "FAIL"
+	fi
+	printf "Starting modetest"
+	start-stop-daemon -S -q -m -p /run/modetest.pid \
+			  -x /usr/bin/modetest -- -M mxsfb-drm -s 38@36:640x1280
+}
+stop() {
+	printf "Stopping modetest: "
+	start-stop-daemon -K -q -p /run/modetest.pid
+	[ $? = 0 ] && echo "OK" || echo "FAIL"
+}
+restart() {
+	stop
+	start
+}
+
+case "$1" in
+  start)
+	start
+	;;
+  stop)
+	stop
+	;;
+  restart|reload)
+	restart
+	;;
+  *)
+	echo "Usage: $0 {start|stop|restart}"
+	exit 1
+esac
+
+exit $?
diff --git a/configs/imx8mn_bsh_smm_s2_pro_defconfig b/configs/imx8mn_bsh_smm_s2_pro_defconfig
index 03f5adc53826..4f0d01bc6125 100644
--- a/configs/imx8mn_bsh_smm_s2_pro_defconfig
+++ b/configs/imx8mn_bsh_smm_s2_pro_defconfig
@@ -4,6 +4,7 @@  BR2_GLOBAL_PATCH_DIR="board/bsh/common/imx8mn-bsh-smm-s2/patches"
 BR2_DOWNLOAD_FORCE_CHECK_HASHES=y
 BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
 BR2_TARGET_GENERIC_GETTY_PORT="ttymxc3"
+BR2_ROOTFS_OVERLAY="board/bsh/common/imx8mn-bsh-smm-s2/rootfs_overlay"
 BR2_ROOTFS_POST_BUILD_SCRIPT="board/bsh/imx8mn-bsh-smm-s2-pro/post-build.sh"
 BR2_ROOTFS_POST_IMAGE_SCRIPT="board/bsh/imx8mn-bsh-smm-s2-pro/post-image.sh"
 BR2_LINUX_KERNEL=y