Subversion Repositories livecd

Rev

Rev 142 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 142 Rev 145
Line 91... Line 91...
91
# should we auto mount all found devices?
91
# should we auto mount all found devices?
92
AUTOMOUNT=$( cmdline_parameter automount )
92
AUTOMOUNT=$( cmdline_parameter automount )
93
if [ $AUTOMOUNT ]; then
93
if [ $AUTOMOUNT ]; then
94
    MOUNTOPT="auto,users"
94
    MOUNTOPT="auto,users"
95
else
95
else
96
    MOUNTOPT="noauto,users,ro"
96
    MOUNTOPT="noauto,users"
97
fi
97
fi
98
 
98
 
-
 
99
# should we read only mount all found devices?
-
 
100
ROMOUNT=$( cmdline_parameter romount )
-
 
101
[ $ROMOUNT ] && MOUNTOPT="$MOUNTOPT,ro"
-
 
102
 
99
# folder where we find data which was previously stored
103
# folder where we find data which was previously stored
100
# (can be on an usbstick or harddisk partition)
104
# (can be on an usbstick or harddisk partition)
101
SAVEFOLDER=SL_LIVECD
105
SAVEFOLDER=SL_LIVECD
102
 
106
 
103
# local home partition?
107
# local home partition?
Line 479... Line 483...
479
 
483
 
480
### create local user, if "nolocal" is not set 
484
### create local user, if "nolocal" is not set 
481
if [ ! $NOLOCAL ]; then
485
if [ ! $NOLOCAL ]; then
482
 
486
 
483
    user=$LOCALUSER
487
    user=$LOCALUSER
484
    # execute useradd twice, to make it work (don't know why)
488
    # execute useradd/groupadd twice, to make it work (don't know why)
485
    if [ $PSI ] && [ ! $NOADMIN ]; then
489
    if [ $PSI ] && [ ! $NOADMIN ]; then
-
 
490
	groupdel $user 2>/dev/null
-
 
491
	groupadd $user 2>/dev/null
486
	userdel -r $user 2>/dev/null
492
	groupdel $user 2>/dev/null
-
 
493
	groupadd $user
-
 
494
	
-
 
495
	userdel -r $user                  2>/dev/null
487
	useradd -G $LocalAdminGroup $user 2>/dev/null
496
	useradd -G $LocalAdminGroup $user 2>/dev/null
488
	userdel -r $user 2>/dev/null
497
	userdel -r $user                  2>/dev/null
-
 
498
        # add user to fuse group ?
-
 
499
	grep -q "^fuse:" /etc/group
-
 
500
	if [ "$?" = "0" ]; then
-
 
501
	    useradd -g $user -G ${LocalAdminGroup},fuse $user
-
 
502
	else
489
	useradd -G $LocalAdminGroup $user
503
	    useradd -g $user -G ${LocalAdminGroup} $user
-
 
504
	fi
490
    else
505
    else
491
	userdel -r $user 2>/dev/null
506
	userdel -r $user 2>/dev/null
492
	useradd $user 2>/dev/null
507
	useradd $user    2>/dev/null
493
	userdel -r $user 2>/dev/null
508
	userdel -r $user 2>/dev/null
-
 
509
	grep -q "^fuse:" /etc/group
-
 
510
        # add user to fuse group ?
-
 
511
	if [ "$?" = "0" ]; then
-
 
512
	    useradd -G fuse $user
-
 
513
	else
494
	useradd $user
514
	    useradd $user
-
 
515
	fi
495
    fi
516
    fi
496
 
517
 
497
    # only for PSI: change users's group to GID=UID+50000
-
 
498
    if [ $PSI ]; then
-
 
499
	uid=$( id -u $user )
-
 
500
	old_gid=$( id -g $user )
-
 
501
	new_gid=$(( $old_gid + 50000 ))
-
 
502
        # fix /etc/group
-
 
503
	sed -i "s/${user}:x:${old_gid}:/${user}:x:${new_gid}:/" /etc/group
-
 
504
        # fix /etc/passwd
-
 
505
	sed -i "s/${user}:x:${uid}:${old_gid}:/${user}:x:${uid}:${new_gid}:/" /etc/passwd
-
 
506
        # fix perm of /home/${user)
-
 
507
	chgrp -R $user /home/${user}
-
 
508
    fi
-
 
509
fi
518
fi
510
 
519
 
511
### copy special files for PSI user l_psi
520
### copy special files for PSI user l_psi
512
if [ $PSI ] && [ ! $NOLOCAL ]; then
521
if [ $PSI ] && [ ! $NOLOCAL ]; then
513
    find /usr/share/${LOCALUSER}/ -maxdepth 1 -mindepth 1 2>/dev/null | \
522
    find /usr/share/${LOCALUSER}/ -maxdepth 1 -mindepth 1 2>/dev/null | \