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

Re: [PATCH] Configure getty on hvc0 under Xen



On Sat, 2008-05-10 at 13:05 +0100, Ian Campbell wrote:
> 
> Would modifying the way $console is determined at lines 32-37 to work
> off of /proc/cmdline in the same way grub-installer works (i.e.
> pulling out the last console=) be acceptable? 

Of course that doesn't work if there is no console= line. How about
using console= if it is present and falling back to the current stdin of
the installer method? is it ever the case that the installer runs on
something other than the default console?

Not yet tested POC patch attached.

Ian.

-- 
Ian Campbell

Deadwood, n.:
	Anyone in your company who is more senior than you are.
Index: finish-install.d/90console
===================================================================
--- finish-install.d/90console	(revision 53286)
+++ finish-install.d/90console	(working copy)
@@ -27,11 +27,21 @@
 # we have.  The stdin of /sbin/debian-installer seems
 # to tell the truth.
 
-# Workaround for pidof regression in busybox 1.9.1 (#472846)
-#inst_pid=$(pidof debian-installer | sed "s/ /\n/g" | sort -n | head -n 1)
-inst_pid=$(ps | grep "[/]sbin/debian-installer" | \
-	sed -r "s/^ *([0-9]*).*/\1/" | sort -n | head -n 1)
-rawconsole=$(readlink /proc/${inst_pid}/fd/0)
+get_console() {
+	# Get the last 'console=' entry (if none, use installer's stdin)
+	local defconsole="$(sed -e 's/.*\(console=[^ ]*\).*/\1/' /proc/cmdline)"
+	if [ "${defconsole#console=}" != "${defconsole}" ] ; then
+		echo $defconsole
+	else
+		# Workaround for pidof regression in busybox 1.9.1 (#472846)
+		#inst_pid=$(pidof debian-installer | sed "s/ /\n/g" | sort -n | head -n 1)
+		local inst_pid=$(ps | grep "[/]sbin/debian-installer" | \
+			sed -r "s/^ *([0-9]*).*/\1/" | sort -n | head -n 1)
+		readlink /proc/${inst_pid}/fd/0
+	fi
+}
+
+rawconsole=$(get_console)
 console=$(mapdevfs "$rawconsole") 
 rawconsole=${rawconsole#/dev/}
 console=${console#/dev/}

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: