3 # Copyright (c) 2003 Intel Corporation
6 # Copyright (c) 2004-2006 The Trustees of Princeton University
8 # expected /proc/partitions format
12 from Exceptions import *
20 - unmount everything mounted during install, except the
21 /dev/planetlab/root and /dev/planetlab/vservers. This includes
22 calling swapoff for /dev/planetlab/swap.
24 Except the following variables from the store:
25 TEMP_PATH the path to download and store temp files to
26 SYSIMG_PATH the path where the system image will be mounted
27 (always starts with TEMP_PATH)
28 PARTITIONS dictionary of generic part. types (root/swap)
29 and their associated devices.
31 Sets the following variables:
36 log.write("\n\nStep: Install: Shutting down installer.\n")
38 # make sure we have the variables we need
40 TEMP_PATH= vars["TEMP_PATH"]
42 raise ValueError("TEMP_PATH")
44 SYSIMG_PATH= vars["SYSIMG_PATH"]
46 raise ValueError("SYSIMG_PATH")
48 PARTITIONS= vars["PARTITIONS"]
49 if PARTITIONS == None:
50 raise ValueError("PARTITIONS")
52 except KeyError as var:
53 raise BootManagerException("Missing variable in vars: {}\n".format(var))
54 except ValueError as var:
55 raise BootManagerException("Variable in vars, shouldn't be: {}\n".format(var))
59 # make sure the required partitions exist
60 val= PARTITIONS["root"]
61 val= PARTITIONS["swap"]
62 val= PARTITIONS["vservers"]
63 except KeyError as part:
64 raise BootManagerException("Missing partition in PARTITIONS: {}\n".format(part))
67 # backwards compat, though, we should never hit this case post PL 3.2
68 os.stat("{}/rcfs/taskclass".format(SYSIMG_PATH))
69 utils.sysexec_chroot_noerr(SYSIMG_PATH, "umount /rcfs", log)
73 log.write("Shutting down swap\n")
74 utils.sysexec("swapoff {}".format(PARTITIONS["swap"]), log)