All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saul Wold <sgw@linux.intel.com>
To: openembedded-core@lists.openembedded.org,
	richard.purdie@linuxfoundation.org
Subject: [PATCH] sysvinit-inittab: Add wrapper script to verify console exists
Date: Tue, 24 Nov 2015 13:33:02 -0800	[thread overview]
Message-ID: <1448400782-1258-1-git-send-email-sgw@linux.intel.com> (raw)

Add a wrapper script around getty to check if a given console exists, this
allows for multiple Console ttys to be specified for various boards without
having additional BSP types just for different console types.

[YOCTO #8689]

Signed-off-by: Saul Wold <sgw@linux.intel.com>
---
 meta/recipes-core/sysvinit/sysvinit-inittab/start_getty |  5 +++++
 meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb  | 11 +++++++----
 2 files changed, 12 insertions(+), 4 deletions(-)
 create mode 100644 meta/recipes-core/sysvinit/sysvinit-inittab/start_getty

diff --git a/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty b/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty
new file mode 100644
index 0000000..6eaeb7a
--- /dev/null
+++ b/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty
@@ -0,0 +1,5 @@
+#!/bin/sh
+if [ -c /dev/$2 ]
+then 
+	/sbin/getty -L $1 $2
+fi
diff --git a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
index 49b1326..f539da8 100644
--- a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
+++ b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
@@ -4,7 +4,8 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=80
 
 PR = "r10"
 
-SRC_URI = "file://inittab"
+SRC_URI = "file://inittab \
+           file://start_getty"
 
 S = "${WORKDIR}"
 
@@ -15,8 +16,10 @@ do_compile() {
 }
 
 do_install() {
-	install -d ${D}${sysconfdir}
+    install -d ${D}${sysconfdir}
+    install -d ${D}${sysconfdir}/init.d
     install -m 0644 ${WORKDIR}/inittab ${D}${sysconfdir}/inittab
+    install -m 0755 ${WORKDIR}/start_getty ${D}${sysconfdir}/init.d/start_getty
 
     set -x
     tmp="${SERIAL_CONSOLES}"
@@ -24,7 +27,7 @@ do_install() {
     do
 	j=`echo ${i} | sed s/\;/\ /g`
 	label=`echo ${i} | sed -e 's/tty//' -e 's/^.*;//' -e 's/;.*//'`
-	echo "$label:12345:respawn:${base_sbindir}/getty -L ${j}" >> ${D}${sysconfdir}/inittab
+	echo "$label:12345:respawn:${sysconfdir}/init.d/start_getty ${j}" >> ${D}${sysconfdir}/inittab
     done
 
     if [ "${USE_VT}" = "1" ]; then
@@ -73,7 +76,7 @@ fi
 # Set PACKAGE_ARCH appropriately.
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 
-FILES_${PN} = "${sysconfdir}/inittab"
+FILES_${PN} = "${sysconfdir}/inittab ${sysconfdir}/init.d/start_getty"
 CONFFILES_${PN} = "${sysconfdir}/inittab"
 
 USE_VT ?= "1"
-- 
2.1.4



                 reply	other threads:[~2015-11-24 21:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1448400782-1258-1-git-send-email-sgw@linux.intel.com \
    --to=sgw@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.