Skip to contentSkip to conversation

init fixes

PATCH Superseded Aníbal Limón 2 participants 5 messages Mar 19, 2015

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover init fixes

The next changes fixes issues related to [YOCTO #5336].

The following changes since commit df0672b038e6942c97d266af9ca175a06f2b0423:

bitbake: toaster: Fix the orderkey to match the column (2015-03-16 17:44:13 +0000)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib alimon/init_fixes
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=alimon/init_fixes

Aníbal Limón (2):
sysvinit-inittab: Fix no tty in runlevel 1.
initscripts: Add changetodefaultvt for 1, 2, 3, 4 runlevels

 .../initscripts/initscripts-1.0/changetodefaultvt.sh           | 10 ++++++++++
 meta/recipes-core/initscripts/initscripts_1.0.bb               |  6 ++++++
 meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb         |  2 +-
 3 files changed, 17 insertions(+), 1 deletion(-)
 create mode 100755 meta/recipes-core/initscripts/initscripts-1.0/changetodefaultvt.sh
Signature · 1 line
1.8.4.5
#1 lore raw

PATCH v2 1/2 sysvinit-inittab: Fix no tty in runlevel 1.

When switch to runlevel 1 (Single user mode), tty was not re-spawn and appears to be a machine hang.

[YOCTO #5336]

---
 meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb +1 -1
index eed2104..e087f0f 100644
@@ -41,7 +41,7 @@ EOF
 
         for n in ${SYSVINIT_ENABLED_GETTYS}
         do
-            echo "$n:2345:respawn:${base_sbindir}/getty 38400 tty$n" >> ${D}${sysconfdir}/inittab
+            echo "$n:12345:respawn:${base_sbindir}/getty 38400 tty$n" >> ${D}${sysconfdir}/inittab
         done
         echo "" >> ${D}${sysconfdir}/inittab
     fi
Signature · 1 line
1.8.4.5
Acked-by on v2 1/2
#2 lore raw

Re: [PATCHv2 1/2] sysvinit-inittab: Fix no tty in runlevel 1.

Quoted 6 lines · Aníbal Limón

When switch to runlevel 1 (Single user mode), tty was not re-spawn and appears to be a machine hang.

[YOCTO #5336]

Signature · 3 lines
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
#3 lore raw

PATCH v2 2/2 initscripts: Add changetodefaultvt for 1, 2, 3, 4 runlevels

In reply to Aníbal Limón

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]

---
 .../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
meta/recipes-core/initscripts/initscripts-1.0/changetodefaultvt.sh new file +10 -0
new file mode 100755
index 0000000..bbef7ed
@@ -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
meta/recipes-core/initscripts/initscripts_1.0.bb +6 -0
index dfb75b2..e0841cf 100644
@@ -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
 
 	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 .
Signature · 1 line
1.8.4.5
#4 lore raw

Re: [PATCHv2 2/2] initscripts: Add changetodefaultvt for 1, 2, 3, 4 runlevels

Quoted 20 lines · Aníbal Limón

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]

---
 .../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
meta/recipes-core/initscripts/initscripts-1.0/changetodefaultvt.sh new file +0 -0
new file mode 100755
index 0000000..bbef7ed

meta/recipes-core/initscripts/initscripts-1.0/changetodefaultvt.sh line 10

Quoted 10 lines
meta/recipes-core/initscripts/initscripts-1.0/changetodefaultvt.sh new file +10 -0
@@ -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.

Quoted 13 lines
meta/recipes-core/initscripts/initscripts_1.0.bb +1 -0
index dfb75b2..e0841cf 100644
@@ -33,6 +33,7 @@ SRC_URI = "file://functions \
            file://GPLv2.patch \
            file://dmesg.sh \
            file://logrotate-dmesg.conf \
+           file://changetodefaultvt.sh \
 "
 
 S = "${WORKDIR}"

meta/recipes-core/initscripts/initscripts_1.0.bb do_install () { · line 104

Quoted 4 lines
meta/recipes-core/initscripts/initscripts_1.0.bb +1 -0
@@ -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

Quoted 21 lines
meta/recipes-core/initscripts/initscripts_1.0.bb +4 -1
        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
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Signature · 3 lines
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