From: Marc Fiuczynski Date: Thu, 6 Apr 2006 21:15:00 +0000 (+0000) Subject: Cleaning out rcfs/ckrm related operations in a backward compatible manner. X-Git-Tag: myplc-0_4-rc1~24 X-Git-Url: http://git.onelab.eu/?p=bootmanager.git;a=commitdiff_plain;h=644716f1b688e140b5be6ce44342197fa3f69136 Cleaning out rcfs/ckrm related operations in a backward compatible manner. - 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. --- diff --git a/source/steps/ChainBootNode.py b/source/steps/ChainBootNode.py index d9e7226..dc55c83 100644 --- a/source/steps/ChainBootNode.py +++ b/source/steps/ChainBootNode.py @@ -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 ) diff --git a/source/steps/CheckForNewDisks.py b/source/steps/CheckForNewDisks.py index 51ed6a3..11e6a88 100644 --- a/source/steps/CheckForNewDisks.py +++ b/source/steps/CheckForNewDisks.py @@ -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 ) diff --git a/source/steps/InstallInit.py b/source/steps/InstallInit.py index 8182002..eb2c18f 100644 --- a/source/steps/InstallInit.py +++ b/source/steps/InstallInit.py @@ -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 ) diff --git a/source/steps/InstallUninitHardware.py b/source/steps/InstallUninitHardware.py index e513997..884c65d 100644 --- a/source/steps/InstallUninitHardware.py +++ b/source/steps/InstallUninitHardware.py @@ -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 ) diff --git a/source/steps/InstallWriteConfig.py b/source/steps/InstallWriteConfig.py index ca6e0ba..9349f54 100644 --- a/source/steps/InstallWriteConfig.py +++ b/source/steps/InstallWriteConfig.py @@ -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()