Utilize IMAGEPATH as mount point for virtualbox partition.
authorRichard Nelson <unixabg@gmail.com>
Wed, 30 Nov 2011 02:34:09 +0000 (20:34 -0600)
committerRichard Nelson <unixabg@gmail.com>
Wed, 30 Nov 2011 02:34:09 +0000 (20:34 -0600)
scripts/config/900-virtualbox

index 618b2ea..aab08ed 100755 (executable)
@@ -70,16 +70,16 @@ Configure_virtualbox ()
        fsck -C -a ${MOUNTDEV}
 
        # Check for the mount point directory and take correct action.
-       if [ -d '/virtualbox' ]
+       if [ -d '${IMAGEPATH}' ]
        then
-               echo "The /virtualbox directory exists and is where we will compose the operations for the image."
+               echo "The ${IMAGEPATH} directory exists and is where we will compose the operations for the image."
        else
-               echo "Making the /virtualbox directory where we will compose the operations for the image."
-               mkdir -p /virtualbox
+               echo "Making the ${IMAGEPATH} directory where we will compose the operations for the image."
+               mkdir -p ${IMAGEPATH}
        fi
 
        echo "Attempting to mount local scratch device."
-       mount -v ${MOUNTDEV} /virtualbox
+       mount -v ${MOUNTDEV} ${IMAGEPATH}
 
        echo "Setting the session type with /var/cache/gdm/dmrc for gdm3."
        # Check for the mount point directory and take correct action.
@@ -172,18 +172,18 @@ EOF
        then
                echo "Scratching everything in scratch dir on the fly!"
                # On VirtualBox remove a couple of directories.
-               rm -rf /virtualbox/Logs
-               rm -rf /virtualbox/Snapshots
+               rm -rf ${IMAGEPATH}/Logs
+               rm -rf ${IMAGEPATH}/Snapshots
                # Only doing *.* opposed to * since folders with VirtualBox images may be on the same block device.
-               rm -f /virtualbox/*.*
+               rm -f ${IMAGEPATH}/*.*
                # Also now have to remove local-release.
-               rm -f /virtualbox/local-release
+               rm -f ${IMAGEPATH}/local-release
                echo "Scratching completed!"
        fi
 
-       if [ -f /virtualbox/local-release ]
+       if [ -f ${IMAGEPATH}/local-release ]
        then
-               . /virtualbox/local-release
+               . ${IMAGEPATH}/local-release
                echo "Found local-release: ${RELEASE} "
 
                if [ "${RELEASE}" != "${CRELEASE}" ]
@@ -192,35 +192,35 @@ EOF
                        echo "We will take scratch actions."
 
                        # On VirtualBox remove a couple of directories.
-                       rm -rf /virtualbox/Logs
-                       rm -rf /virtualbox/Snapshots
+                       rm -rf ${IMAGEPATH}/Logs
+                       rm -rf ${IMAGEPATH}/Snapshots
                        # Only doing *.* opposed to * since folders with VirtualBox images may be on the same block device.
-                       rm -f /virtualbox/*.*
+                       rm -f ${IMAGEPATH}/*.*
                        # Also now have to remove local-release.
-                       rm -f /virtualbox/local-release
+                       rm -f ${IMAGEPATH}/local-release
                        echo "Scratching completed!"
 
-                       echo RELEASE=\"${CRELEASE}\" > /virtualbox/local-release
-                       echo "Rsyncing in some stuff to /virtualbox."
-                       rsync --exclude ${VDINAME}.vdi -r ${IMAGEPATH}/${VDINAME}/ /virtualbox/
+                       echo RELEASE=\"${CRELEASE}\" > ${IMAGEPATH}/local-release
+                       echo "Rsyncing in some stuff to ${IMAGEPATH}."
+                       rsync --exclude ${VDINAME}.vdi -r ${IMAGEPATH}/${VDINAME}/ ${IMAGEPATH}/
 
                        # Link in the big chunks.
-                       ln -s ${IMAGEPATH}/${VDINAME}/${VDINAME}.vdi /virtualbox
+                       ln -s ${IMAGEPATH}/${VDINAME}/${VDINAME}.vdi ${IMAGEPATH}
                else
                        echo "Version match no scratch action taken!"
                fi
        else
                echo "Looks like an initial release setup for version ${CRELEASE}."
-               echo RELEASE=\"${CRELEASE}\" > /virtualbox/local-release
-               echo "Rsyncing in some stuff to /virtualbox."
-               rsync --exclude ${VDINAME}.vdi -r ${IMAGEPATH}/${VDINAME}/ /virtualbox/
+               echo RELEASE=\"${CRELEASE}\" > ${IMAGEPATH}/local-release
+               echo "Rsyncing in some stuff to ${IMAGEPATH}."
+               rsync --exclude ${VDINAME}.vdi -r ${IMAGEPATH}/${VDINAME}/ ${IMAGEPATH}/
 
                # Link in the big chunks.
-               ln -s ${IMAGEPATH}/${VDINAME}/${VDINAME}.vdi /virtualbox
+               ln -s ${IMAGEPATH}/${VDINAME}/${VDINAME}.vdi ${IMAGEPATH}
        fi
 
-       echo "Setting the permissions on the /virtualbox folder."
-       chown -R ${LIVE_USERNAME}:${LIVE_USERNAME} /virtualbox
+       echo "Setting the permissions on the ${IMAGEPATH} folder."
+       chown -R ${LIVE_USERNAME}:${LIVE_USERNAME} ${IMAGEPATH}
 
        echo "Completed custom options for username = ${LIVE_USERNAME} !"
 }