SF.net SVN: morphix: [2432] trunk/scripts-base/etc/init.d/morphix-start

[email protected] Wed, 18 Oct 2006 13:06:45 -0700
Newsgroups gmane.linux.morphix.cvs
Message-ID <[email protected]>
Revision: 2432
          http://svn.sourceforge.net/morphix/?rev=2432&view=rev
Author:   alextreme
Date:     2006-10-18 13:06:39 -0700 (Wed, 18 Oct 2006)

Log Message:
-----------
 * moving usb-homedir down to after the user has been created...

Modified Paths:
--------------
    trunk/scripts-base/etc/init.d/morphix-start

Modified: trunk/scripts-base/etc/init.d/morphix-start
===================================================================
--- trunk/scripts-base/etc/init.d/morphix-start	2006-10-13 21:23:32 UTC (rev 2431)
+++ trunk/scripts-base/etc/init.d/morphix-start	2006-10-18 20:06:39 UTC (rev 2432)
@@ -533,56 +533,6 @@
 
 mount --bind /home /mnt/main/home
 
-# save the persistant configuration
-
-echo "HOMEDIR='$MYHOMEDIR'">> /etc/sysconfig/morphix
-
-if [ -n "$MYHOMEDIR" -a -z "$BINDHOME" ]; then
-    if trymount "$MYHOMEDEVICE" "$MYHOMEMOUNTPOINT"; then
-	[ -f "$MYHOMEMOUNTPOINT/morphix.img" ] && MYHOMEDIR="$MYHOMEMOUNTPOINT/morphix.img"
-	while read device mountpoint fs relax; do
-	    case "$mountpoint" in *$MYHOMEMOUNTPOINT*)
-		    case "$fs" in *[Nn][Tt][Ff][Ss]*)
-		    umount "$MYHOMEMOUNTPOINT"; eerror "ERROR: WON'T MOUNT NTFS FILESYSTEM ON $MYHOMEDEVICE READ/WRITE!"
-		    break
-		    ;;
-			*[Ff][Aa][Tt]*)
-# Note: This currently won't work with encrypted partitions
-			umount "$MYHOMEMOUNTPOINT"; mount -t vfat -o rw,uid=$USERNAME,gid=users,umask=002 "$MYHOMEDEVICE" "$MYHOMEMOUNTPOINT"
-			if [ ! -f "$MYHOMEDIR" ]; then
-			    ewarn "WARNING: FAT32 is not a good filesystem option for /home/$USERNAME (missing socket/symlink support)."
-			    ewarn "WARNING: Better use an ext2 loopback file on this device, and boot with home=$MYHOMEDEVICE/morphix.img."
-			fi
-			;;
-			esac
-			if mount -o remount,rw "$MYHOMEMOUNTPOINT"; then
-			    ebegin "Mounting ${YELLOW}$MYHOMEDIR${NORMAL} as ${YELLOW}/home/$USERNAME${NORMAL}... "
-			    if [ -f "$MYHOMEDIR" ]; then
-# It's a loopback file, mount it over the /home/$USERNAME directory
-				mkdir /home/$USERNAME &>/dev/null
-
-				trymount "$MYHOMEDIR" /home/$USERNAME
-				RC="$?"
-				[ "$RC" = "0" ] && ERROR="$(mount -o remount,rw,sync /home/$USERNAME 2>&1)"
-				RC="$?"
-			    else
-# Do a --bind mount
-				ERROR="$(mount --bind "$MYHOMEDIR" /home/$USERNAME 2>&1)"
-				RC="$?"
-			    fi
-			    mount --bind /home/$USERNAME /mnt/main/home/$USERNAME
-			    [ "$RC" = "0" ] && einfo "/home/$USERNAME mounted OK." || { eerror "FAILED."; einfo "$ERROR"; }
-			fi
-			eend $?
-			break
-			;;
-			esac
-			done <<EOT
-$(cat /proc/mounts)
-EOT
-			fi
-fi
-
 mount --bind /home/root /mnt/main/root
 
 # /home dir's, check permissions...
@@ -795,6 +745,57 @@
 # unlock the users password
 chroot /mnt/main usermod -U $USERNAME
 
+# save the persistant configuration
+
+echo "HOMEDIR='$MYHOMEDIR'">> /etc/sysconfig/morphix
+
+if [ -n "$MYHOMEDIR" -a -z "$BINDHOME" ]; then
+    if trymount "$MYHOMEDEVICE" "$MYHOMEMOUNTPOINT"; then
+	[ -f "$MYHOMEMOUNTPOINT/morphix.img" ] && MYHOMEDIR="$MYHOMEMOUNTPOINT/morphix.img"
+	while read device mountpoint fs relax; do
+	    case "$mountpoint" in *$MYHOMEMOUNTPOINT*)
+		    case "$fs" in *[Nn][Tt][Ff][Ss]*)
+		    umount "$MYHOMEMOUNTPOINT"; eerror "ERROR: WON'T MOUNT NTFS FILESYSTEM ON $MYHOMEDEVICE READ/WRITE!"
+		    break
+		    ;;
+			*[Ff][Aa][Tt]*)
+# Note: This currently won't work with encrypted partitions
+			umount "$MYHOMEMOUNTPOINT"; mount -t vfat -o rw,uid=$USERNAME,gid=users,umask=002 "$MYHOMEDEVICE" "$MYHOMEMOUNTPOINT"
+			if [ ! -f "$MYHOMEDIR" ]; then
+			    ewarn "WARNING: FAT32 is not a good filesystem option for /home/$USERNAME (missing socket/symlink support)."
+			    ewarn "WARNING: Better use an ext2 loopback file on this device, and boot with home=$MYHOMEDEVICE/morphix.img."
+			fi
+			;;
+			esac
+			if mount -o remount,rw "$MYHOMEMOUNTPOINT"; then
+			    ebegin "Mounting ${YELLOW}$MYHOMEDIR${NORMAL} as ${YELLOW}/home/$USERNAME${NORMAL}... "
+			    if [ -f "$MYHOMEDIR" ]; then
+# It's a loopback file, mount it over the /home/$USERNAME directory
+				mkdir /home/$USERNAME &>/dev/null
+
+				trymount "$MYHOMEDIR" /home/$USERNAME
+				RC="$?"
+				[ "$RC" = "0" ] && ERROR="$(mount -o remount,rw,sync /home/$USERNAME 2>&1)"
+				RC="$?"
+			    else
+# Do a --bind mount
+				ERROR="$(mount --bind "$MYHOMEDIR" /home/$USERNAME 2>&1)"
+				RC="$?"
+			    fi
+			    mount --bind /home/$USERNAME /mnt/main/home/$USERNAME
+			    [ "$RC" = "0" ] && einfo "/home/$USERNAME mounted OK." || { eerror "FAILED."; einfo "$ERROR"; }
+			fi
+			eend $?
+			break
+			;;
+			esac
+			done <<EOT
+$(cat /proc/mounts)
+EOT
+			fi
+fi
+
+
 if test -n "$SPLASH"; then
     if [ -e /proc/splash ]; then
 	echo "show 64000">/proc/splash 2>/dev/null


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642