Cleaning out rcfs/ckrm related operations in a backward compatible manner.
authorMarc Fiuczynski <mef@cs.princeton.edu>
Thu, 6 Apr 2006 21:15:00 +0000 (21:15 +0000)
committerMarc Fiuczynski <mef@cs.princeton.edu>
Thu, 6 Apr 2006 21:15:00 +0000 (21:15 +0000)
- on install do not write out /etc/fstab with /rfcs
- avoid trying to mount or umount /rcfs when it is not there

Doing this in a backwards compatibile manner so that we can still bring up
a PL system with a CKRM enabled kernel in the future (i.e., just for kicks),
although I suppose that will be unlikely.

source/steps/ChainBootNode.py
source/steps/CheckForNewDisks.py
source/steps/InstallInit.py
source/steps/InstallUninitHardware.py
source/steps/InstallWriteConfig.py

index d9e7226..dc55c83 100644 (file)
@@ -1,5 +1,6 @@
 import string
 import re
+import os
 
 import InstallWriteConfig
 import UpdateBootStateWithPLC
@@ -125,7 +126,12 @@ def Run( vars, log ):
     utils.sysexec( "cp %s/boot/initrd-boot /tmp/initrd" % SYSIMG_PATH, log )
 
     log.write( "Unmounting disks.\n" )
-    utils.sysexec_noerr( "chroot %s umount /rcfs" % SYSIMG_PATH, log )
+    try:
+        # backwards compat, though, we should never hit this case post PL 3.2
+        os.stat("%s/rcfs/taskclass"%SYSIMG_PATH)
+        utils.sysexec_noerr( "chroot %s umount /rcfs" % SYSIMG_PATH, log )
+    except OSError, e:
+        pass
     utils.sysexec_noerr( "umount -r /dev/planetlab/vservers", log )
     utils.sysexec_noerr( "umount -r /dev/planetlab/root", log )
     utils.sysexec_noerr( "vgchange -an", log )
index 51ed6a3..11e6a88 100644 (file)
@@ -5,6 +5,7 @@ from Exceptions import *
 from systeminfo import systeminfo
 import compatibility
 import utils
+import os
 
 
 def Run( vars, log ):
@@ -123,7 +124,13 @@ def Run( vars, log ):
         log.write( "Extending planetlab volume group.\n" )
         
         log.write( "Unmounting disks.\n" )
-        utils.sysexec_noerr( "chroot %s umount /rcfs" % SYSIMG_PATH, log )
+        try:
+            # backwards compat, though, we should never hit this case post PL 3.2
+            os.stat("%s/rcfs/taskclass"%SYSIMG_PATH)
+            utils.sysexec_noerr( "chroot %s umount /rcfs" % SYSIMG_PATH, log )
+        except OSError, e:
+            pass
+
         utils.sysexec_noerr( "umount /dev/planetlab/vservers", log )
         utils.sysexec_noerr( "umount /dev/planetlab/root", log )
         utils.sysexec( "vgchange -an", log )
index 8182002..eb2c18f 100644 (file)
@@ -91,7 +91,14 @@ def Run( vars, log ):
     # so who knows what the current state is
 
     log.write( "Unmounting any previous mounts\n" )
-    utils.sysexec_noerr( "chroot %s umount /rcfs" % SYSIMG_PATH, log )
+
+    try:
+        # backwards compat, though, we should never hit this case post PL 3.2
+        os.stat("%s/rcfs/taskclass"%SYSIMG_PATH)
+        utils.sysexec_noerr( "chroot %s umount /rcfs" % SYSIMG_PATH, log )
+    except OSError, e:
+        pass
+
     utils.sysexec_noerr( "umount %s/proc" % SYSIMG_PATH, log )
     utils.sysexec_noerr( "umount %s/mnt/cdrom" % SYSIMG_PATH, log )
     utils.sysexec_noerr( "umount %s/vservers" % SYSIMG_PATH, log )
index e513997..884c65d 100644 (file)
@@ -96,15 +96,16 @@ def Run( vars, log ):
     except KeyError, part:
         raise BootManagerException, "Missing partition in PARTITIONS: %s\n" % part
 
-    # workaround
-    utils.sysexec_noerr( "chroot %s umount /rcfs" % SYSIMG_PATH, log )
+    try:
+        # backwards compat, though, we should never hit this case post PL 3.2
+        os.stat("%s/rcfs/taskclass"%SYSIMG_PATH)
+        utils.sysexec_noerr( "chroot %s umount /rcfs" % SYSIMG_PATH, log )
+    except OSError, e:
+        pass
             
     log.write( "Unmounting proc.\n" )
     utils.sysexec( "umount %s/proc" % SYSIMG_PATH, log )
 
-    log.write( "Unmounting rcfs file system in image.\n" )
-    utils.sysexec_noerr( "chroot %s umount /rcfs" % SYSIMG_PATH, log )
-
     log.write( "Shutting down swap\n" )
     utils.sysexec( "swapoff %s" % PARTITIONS["swap"], log )
 
index ca6e0ba..9349f54 100644 (file)
@@ -175,7 +175,8 @@ def Run( vars, log ):
     fstab.write( "none         /proc       proc      defaults  0 0\n" )
     fstab.write( "none         /dev/shm    tmpfs     defaults  0 0\n" )
     fstab.write( "none         /dev/pts    devpts    defaults  0 0\n" )
-    fstab.write( "none         /rcfs       rcfs      defaults  0 0\n" )
+    # no longer needed
+    # fstab.write( "none         /rcfs       rcfs      defaults  0 0\n" )
     fstab.close()