From c881fe07b61c04f3f30301f6604252d62e9c4f87 Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Wed, 20 Apr 2005 20:29:03 +0000 Subject: [PATCH] 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. git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@611 d1e1f19c-881f-0410-ab34-b69fee027534 --- ChangeLog | 7 ++++++- modules/livecd_stage2_target.py | 4 ++-- targets/support/livecdfs-update.sh | 18 +++++++++++++++++- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index d9c37a43..f25d2c72 100644 --- 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 + 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 targets/livecd-stage1/livecd-stage1-controller.sh, diff --git a/modules/livecd_stage2_target.py b/modules/livecd_stage2_target.py index 34c0e868..5a054395 100644 --- a/modules/livecd_stage2_target.py +++ b/modules/livecd_stage2_target.py @@ -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) diff --git a/targets/support/livecdfs-update.sh b/targets/support/livecdfs-update.sh index 8a18925c..6f237f22 100755 --- a/targets/support/livecdfs-update.sh +++ b/targets/support/livecdfs-update.sh @@ -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 -- 2.26.2