Skip to contentSkip to conversation

busybox: Fix busybox-init on non-tty consoles

PATCH Superseded Stefan Agner 2 participants 2 messages Aug 8, 2016

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 busybox: Fix busybox-init on non-tty consoles

When using non-tty consoles (e.g. VirtIO console /dev/hvc0) the current init system fails with:
process '/sbin/getty 115200 hvc0' (pid 545) exited. Scheduling for restart. can't open /dev/ttyhvc0: No such file or directory

The first field needs to be a valid device. The BusyBox inittab example explains as follows:
"<id>: WARNING: This field has a non-traditional meaning for BusyBox init!

The id field is used by BusyBox init to specify the controlling tty for the specified process to run on. The contents of this field are appended to "/dev/" and used as-is."

---
 meta/recipes-core/busybox/busybox.inc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-core/busybox/busybox.inc +2 -2
index 5e91a26..4765c28 100644
@@ -286,8 +286,8 @@ do_install () {
                         for i in $tmp
                         do
                                 j=`echo ${i} | sed s/\;/\ /g`
-                                label=`echo ${i} | sed -e 's/tty//' -e 's/^.*;//' -e 's/;.*//'`
-                                echo "tty$label::respawn:${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab
+                                id=`echo ${i} | -e 's/^.*;//' -e 's/;.*//'`
+                                echo "$id::respawn:${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab
                         done
                 fi
         fi
Signature · 1 line
2.9.0
#1 lore raw
Quoted 26 lines · Stefan Agner

When using non-tty consoles (e.g. VirtIO console /dev/hvc0) the current init system fails with:
process '/sbin/getty 115200 hvc0' (pid 545) exited. Scheduling for restart. can't open /dev/ttyhvc0: No such file or directory

The first field needs to be a valid device. The BusyBox inittab example explains as follows:
"<id>: WARNING: This field has a non-traditional meaning for BusyBox init!

The id field is used by BusyBox init to specify the controlling tty for the specified process to run on. The contents of this field are appended to "/dev/" and used as-is."

---
meta/recipes-core/busybox/busybox.inc | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-core/busybox/busybox.inc +0 -0
index 5e91a26..4765c28 100644

meta/recipes-core/busybox/busybox.inc do_install () { · line 289

Quoted 6 lines
meta/recipes-core/busybox/busybox.inc +1 -2
@@ -286,8 +286,8 @@ do_install () {
                        for i in $tmp
                        do
                                j=`echo ${i} | sed s/\;/\ /g`
-                                label=`echo ${i} | sed -e 's/tty//' -e 's/^.*;//' -e 's/;.*//'`
-                                echo "tty$label::respawn:${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab
+                                id=`echo ${i} | -e 's/^.*;//' -e 's/;.*//‘`

what cmd is this piping it to now ?

Quoted 7 lines
meta/recipes-core/busybox/busybox.inc +1 -1
+                                echo "$id::respawn:${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab
                        done
                fi
        fi
--

2.9.0