[meta-xilinx] [PATCH 14/19 v2] Add consoleblank recipe

Jason Wu jason.wu.misc at gmail.com
Wed Apr 27 00:46:08 PDT 2016


This recipe installs a init script to disable console blank

Signed-off-by: Jason Wu <jason.wu.misc at gmail.com>
---
v2:
    use MIT from ${COREBASE}/meta/files/common-licenses

---
 recipes-graphics/consoleblank/console-blank.bb    | 25 +++++++++++++++++++++
 recipes-graphics/consoleblank/files/console-blank | 27 +++++++++++++++++++++++
 2 files changed, 52 insertions(+)
 create mode 100644 recipes-graphics/consoleblank/console-blank.bb
 create mode 100644 recipes-graphics/consoleblank/files/console-blank

diff --git a/recipes-graphics/consoleblank/console-blank.bb b/recipes-graphics/consoleblank/console-blank.bb
new file mode 100644
index 0000000..ae7d09a
--- /dev/null
+++ b/recipes-graphics/consoleblank/console-blank.bb
@@ -0,0 +1,25 @@
+DESCRIPTION = "Startup script - disable console blank"
+SECTION = "base"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+PR = "r0"
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+SRC_URI = "file://console-blank"
+
+inherit update-rc.d
+
+INITSCRIPT_NAME = "console-blank"
+INITSCRIPT_PARAMS = "start 39 S . stop 31 0 6 ."
+#FILES_${PN} = "${sysconfdir}/init.d/console-blank"
+
+# # # add to build if system machine supports screen
+# PACKAGES += ' \
+# 	${@bb.utils.contains("MACHINE_FEATURES", "screen", "console-blank", "",d)} \
+# 	'
+
+do_install () {
+	install -d ${D}/${sysconfdir}/init.d/
+	install -m 0755 ${WORKDIR}/console-blank ${D}${sysconfdir}/init.d/
+}
\ No newline at end of file
diff --git a/recipes-graphics/consoleblank/files/console-blank b/recipes-graphics/consoleblank/files/console-blank
new file mode 100644
index 0000000..58c2f33
--- /dev/null
+++ b/recipes-graphics/consoleblank/files/console-blank
@@ -0,0 +1,27 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          consoleblank.sh
+# Required-Start:
+# Required-Stop:
+# Default-Start:     S
+# Default-Stop:
+# Short-Description: disable console blank
+# Description:       set consoleblank to 0 on tty1
+### END INIT INFO
+
+cur_cb=$(cat /sys/module/kernel/parameters/consoleblank)
+
+if [ $cur_cb -ne 0 ]; then
+	echo "Disable console blank"
+	for i in {0..9}; do
+		echo -e '\033[9;0]' > /dev/tty1
+		cb_chk=$(cat /sys/module/kernel/parameters/consoleblank)
+		if [ $cb_chk -eq 0 ]; then
+			exit 0
+		fi
+	done
+fi
+
+if [ $cb_chk -ne 0 ]; then
+	echo "Error: fail to disable console blank"
+fi
\ No newline at end of file
-- 
1.9.1




More information about the meta-xilinx mailing list