[OE-core] [PATCHv2 2/2] initscripts: Add changetodefaultvt for 1, 2, 3, 4 runlevels

Otavio Salvador otavio at ossystems.com.br
Thu Mar 19 18:44:44 UTC 2015


On Thu, Mar 19, 2015 at 6:47 AM, Aníbal Limón
<anibal.limon at linux.intel.com> wrote:
> When change between runlevel 5 to another non-graphic runlevel
> the console stays in the tty where X was launched.
>
> This patchs add a default switch to tty1.
>
> [YOCTO #5336]
>
> Signed-off-by: Aníbal Limón <anibal.limon at linux.intel.com>
> ---
>  .../initscripts/initscripts-1.0/changetodefaultvt.sh           | 10 ++++++++++
>  meta/recipes-core/initscripts/initscripts_1.0.bb               |  6 ++++++
>  2 files changed, 16 insertions(+)
>  create mode 100755 meta/recipes-core/initscripts/initscripts-1.0/changetodefaultvt.sh
>
> diff --git a/meta/recipes-core/initscripts/initscripts-1.0/changetodefaultvt.sh b/meta/recipes-core/initscripts/initscripts-1.0/changetodefaultvt.sh
> new file mode 100755
> index 0000000..bbef7ed
> --- /dev/null
> +++ b/meta/recipes-core/initscripts/initscripts-1.0/changetodefaultvt.sh
> @@ -0,0 +1,10 @@
> +#!/bin/sh
> +### BEGIN INIT INFO
> +# Provides:             changetodefaultvt
> +# Required-Start:
> +# Required-Stop:
> +# Default-Start:        1 2 3 4
> +# Default-Stop:
> +### END INIT INFO
> +
> +chvt 1

I tried to find this in Debian and failed. How normal distros are
handling this? After more thinking this seems to be something to be
handled in Xorg not init.

> diff --git a/meta/recipes-core/initscripts/initscripts_1.0.bb b/meta/recipes-core/initscripts/initscripts_1.0.bb
> index dfb75b2..e0841cf 100644
> --- a/meta/recipes-core/initscripts/initscripts_1.0.bb
> +++ b/meta/recipes-core/initscripts/initscripts_1.0.bb
> @@ -33,6 +33,7 @@ SRC_URI = "file://functions \
>             file://GPLv2.patch \
>             file://dmesg.sh \
>             file://logrotate-dmesg.conf \
> +           file://changetodefaultvt.sh \
>  "
>
>  S = "${WORKDIR}"
> @@ -100,6 +101,7 @@ do_install () {
>         install -m 0644    ${WORKDIR}/volatiles         ${D}${sysconfdir}/default/volatiles/00_core
>         install -m 0755    ${WORKDIR}/dmesg.sh          ${D}${sysconfdir}/init.d
>         install -m 0644    ${WORKDIR}/logrotate-dmesg.conf ${D}${sysconfdir}/
> +       install -m 0755    ${WORKDIR}/changetodefaultvt.sh      ${D}${sysconfdir}/init.d

Conditional please

>         if [ "${TARGET_ARCH}" = "arm" ]; then
>                 install -m 0755 ${WORKDIR}/alignment.sh ${D}${sysconfdir}/init.d
> @@ -112,6 +114,10 @@ do_install () {
>  #
>  # Create runlevel links
>  #
> +       if ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'true', 'false', d)}; then
> +               update-rc.d -r ${D} changetodefaultvt.sh start 99 1 2 3 4 .
> +       fi
> +
>         update-rc.d -r ${D} rmnologin.sh start 99 2 3 4 5 .
>         update-rc.d -r ${D} sendsigs start 20 0 6 .
>         update-rc.d -r ${D} urandom start 30 S 0 6 .
> --
> 1.8.4.5
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core



-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750



More information about the Openembedded-core mailing list