[1/1] board/raspberrypi/post-build.sh: let HDMI console depends on generic getty option
diff mbox series

Message ID 20191028090150.15099-1-mailist@logilin.fr
State New
Headers show
Series
  • [1/1] board/raspberrypi/post-build.sh: let HDMI console depends on generic getty option
Related show

Commit Message

Christophe Blaess Oct. 28, 2019, 9:01 a.m. UTC
From: Christophe Blaess <christophe.blaess@logilin.fr>

When the BR2_TARGET_GENERIC_GETTY option is disabled, the inittab line
running getty on serial console is commented out. But the line running
the HDMI console on Raspberry Pi is still enabled. With this patch the
HDMI getty line is removed.

Signed-off-by: Christophe Blaess <christophe.blaess@logilin.fr>
---
 board/raspberrypi/post-build.sh | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Patch
diff mbox series

diff --git a/board/raspberrypi/post-build.sh b/board/raspberrypi/post-build.sh
index 5e5eb71100..4d07dc01eb 100755
--- a/board/raspberrypi/post-build.sh
+++ b/board/raspberrypi/post-build.sh
@@ -5,7 +5,11 @@  set -e
 
 # Add a console on tty1
 if [ -e ${TARGET_DIR}/etc/inittab ]; then
-    grep -qE '^tty1::' ${TARGET_DIR}/etc/inittab || \
-	sed -i '/GENERIC_SERIAL/a\
+    # Remove tty1 line from previous build.
+    sed -i '/^tty1::/d' ${TARGET_DIR}/etc/inittab
+    if grep -q '^BR2_TARGET_GENERIC_GETTY=y$' ${BR2_CONFIG}; then
+        # Add tty1 line after serial console.
+        sed -i '/GENERIC_SERIAL/a\
 tty1::respawn:/sbin/getty -L  tty1 0 vt100 # HDMI console' ${TARGET_DIR}/etc/inittab
+    fi
 fi