[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#191588: lilo-installer should use the last console arg on the cmdline



Package: lilo-installer
Version: 0.0.11; reported 2003-05-01
Severity: normal
Tags: patch

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The linux kernel can be passed multiple "console=" arguments on the
command line.  This results in the _last_ one specified being used as
the default.  lilo-installer uses the _first_ one when trying to
determine whether to configure lilo for a serial console.

Also, lilo-installer should emit some sort of message when configuring
lilo to use a serial console to prevent suprises.

The following patch addresses these issues.

Joe Nahmias, DD wannabe


- --- debian/lilo-installer.postinst.orig	2003-02-22 11:54:18.000000000 -0500
+++ debian/lilo-installer.postinst	2003-05-01 19:20:23.000000000 -0400
@@ -41,12 +41,13 @@ fi
 bootdev=`mapdevfs $bootdev`
 rootfs=`mapdevfs $rootfs`
 
- -# serial support
- -
- -if grep -q console=ttyS /proc/cmdline; then
- -    PORT=$(sed -e 's%.*console=ttyS%%' -e 's%,.*%%' /proc/cmdline)
- -    SPEED=$(sed -e 's%.*console=ttyS[0-9]\+,%%' -e 's% .*%%' /proc/cmdline)
+# Use a serial console if current default console is a serial port.
+defconsole=$(sed -e 's/.*console=/console=/')	# default console is last listed
+if echo "${defconsole}" | grep -q console=ttyS; then
+    PORT=$(echo "${defconsole}" | sed -e 's%^console=ttyS%%' -e 's%,.*%%')
+    SPEED=$(echo "${defconsole}" | sed -e 's%^console=ttyS[0-9]\+,%%' -e 's% .*%%')
     SERIAL="${PORT},${SPEED}"
+    echo "Configuring lilo to use serial port ttyS${PORT} as the console."
 fi
 
 #write out lilo.conf


- -- System Information
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux a750.nahmias.net 2.4.20 #1 Thu Jan 9 11:22:09 EST 2003 i686
Locale: LANG=C, LC_CTYPE=C

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+sa7rKl23+OYWEqURAjwAAJ4oGil8w4cTIpA5Bq8V4tTqXyuJ9wCdEiex
J/44XLrVeeGAv13VKu7vGCs=
=4JHK
-----END PGP SIGNATURE-----



Reply to: