From f5324ed1c8276efe07884a092764bcb880320dee Mon Sep 17 00:00:00 2001
From: Joerg Schirottke <master@kanotix.com>
Date: Sun, 3 Mar 2013 23:33:52 +0100
Subject: fix enable-persistent config and rename the others

---
 .../lib/live/config/003-sudo-trinity               | 65 ----------------------
 .../lib/live/config/0030-sudo-trinity              | 65 ++++++++++++++++++++++
 .../lib/live/config/008-kdm-trinity                | 61 --------------------
 .../lib/live/config/0080-kdm-trinity               | 61 ++++++++++++++++++++
 .../lib/live/config/800-kde-keyboard-layout        | 60 --------------------
 .../lib/live/config/8000-kde-keyboard-layout       | 60 ++++++++++++++++++++
 .../lib/live/config/900-enable-persistent          | 34 -----------
 .../lib/live/config/900-sudo-su-alias              | 42 --------------
 .../lib/live/config/9000-enable-persistent         | 56 +++++++++++++++++++
 .../lib/live/config/9000-sudo-su-alias             | 42 ++++++++++++++
 .../lib/live/config/901-hotfixes                   | 54 ------------------
 .../lib/live/config/9010-hotfixes                  | 54 ++++++++++++++++++
 12 files changed, 338 insertions(+), 316 deletions(-)
 delete mode 100755 config/chroot_local-includes/lib/live/config/003-sudo-trinity
 create mode 100755 config/chroot_local-includes/lib/live/config/0030-sudo-trinity
 delete mode 100755 config/chroot_local-includes/lib/live/config/008-kdm-trinity
 create mode 100755 config/chroot_local-includes/lib/live/config/0080-kdm-trinity
 delete mode 100755 config/chroot_local-includes/lib/live/config/800-kde-keyboard-layout
 create mode 100755 config/chroot_local-includes/lib/live/config/8000-kde-keyboard-layout
 delete mode 100755 config/chroot_local-includes/lib/live/config/900-enable-persistent
 delete mode 100755 config/chroot_local-includes/lib/live/config/900-sudo-su-alias
 create mode 100755 config/chroot_local-includes/lib/live/config/9000-enable-persistent
 create mode 100755 config/chroot_local-includes/lib/live/config/9000-sudo-su-alias
 delete mode 100755 config/chroot_local-includes/lib/live/config/901-hotfixes
 create mode 100755 config/chroot_local-includes/lib/live/config/9010-hotfixes

diff --git a/config/chroot_local-includes/lib/live/config/003-sudo-trinity b/config/chroot_local-includes/lib/live/config/003-sudo-trinity
deleted file mode 100755
index bfb39e5..0000000
--- a/config/chroot_local-includes/lib/live/config/003-sudo-trinity
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/bin/sh
-
-## live-config(7) - System Configuration Scripts
-## Copyright (C) 2006-2011 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.
-
-
-Sudo ()
-{
-	# Checking if package is installed or already configured
-	if [ ! -e /var/lib/dpkg/info/sudo-trinity.list ] || \
-	   [ -e /var/lib/live/config/sudo ]
-	then
-		return
-	fi
-
-	echo -n " sudo"
-
-	Configure_sudo
-}
-
-Configure_sudo ()
-{
-	# Checking if if package is already configured differently
-	if grep -q "^${LIVE_USERNAME}" /etc/sudoers
-	then
-		return
-	fi
-
-	echo "${LIVE_USERNAME}  ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
-
-	sudo -u "${LIVE_USERNAME}" sh -c "echo 'SU_TO_ROOT_SU=sudo' >> /home/${LIVE_USERNAME}/.su-to-rootrc"
-
-	if [ -x /usr/bin/gconftool-2 ]
-	then
-		sudo -u "${LIVE_USERNAME}" gconftool-2 -s -t bool /apps/gksu/sudo-mode true
-		sudo -u "${LIVE_USERNAME}" gconftool-2 -s -t bool /apps/gksu/display-no-pass-info false
-	fi
-
-	# trinity /etc/skel kdesu override hack
-	rm -f /home/${LIVE_USERNAME}/.trinity/share/config/kdesurc
-
-	sudo -u "${LIVE_USERNAME}" sh -c "umask 0077 && mkdir -p /home/${LIVE_USERNAME}/.kde/share/config && cat > /home/${LIVE_USERNAME}/.kde/share/config/kdesurc" << EOF
-[super-user-command]
-super-user-command=sudo
-EOF
-
-	if [ -e /usr/share/apps/konsole/sumc.desktop ]
-	then
-		sudo -u "${LIVE_USERNAME}" sh -c "umask 0077 && mkdir -p /home/${LIVE_USERNAME}/.kde/share/apps/konsole && sed -e's/Exec=su.*$/Exec=sudo mc -c/' /usr/share/apps/konsole/sumc.desktop > /home/${LIVE_USERNAME}/.kde/share/apps/konsole/sumc.desktop"
-	fi
-
-	if [ -e /usr/share/apps/konsole/su.desktop ]
-	then
-		sudo -u "${LIVE_USERNAME}" sh -c "umask 0077 && mkdir -p /home/${LIVE_USERNAME}/.kde/share/apps/konsole && sed -e's/Exec=su.*$/Exec=sudo -i/' /usr/share/apps/konsole/su.desktop > /home/${LIVE_USERNAME}/.kde/share/apps/konsole/su.desktop"
-	fi
-
-	# Creating state file
-	touch /var/lib/live/config/sudo
-}
-
-Sudo
diff --git a/config/chroot_local-includes/lib/live/config/0030-sudo-trinity b/config/chroot_local-includes/lib/live/config/0030-sudo-trinity
new file mode 100755
index 0000000..bfb39e5
--- /dev/null
+++ b/config/chroot_local-includes/lib/live/config/0030-sudo-trinity
@@ -0,0 +1,65 @@
+#!/bin/sh
+
+## live-config(7) - System Configuration Scripts
+## Copyright (C) 2006-2011 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.
+
+
+Sudo ()
+{
+	# Checking if package is installed or already configured
+	if [ ! -e /var/lib/dpkg/info/sudo-trinity.list ] || \
+	   [ -e /var/lib/live/config/sudo ]
+	then
+		return
+	fi
+
+	echo -n " sudo"
+
+	Configure_sudo
+}
+
+Configure_sudo ()
+{
+	# Checking if if package is already configured differently
+	if grep -q "^${LIVE_USERNAME}" /etc/sudoers
+	then
+		return
+	fi
+
+	echo "${LIVE_USERNAME}  ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
+
+	sudo -u "${LIVE_USERNAME}" sh -c "echo 'SU_TO_ROOT_SU=sudo' >> /home/${LIVE_USERNAME}/.su-to-rootrc"
+
+	if [ -x /usr/bin/gconftool-2 ]
+	then
+		sudo -u "${LIVE_USERNAME}" gconftool-2 -s -t bool /apps/gksu/sudo-mode true
+		sudo -u "${LIVE_USERNAME}" gconftool-2 -s -t bool /apps/gksu/display-no-pass-info false
+	fi
+
+	# trinity /etc/skel kdesu override hack
+	rm -f /home/${LIVE_USERNAME}/.trinity/share/config/kdesurc
+
+	sudo -u "${LIVE_USERNAME}" sh -c "umask 0077 && mkdir -p /home/${LIVE_USERNAME}/.kde/share/config && cat > /home/${LIVE_USERNAME}/.kde/share/config/kdesurc" << EOF
+[super-user-command]
+super-user-command=sudo
+EOF
+
+	if [ -e /usr/share/apps/konsole/sumc.desktop ]
+	then
+		sudo -u "${LIVE_USERNAME}" sh -c "umask 0077 && mkdir -p /home/${LIVE_USERNAME}/.kde/share/apps/konsole && sed -e's/Exec=su.*$/Exec=sudo mc -c/' /usr/share/apps/konsole/sumc.desktop > /home/${LIVE_USERNAME}/.kde/share/apps/konsole/sumc.desktop"
+	fi
+
+	if [ -e /usr/share/apps/konsole/su.desktop ]
+	then
+		sudo -u "${LIVE_USERNAME}" sh -c "umask 0077 && mkdir -p /home/${LIVE_USERNAME}/.kde/share/apps/konsole && sed -e's/Exec=su.*$/Exec=sudo -i/' /usr/share/apps/konsole/su.desktop > /home/${LIVE_USERNAME}/.kde/share/apps/konsole/su.desktop"
+	fi
+
+	# Creating state file
+	touch /var/lib/live/config/sudo
+}
+
+Sudo
diff --git a/config/chroot_local-includes/lib/live/config/008-kdm-trinity b/config/chroot_local-includes/lib/live/config/008-kdm-trinity
deleted file mode 100755
index a924fe7..0000000
--- a/config/chroot_local-includes/lib/live/config/008-kdm-trinity
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/sh
-
-## live-config(7) - System Configuration Scripts
-## Copyright (C) 2006-2011 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.
-
-
-Kdm ()
-{
-	# Checking if package is installed or already configured
-	if [ ! -e /var/lib/dpkg/info/kdm-trinity.list ]
-	then
-		return
-	fi
-
-	if [ -e /var/lib/live/config/kdm ]
-	then
-		# Avoid xinit
-		_X11="true"
-		export _X11
-
-		return
-	fi
-
-	echo -n " kdm"
-
-	Configure_kdm
-}
-
-Configure_kdm ()
-{
-	if [ -e /etc/trinity/kdm/kdmrc ]
-	then
-		# trinity
-
-		# autologin
-		sed -i -r -e "s|^#?AutoLoginEnable=.*\$|AutoLoginEnable=true|" \
-			  -e "s|^#?AutoLoginAgain=.*\$|AutoLoginAgain=true|" \
-			  -e "s|^#?AutoLoginUser=.*\$|AutoLoginUser=${LIVE_USERNAME}|" \
-		/etc/trinity/kdm/kdmrc
-
-		# language
-		if [ -n "${_LANGUAGE}" ]
-		then
-			sed -i -r -e "s|^#?Language=.*\$|Language=${_LANGUAGE}|" \
-				/etc/trinity/kdm/kdmrc
-		fi
-	fi
-
-	# Avoid xinit
-	_X11="true"
-	export _X11
-
-	# Creating state file
-	touch /var/lib/live/config/kdm
-}
-
-Kdm
diff --git a/config/chroot_local-includes/lib/live/config/0080-kdm-trinity b/config/chroot_local-includes/lib/live/config/0080-kdm-trinity
new file mode 100755
index 0000000..a924fe7
--- /dev/null
+++ b/config/chroot_local-includes/lib/live/config/0080-kdm-trinity
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+## live-config(7) - System Configuration Scripts
+## Copyright (C) 2006-2011 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.
+
+
+Kdm ()
+{
+	# Checking if package is installed or already configured
+	if [ ! -e /var/lib/dpkg/info/kdm-trinity.list ]
+	then
+		return
+	fi
+
+	if [ -e /var/lib/live/config/kdm ]
+	then
+		# Avoid xinit
+		_X11="true"
+		export _X11
+
+		return
+	fi
+
+	echo -n " kdm"
+
+	Configure_kdm
+}
+
+Configure_kdm ()
+{
+	if [ -e /etc/trinity/kdm/kdmrc ]
+	then
+		# trinity
+
+		# autologin
+		sed -i -r -e "s|^#?AutoLoginEnable=.*\$|AutoLoginEnable=true|" \
+			  -e "s|^#?AutoLoginAgain=.*\$|AutoLoginAgain=true|" \
+			  -e "s|^#?AutoLoginUser=.*\$|AutoLoginUser=${LIVE_USERNAME}|" \
+		/etc/trinity/kdm/kdmrc
+
+		# language
+		if [ -n "${_LANGUAGE}" ]
+		then
+			sed -i -r -e "s|^#?Language=.*\$|Language=${_LANGUAGE}|" \
+				/etc/trinity/kdm/kdmrc
+		fi
+	fi
+
+	# Avoid xinit
+	_X11="true"
+	export _X11
+
+	# Creating state file
+	touch /var/lib/live/config/kdm
+}
+
+Kdm
diff --git a/config/chroot_local-includes/lib/live/config/800-kde-keyboard-layout b/config/chroot_local-includes/lib/live/config/800-kde-keyboard-layout
deleted file mode 100755
index 62e3927..0000000
--- a/config/chroot_local-includes/lib/live/config/800-kde-keyboard-layout
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/bin/sh
-
-KdeKeyboardLayout ()
-{
-	KXKBRC=/home/${LIVE_USERNAME}/.kde/share/config/kxkbrc
-
-	# Checking if package is already configured
-	if [ -e /var/lib/live/config/kdekeyboardlayout ] || \
-           [ ! -e ${KXKBRC} ]
-	then
-		return
-	fi
-
-	echo -n " kdekeyboardlayout"
-
-	for _PARAMETER in ${_CMDLINE}
-	do
-		case "${_PARAMETER}" in
-			live-config.keyboard-layouts=*|keyboard-layouts=*)
-				LIVE_KEYBOARD_LAYOUTS="${_PARAMETER#*keyboard-layouts=}"
-				;;
-
-			live-config.keyboard-model=*|keyboard-model=*)
-				LIVE_KEYBOARD_MODEL="${_PARAMETER#*keyboard-model=}"
-				;;
-
-			live-config.keyboard-options=*|keyboard-options=*)
-				LIVE_KEYBOARD_OPTIONS="${_PARAMETER#*keyboard-options=}"
-				;;
-
-			live-config.keyboard-variants=*|keyboard-variants=*)
-				LIVE_KEYBOARD_VARIANTS="${_PARAMETER#*keyboard-variants=}"
-				;;
-		esac
-	done
-
-	if [ -z "$LIVE_KEYBOARD_LAYOUTS" ]
-	then
-		LIVE_KEYBOARD_LAYOUTS=us
-	fi
-
-	Configure_kdekeyboardlayout
-}
-
-Configure_kdekeyboardlayout ()
-{
-	COL="$(awk -F'=' '{if($1=="DisplayNames"){gsub(",","\n",$2); print $2}}' "$KXKBRC" | grep -nw "$LIVE_KEYBOARD_LAYOUTS" | cut -d: -f1)"
-	if [ "$COL" = 1 ]; then
-		true # nothing to do, already first position
-	elif [ "$COL" ]; then
-		sed -i 's/^\(DisplayNames\|LayoutList\)=\(.*\),\('$LIVE_KEYBOARD_LAYOUTS'[^,]*\)/\1=\3,\2,/; s/^\(DisplayNames\|LayoutList\)=\([^,]*,.*\)'$LIVE_KEYBOARD_LAYOUTS'[^,]*/\1=\2,/; s/,,*/,/g; s/,$//' "$KXKBRC"
-	else
-		sed -i 's/^\(DisplayNames\|LayoutList\)=/\1='$LIVE_KEYBOARD_LAYOUTS',/; s/,$//' "$KXKBRC"
-	fi
-
-	# Creating state file
-	touch /var/lib/live/config/kdekeyboardlayout
-}
-
-KdeKeyboardLayout
diff --git a/config/chroot_local-includes/lib/live/config/8000-kde-keyboard-layout b/config/chroot_local-includes/lib/live/config/8000-kde-keyboard-layout
new file mode 100755
index 0000000..62e3927
--- /dev/null
+++ b/config/chroot_local-includes/lib/live/config/8000-kde-keyboard-layout
@@ -0,0 +1,60 @@
+#!/bin/sh
+
+KdeKeyboardLayout ()
+{
+	KXKBRC=/home/${LIVE_USERNAME}/.kde/share/config/kxkbrc
+
+	# Checking if package is already configured
+	if [ -e /var/lib/live/config/kdekeyboardlayout ] || \
+           [ ! -e ${KXKBRC} ]
+	then
+		return
+	fi
+
+	echo -n " kdekeyboardlayout"
+
+	for _PARAMETER in ${_CMDLINE}
+	do
+		case "${_PARAMETER}" in
+			live-config.keyboard-layouts=*|keyboard-layouts=*)
+				LIVE_KEYBOARD_LAYOUTS="${_PARAMETER#*keyboard-layouts=}"
+				;;
+
+			live-config.keyboard-model=*|keyboard-model=*)
+				LIVE_KEYBOARD_MODEL="${_PARAMETER#*keyboard-model=}"
+				;;
+
+			live-config.keyboard-options=*|keyboard-options=*)
+				LIVE_KEYBOARD_OPTIONS="${_PARAMETER#*keyboard-options=}"
+				;;
+
+			live-config.keyboard-variants=*|keyboard-variants=*)
+				LIVE_KEYBOARD_VARIANTS="${_PARAMETER#*keyboard-variants=}"
+				;;
+		esac
+	done
+
+	if [ -z "$LIVE_KEYBOARD_LAYOUTS" ]
+	then
+		LIVE_KEYBOARD_LAYOUTS=us
+	fi
+
+	Configure_kdekeyboardlayout
+}
+
+Configure_kdekeyboardlayout ()
+{
+	COL="$(awk -F'=' '{if($1=="DisplayNames"){gsub(",","\n",$2); print $2}}' "$KXKBRC" | grep -nw "$LIVE_KEYBOARD_LAYOUTS" | cut -d: -f1)"
+	if [ "$COL" = 1 ]; then
+		true # nothing to do, already first position
+	elif [ "$COL" ]; then
+		sed -i 's/^\(DisplayNames\|LayoutList\)=\(.*\),\('$LIVE_KEYBOARD_LAYOUTS'[^,]*\)/\1=\3,\2,/; s/^\(DisplayNames\|LayoutList\)=\([^,]*,.*\)'$LIVE_KEYBOARD_LAYOUTS'[^,]*/\1=\2,/; s/,,*/,/g; s/,$//' "$KXKBRC"
+	else
+		sed -i 's/^\(DisplayNames\|LayoutList\)=/\1='$LIVE_KEYBOARD_LAYOUTS',/; s/,$//' "$KXKBRC"
+	fi
+
+	# Creating state file
+	touch /var/lib/live/config/kdekeyboardlayout
+}
+
+KdeKeyboardLayout
diff --git a/config/chroot_local-includes/lib/live/config/900-enable-persistent b/config/chroot_local-includes/lib/live/config/900-enable-persistent
deleted file mode 100755
index 618ea11..0000000
--- a/config/chroot_local-includes/lib/live/config/900-enable-persistent
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/sh
-# "enable persistent" desktop-icon
-[ -x /usr/local/bin/enable_persistent_live.bash ] || exit 0
-
-case "$(awk '{if($2=="/live/image"){print $1;}}' /proc/mounts)" in
-/dev/sd*) 
-	case "$( ls /grub.cmdline 2>/dev/null)" in
-	/grub.cmdline)
-		rm -f /home/${LIVE_USERNAME}/Desktop/enable_persistent.desktop
-		;;
-	*)
-		sudo -u "${LIVE_USERNAME}" sh -c "mkdir -p /home/${LIVE_USERNAME}/Desktop; cat > /home/${LIVE_USERNAME}/Desktop/enable_persistent.desktop" <<"EOF"
-[Desktop Entry]
-Comment[de]=Diesen Live-USB-Stick persistent machen, d.h. alle Änderungen werden auf dem Stick gespeichert.
-Comment=Make this Live-USB-Stick persistent, i.e. all changes will be saved to the stick.
-Exec=/usr/local/bin/enable_persistent_live.bash
-Icon=acritoxinstaller
-MimeType=
-Name[de]=»persistent« aktivieren
-Name=enable »persistent«
-StartupNotify=true
-Terminal=false
-TerminalOptions=
-Type=Application
-EOF
-		chmod +x /home/${LIVE_USERNAME}/Desktop/enable_persistent.desktop
-		;;
-	esac
-	;;
-*)
-	rm -f /home/${LIVE_USERNAME}/Desktop/enable_persistent.desktop
-	;;
-esac
-
diff --git a/config/chroot_local-includes/lib/live/config/900-sudo-su-alias b/config/chroot_local-includes/lib/live/config/900-sudo-su-alias
deleted file mode 100755
index 56589a3..0000000
--- a/config/chroot_local-includes/lib/live/config/900-sudo-su-alias
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/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.
-
-
-Sudoalias ()
-{
-	# Checking if package is already configured
-	if [ -e /var/lib/live/config/sudoalias ]
-	then
-		return
-	fi
-
-	echo -n " sudoalias"
-
-	Configure_sudoalias
-}
-
-Configure_sudoalias ()
-{
-	# Checking if if package is already configured differently
-	if grep -q "livecd password hook" /home/${LIVE_USERNAME}/.bashrc
-	then
-		return
-	fi
-	sudo -u "${LIVE_USERNAME}" sh -c "cat >> /home/${LIVE_USERNAME}/.bashrc" << EOF
-
-# livecd password hook
-alias su="sudo su"
-alias sux="sudo sux"
-EOF
-
-	# Creating state file
-	touch /var/lib/live/config/sudoalias
-}
-
-Sudoalias
diff --git a/config/chroot_local-includes/lib/live/config/9000-enable-persistent b/config/chroot_local-includes/lib/live/config/9000-enable-persistent
new file mode 100755
index 0000000..0ef6a82
--- /dev/null
+++ b/config/chroot_local-includes/lib/live/config/9000-enable-persistent
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+# "enable persistent" desktop-icon
+
+Persistent ()
+{
+if [ -e /var/lib/live/config/enable-persistent ]
+then
+	return
+fi
+echo -n " enable-persistent"
+Configure_Persistent
+}
+
+Configure_Persistent ()
+{
+if ! [ -x /usr/local/bin/enable_persistent_live.bash ]
+then
+	touch /var/lib/live/config/enable-persistent 
+	return
+fi
+
+case "$(awk '{if($2=="/live/image"||$2=="/lib/live/mount/medium"){print $1;}}' /proc/mounts)" in
+/dev/sd*) 
+	case "$( ls /grub.cmdline 2>/dev/null)" in
+	/grub.cmdline)
+		rm -f /home/${LIVE_USERNAME}/Desktop/enable_persistent.desktop
+		;;
+	*)
+		sudo -u "${LIVE_USERNAME}" sh -c "mkdir -p /home/${LIVE_USERNAME}/Desktop; cat > /home/${LIVE_USERNAME}/Desktop/enable_persistent.desktop" <<"EOF"
+[Desktop Entry]
+Comment[de]=Diesen Live-USB-Stick persistent machen, d.h. alle Änderungen werden auf dem Stick gespeichert.
+Comment=Make this Live-USB-Stick persistent, i.e. all changes will be saved to the stick.
+Exec=/usr/local/bin/enable_persistent_live.bash
+Icon=acritoxinstaller
+MimeType=
+Name[de]=»persistent« aktivieren
+Name=enable »persistent«
+StartupNotify=true
+Terminal=false
+TerminalOptions=
+Type=Application
+EOF
+		chmod +x /home/${LIVE_USERNAME}/Desktop/enable_persistent.desktop
+		;;
+	esac
+	;;
+*)
+	rm -f /home/${LIVE_USERNAME}/Desktop/enable_persistent.desktop
+	;;
+esac
+
+touch /var/lib/live/config/enable-persistent
+}
+
+Persistent
diff --git a/config/chroot_local-includes/lib/live/config/9000-sudo-su-alias b/config/chroot_local-includes/lib/live/config/9000-sudo-su-alias
new file mode 100755
index 0000000..56589a3
--- /dev/null
+++ b/config/chroot_local-includes/lib/live/config/9000-sudo-su-alias
@@ -0,0 +1,42 @@
+#!/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.
+
+
+Sudoalias ()
+{
+	# Checking if package is already configured
+	if [ -e /var/lib/live/config/sudoalias ]
+	then
+		return
+	fi
+
+	echo -n " sudoalias"
+
+	Configure_sudoalias
+}
+
+Configure_sudoalias ()
+{
+	# Checking if if package is already configured differently
+	if grep -q "livecd password hook" /home/${LIVE_USERNAME}/.bashrc
+	then
+		return
+	fi
+	sudo -u "${LIVE_USERNAME}" sh -c "cat >> /home/${LIVE_USERNAME}/.bashrc" << EOF
+
+# livecd password hook
+alias su="sudo su"
+alias sux="sudo sux"
+EOF
+
+	# Creating state file
+	touch /var/lib/live/config/sudoalias
+}
+
+Sudoalias
diff --git a/config/chroot_local-includes/lib/live/config/901-hotfixes b/config/chroot_local-includes/lib/live/config/901-hotfixes
deleted file mode 100755
index 5cf3b53..0000000
--- a/config/chroot_local-includes/lib/live/config/901-hotfixes
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/sh
-
-Hotfixes ()
-{
-if [ -e /var/lib/live/config/hotfixes ]
-then
-	return
-fi
-echo -n " hotfixes"
-Configure_hotfixes
-}
-
-Configure_hotfixes ()
-{
-# Reading kernel command line
-for _PARAMETER in ${_CMDLINE}; do
- case "${_PARAMETER}" in
-  live-config.timezone=*|timezone=*)
-   LIVE_TIMEZONE="${_PARAMETER#*timezone=}"
-   ;;
-  live-config.username=*|username=*)
-   LIVE_USERNAME="${_PARAMETER#*username=}"
-   ;;
- esac
-done
-
-# fix timezone
-if [ -n "${LIVE_TIMEZONE}" ]; then
-	echo "${LIVE_TIMEZONE}" > /etc/timezone
-fi
-
-# dirty hack to prevent kdm's "abort active sessions" prompt on live system
-sudo -u "${LIVE_USERNAME}" sh -c "mkdir -p /home/${LIVE_USERNAME}/.kde/shutdown; cat > /home/${LIVE_USERNAME}/.kde/shutdown/kdm-force-shutdown-hack" <<"EOF"
-#!/bin/sh
-# dirty hack to prevent kdm's "abort active sessions" prompt on live system
-
-. /etc/default/distro
-[ "$FLL_DISTRO_MODE" = "live" ] || exit # are we live?
-
-# "destroy" utmp, so kdm won't recognize the running logins on the other TTYs
-sudo perl -pi -e 's/tty/xty/g' /var/run/utmp
-
-EOF
-chmod +x /home/${LIVE_USERNAME}/.kde/shutdown/kdm-force-shutdown-hack
-
-# reconfigure console-setup
-rm -f /etc/default/console-setup
-. /etc/default/locale
-dpkg-reconfigure console-setup -fnoninteractive
-
-touch /var/lib/live/config/hotfixes
-}
-
-Hotfixes
diff --git a/config/chroot_local-includes/lib/live/config/9010-hotfixes b/config/chroot_local-includes/lib/live/config/9010-hotfixes
new file mode 100755
index 0000000..5cf3b53
--- /dev/null
+++ b/config/chroot_local-includes/lib/live/config/9010-hotfixes
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+Hotfixes ()
+{
+if [ -e /var/lib/live/config/hotfixes ]
+then
+	return
+fi
+echo -n " hotfixes"
+Configure_hotfixes
+}
+
+Configure_hotfixes ()
+{
+# Reading kernel command line
+for _PARAMETER in ${_CMDLINE}; do
+ case "${_PARAMETER}" in
+  live-config.timezone=*|timezone=*)
+   LIVE_TIMEZONE="${_PARAMETER#*timezone=}"
+   ;;
+  live-config.username=*|username=*)
+   LIVE_USERNAME="${_PARAMETER#*username=}"
+   ;;
+ esac
+done
+
+# fix timezone
+if [ -n "${LIVE_TIMEZONE}" ]; then
+	echo "${LIVE_TIMEZONE}" > /etc/timezone
+fi
+
+# dirty hack to prevent kdm's "abort active sessions" prompt on live system
+sudo -u "${LIVE_USERNAME}" sh -c "mkdir -p /home/${LIVE_USERNAME}/.kde/shutdown; cat > /home/${LIVE_USERNAME}/.kde/shutdown/kdm-force-shutdown-hack" <<"EOF"
+#!/bin/sh
+# dirty hack to prevent kdm's "abort active sessions" prompt on live system
+
+. /etc/default/distro
+[ "$FLL_DISTRO_MODE" = "live" ] || exit # are we live?
+
+# "destroy" utmp, so kdm won't recognize the running logins on the other TTYs
+sudo perl -pi -e 's/tty/xty/g' /var/run/utmp
+
+EOF
+chmod +x /home/${LIVE_USERNAME}/.kde/shutdown/kdm-force-shutdown-hack
+
+# reconfigure console-setup
+rm -f /etc/default/console-setup
+. /etc/default/locale
+dpkg-reconfigure console-setup -fnoninteractive
+
+touch /var/lib/live/config/hotfixes
+}
+
+Hotfixes
-- 
cgit v1.0