summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gentoo.org>2019-09-19 10:18:18 -0700
committerMatt Turner <mattst88@gentoo.org>2019-09-19 10:19:37 -0700
commit3c23b30aed805fb5f6b148f273c0c139eac8f6f3 (patch)
treeff7c2b967036e4b696758d164e141dcc8ad7a75b
parentppc: Move the hvc0 console logic outside (diff)
downloadlivecd-tools-3c23b30aed805fb5f6b148f273c0c139eac8f6f3.tar.gz
livecd-tools-3c23b30aed805fb5f6b148f273c0c139eac8f6f3.tar.bz2
livecd-tools-3c23b30aed805fb5f6b148f273c0c139eac8f6f3.zip
fixinittab: Refactor HW-specific serial console support
Signed-off-by: Matt Turner <mattst88@gentoo.org>
-rw-r--r--init.d/fixinittab28
1 files changed, 19 insertions, 9 deletions
diff --git a/init.d/fixinittab b/init.d/fixinittab
index 4491217..b0fcaeb 100644
--- a/init.d/fixinittab
+++ b/init.d/fixinittab
@@ -30,6 +30,25 @@ start()
sed -i -e '/^s[01]/ s/^/#/' /etc/inittab
sed -i -e '/^b0/ s/^/#/' /etc/inittab
+ if [ -z "${LIVECD_CONSOLE}" ]
+ then
+ for c in hvc0
+ do
+ if [ -c "/dev/${c}" ]
+ then
+ LIVECD_CONSOLE_BAUD=$(stty -F "/dev/${c}" speed)
+
+ eindent
+ ebegin "Adding ${c} console to inittab ..."
+ echo "s0:12345:respawn:/sbin/agetty -a root ${LIVECD_CONSOLE_BAUD} ${c}" >> /etc/inittab
+ eend $?
+ eoutdent
+
+ break
+ fi
+ done
+ fi
+
# SPARC & HPPA console magic
if [ "${HOSTTYPE}" = "sparc" -o "${HOSTTYPE}" = "hppa" ]
then
@@ -94,15 +113,6 @@ start()
fi
fi
- if [ -c "/dev/hvc0" -a "${LIVECD_CONSOLE}" = "" ]
- then
- eindent
- ebegin "Adding hvc console to inittab ..."
- echo "s0:12345:respawn:/sbin/agetty -a root 9600 hvc0 vt320" >> /etc/inittab
- eend $?
- eoutdent
- fi
-
# EFI-based machines should automatically hook up their console lines
if dmesg | grep -q '^Adding console on'
then