RFC: using /var/run/console-device in finish-install
Hello,
I would like to submit the attached patch for finish-install to switch
console device detection there to using /var/run/console-device, which
is the authoritative source of this information for kernels >= 2.6.38
(see my recent changes to rootskel for details).
If you have any objections, please let me know, otherwise I'm going to
push it and upload new finish-install tomorrow.
Best regards,
--
Jurij Smakov jurij@wooyd.org
Key: http://www.wooyd.org/pgpkey/ KeyID: C99E03CC
>From f6e7764bb31e0826e86f78bb1ede57aefe943d50 Mon Sep 17 00:00:00 2001
From: Jurij Smakov <jurij@debian.org>
Date: Sun, 22 May 2011 14:40:12 +0100
Subject: [PATCH] Use /var/run/console-device to determine the console device.
Starting with kernels 2.6.38 the console device is accurately
determined and written to /var/run/console-device by rootskel.
An added advantage of this approach is that it will work for
kfreebsd as well, while the old way is broken for it (kfreebsd
does not have /proc/<pid>/fd directories).
---
debian/changelog | 11 +++++++++++
finish-install.d/90console | 5 +----
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 847e0f1..8e19dd5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,14 @@
+finish-install (2.31) UNRELEASED; urgency=low
+
+ [ Jurij Smakov ]
+ * Use /var/run/console-device to determine the console device.
+ Starting with kernels 2.6.38 this is accurately determined
+ and written to this file by rootskel. An added advantage is
+ that it will work for kfreebsd as well, while the old way is
+ broken for it (it does not have /proc/<pid>/fd directories).
+
+ -- Jurij Smakov <jurij@debian.org> Sun, 22 May 2011 14:39:08 +0100
+
finish-install (2.30) unstable; urgency=low
[ Samuel Thibault ]
diff --git a/finish-install.d/90console b/finish-install.d/90console
index 57c95d0..9886724 100755
--- a/finish-install.d/90console
+++ b/finish-install.d/90console
@@ -34,10 +34,7 @@ case "$(udpkg --print-os)" in
console=console
;;
*)
- inst_pid=$(pidof debian-installer | sed "s/ /\n/g" | sort -n | head -n 1)
- rawconsole=$(readlink /proc/${inst_pid}/fd/0)
- console=$(mapdevfs "$rawconsole")
- rawconsole=${rawconsole#/dev/}
+ console=$(cat /var/run/console-device)
console=${console#/dev/}
;;
esac
--
1.7.4.4
Reply to: