[Debian-live-changes] r2235 - dists/trunk/live-helper/helpers

mammadori-guest at alioth.debian.org mammadori-guest at alioth.debian.org
Fri Jun 22 20:17:33 UTC 2007


Author: mammadori-guest
Date: 2007-06-22 20:17:33 +0000 (Fri, 22 Jun 2007)
New Revision: 2235

Modified:
   dists/trunk/live-helper/helpers/lh_chroot_hacks
Log:
Initial support for a custom root password

Modified: dists/trunk/live-helper/helpers/lh_chroot_hacks
===================================================================
--- dists/trunk/live-helper/helpers/lh_chroot_hacks	2007-06-22 19:58:33 UTC (rev 2234)
+++ dists/trunk/live-helper/helpers/lh_chroot_hacks	2007-06-22 20:17:33 UTC (rev 2235)
@@ -80,6 +80,16 @@
 		;;
 esac
 
+# Use a custom root password instead of none
+if [ -n "${LH_ROOT_PASSWORD_HASH}" ]
+then
+	LH_ROOT_PASSWORD_FILE="/chroot/usr/share/initramfs-tools/scripts/${INITFS}-bottom/10adduser
+	if [ -f "${LH_ROOT_PASSWORD_FILE}" ]
+	then
+		sed -i -e 's#\(set passwd/root-password-crypted \).*#\1'"${LH_ROOT_PASSWORD_HASH}#g" "${LH_ROOT_PASSWORD_FILE}"
+	fi
+fi
+
 # Update initramfs
 Chroot "update-initramfs -k all -t -u"
 
@@ -88,5 +98,6 @@
 	${LH_ROOT_COMMAND} chown -R --quiet `whoami`:`whoami` chroot
 fi
 
+
 # Creating stage file
 Create_stagefile .stage/chroot_hacks




More information about the Debian-live-changes mailing list