Added livecd/users option to create non-root users. The first user listed will also...
authorChris Gianelloni <wolf31o2@gentoo.org>
Wed, 20 Apr 2005 20:29:03 +0000 (20:29 +0000)
committerChris Gianelloni <wolf31o2@gentoo.org>
Wed, 20 Apr 2005 20:29:03 +0000 (20:29 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@611 d1e1f19c-881f-0410-ab34-b69fee027534

ChangeLog
modules/livecd_stage2_target.py
targets/support/livecdfs-update.sh

index d9c37a43ac995f5063f56c293ca587edfb4a23a6..f25d2c72947e359612635170a8cc378fd6bc1edc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,11 @@
 # ChangeLog for gentoo/src/catalyst 
 # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.225 2005/04/20 19:48:29 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.226 2005/04/20 20:29:03 wolf31o2 Exp $
+
+  20 Apr 2005; Chris Gianelloni <wolf31o2@gentoo.org>
+  modules/livecd_stage2_target.py, targets/support/livecdfs-update.sh:
+  Added livecd/users option to create non-root users. The first user listed
+  will also be used for auto-starting X, if X is merged onto the CD.
 
   20 Apr 2005; Chris Gianelloni <wolf31o2@gentoo.org>
   targets/livecd-stage1/livecd-stage1-controller.sh,
index 34c0e8682ba62d56c1d15412a521217b4e601617..5a054395888ec07190f87e5971fa716d533a343e 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/modules/livecd_stage2_target.py,v 1.34 2005/04/14 14:59:48 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/livecd_stage2_target.py,v 1.35 2005/04/20 20:29:03 wolf31o2 Exp $
 
 """
 Builder class for a LiveCD stage2 build.
@@ -22,7 +22,7 @@ class livecd_stage2_target(generic_stage_target):
                        "livecd/motd","livecd/overlay","livecd/modblacklist","livecd/splash_theme",\
                        "livecd/rcadd","livecd/rcdel","livecd/fsscript","livecd/xinitrc",\
                        "livecd/root_overlay","livecd/devmanager","livecd/splash_type",\
-                       "gamecd/conf","portage_overlay"])
+                       "gamecd/conf","livecd/users","portage_overlay"])
                
                generic_stage_target.__init__(self,spec,addlargs)
                
index 8a18925c8cbff9244d1960f86373fa39cbeb9a8c..6f237f228151bf1e415f33bd91ec9886043b2b4b 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/support/livecdfs-update.sh,v 1.8 2005/04/20 19:48:29 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/support/livecdfs-update.sh,v 1.9 2005/04/20 20:29:03 wolf31o2 Exp $
 
 /usr/sbin/env-update
 source /etc/profile
@@ -54,9 +54,25 @@ case ${clst_livecd_type} in
                ;;
 esac
 
+# Add any users
+if [ -n "${clst_livecd_users}" ]
+then
+       for x in ${clst_livecd_users}
+       do
+               useradd -G users,wheel,audio,games,cdrom,usb -c "Default LiveCD User" -m $x
+       done
+fi
+
 # setup sudoers
 sed -i '/NOPASSWD: ALL/ s/^# //' /etc/sudoers
 
+# we want the first user to be used when auto-starting X
+if [ -n "${clst_livecd_users}" -a -e /etc/startx ]
+then
+       first_user=$(echo ${clst_livecd_users} | cut -d' ' -f1)
+       sed -i "s/startx/su - $first_user -c startx/" /root/.bashrc
+fi
+
 # setup dhcp on all detected ethernet devices
 echo "iface_eth0=\"dhcp\""> /etc/conf.d/net
 echo "iface_eth1=\"dhcp\"" >> /etc/conf.d/net