6 # Copyright (c) 2003 Intel Corporation
9 # Copyright (c) 2004-2006 The Trustees of Princeton University
10 # All rights reserved.
11 # expected /proc/partitions format
15 from Exceptions import *
23 - unmount everything mounted during install, except the
24 /dev/planetlab/root and /dev/planetlab/vservers. This includes
25 calling swapoff for /dev/planetlab/swap.
27 Except the following variables from the store:
28 TEMP_PATH the path to download and store temp files to
29 SYSIMG_PATH the path where the system image will be mounted
30 (always starts with TEMP_PATH)
31 PARTITIONS dictionary of generic part. types (root/swap)
32 and their associated devices.
34 Sets the following variables:
39 log.write( "\n\nStep: Install: Shutting down installer.\n" )
41 # make sure we have the variables we need
43 TEMP_PATH= vars["TEMP_PATH"]
45 raise ValueError, "TEMP_PATH"
47 SYSIMG_PATH= vars["SYSIMG_PATH"]
49 raise ValueError, "SYSIMG_PATH"
51 PARTITIONS= vars["PARTITIONS"]
52 if PARTITIONS == None:
53 raise ValueError, "PARTITIONS"
56 raise BootManagerException, "Missing variable in vars: %s\n" % var
57 except ValueError, var:
58 raise BootManagerException, "Variable in vars, shouldn't be: %s\n" % var
62 # make sure the required partitions exist
63 val= PARTITIONS["root"]
64 val= PARTITIONS["swap"]
65 val= PARTITIONS["vservers"]
66 except KeyError, part:
67 raise BootManagerException, "Missing partition in PARTITIONS: %s\n" % part
70 # backwards compat, though, we should never hit this case post PL 3.2
71 os.stat("%s/rcfs/taskclass"%SYSIMG_PATH)
72 utils.sysexec_chroot_noerr( SYSIMG_PATH, "umount /rcfs", log )
76 log.write( "Shutting down swap\n" )
77 utils.sysexec( "swapoff %s" % PARTITIONS["swap"], log )