[meta-xilinx] [PATCH 15/20] Add consoleblank recipe

Nathan Rossi nathan at nathanrossi.com
Tue Apr 12 02:10:53 PDT 2016


On Mon, Apr 11, 2016 at 11:23 PM, Jason Wu <jason.wu.misc at gmail.com> wrote:
> This recipe installs a init script to disable console blank
>
> Signed-off-by: Jason Wu <jason.wu.misc at gmail.com>
> ---
>  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..18001a2
> --- /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://${XILINXBASE}/COPYING.MIT;md5=838c366f69b72c5df05c96dff79b35f2"

Use the ${COREBASE}/files/common-licenses/MIT here instead of the one
in the meta-xilinx layer.

Regards,
Nathan

> +
> +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
>
> --
> _______________________________________________
> meta-xilinx mailing list
> meta-xilinx at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-xilinx



More information about the meta-xilinx mailing list