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

[PATCH] made nottyautologin work with persistency



Hi

I use a Debian Live system with persistency. Because of the following
bug I need to use the boot option "nottyautologin":
https://bugs.kde.org/show_bug.cgi?id=247465

If you do not use this option only *once*, the getty entries
in /etc/fstab are replaced with login entries. Subsequent uses of the
"nottyautologin" boot option have no effect and you end up running
constantly into the bug mentioned above.

Please accept the attached patch that makes the nottyautologin option
also work on systems with persistency enabled.

Regards

Ronny Standtke

-- 
Ronny Standtke                 Fachhochschule Nordwestschweiz
Dozent Medienpädagogik / ICT   Pädagogische Hochschule
Telefon: +41 32 628 67 08      Obere Sternengasse 7
Mobil  : +41 79 786 81 82      4502 Solothurn
>From 401cfba15da114d9ec2c1ee3493b770eb76cecda Mon Sep 17 00:00:00 2001
From: Ronny Standtke <ronny.standtke@fhnw.ch>
Date: Thu, 2 Dec 2010 20:53:46 +0100
Subject: [PATCH] made nottyautologin work with persistency

---
 scripts/config/016-nottyautologin |   31 +++++++++++++++++++++++++++++++
 scripts/config/016-sysvinit       |    8 ++------
 2 files changed, 33 insertions(+), 6 deletions(-)
 create mode 100755 scripts/config/016-nottyautologin

diff --git a/scripts/config/016-nottyautologin b/scripts/config/016-nottyautologin
new file mode 100755
index 0000000..eaad9fd
--- /dev/null
+++ b/scripts/config/016-nottyautologin
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+## live-config(7) - System Configuration Scripts
+## Copyright (C) 2006-2010 Daniel Baumann <daniel@debian.org>
+##
+## live-config comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
+## This is free software, and you are welcome to redistribute it
+## under certain conditions; see COPYING for details.
+
+
+Sysvinit ()
+{
+	# Checking if package is installed
+	if [ ! -e /var/lib/dpkg/info/sysvinit.list ]
+	then
+		return
+	fi
+
+	echo -n " sysvinit"
+
+	Configure_sysvinit_nologin
+}
+
+Configure_sysvinit_nologin ()
+{
+	sed -i -e "s|^\([^:]*:[^:]*:[^:]*\):.*/bin/login.*\(tty[0-9]*\).*$|\1:/sbin/getty 38400 \2|" /etc/inittab
+
+	init q
+}
+
+Sysvinit
diff --git a/scripts/config/016-sysvinit b/scripts/config/016-sysvinit
index b453f08..5b243fd 100755
--- a/scripts/config/016-sysvinit
+++ b/scripts/config/016-sysvinit
@@ -10,9 +10,8 @@
 
 Sysvinit ()
 {
-	# Checking if package is installed or already configured
-	if [ ! -e /var/lib/dpkg/info/sysvinit.list ] || \
-	   [ -e /var/lib/live/config/sysvinit ]
+	# Checking if package is installed
+	if [ ! -e /var/lib/dpkg/info/sysvinit.list ]
 	then
 		return
 	fi
@@ -27,9 +26,6 @@ Configure_sysvinit ()
 	sed -i -e "s|^\([^:]*:[^:]*:[^:]*\):.*getty.*\<\(tty[0-9]*\).*$|\1:/bin/login -f ${LIVE_USERNAME} </dev/\2 >/dev/\2 2>\&1|" /etc/inittab
 
 	init q
-
-	# Creating state file
-	touch /var/lib/live/config/sysvinit
 }
 
 Sysvinit
-- 
1.6.3.1


Reply to: