diff options
Diffstat (limited to 'scripts/lib/mic/imager/baseimager.py')
| -rw-r--r-- | scripts/lib/mic/imager/baseimager.py | 47 |
1 files changed, 9 insertions, 38 deletions
diff --git a/scripts/lib/mic/imager/baseimager.py b/scripts/lib/mic/imager/baseimager.py index 0d591eaf43..7f32dd559e 100644 --- a/scripts/lib/mic/imager/baseimager.py +++ b/scripts/lib/mic/imager/baseimager.py | |||
| @@ -97,41 +97,15 @@ class BaseImageCreator(object): | |||
| 97 | 97 | ||
| 98 | 98 | ||
| 99 | # | 99 | # |
| 100 | # Properties | ||
| 101 | # | ||
| 102 | def __get_instroot(self): | ||
| 103 | if self.__builddir is None: | ||
| 104 | raise CreatorError("_instroot is not valid before calling mount()") | ||
| 105 | return self.__builddir + "/install_root" | ||
| 106 | _instroot = property(__get_instroot) | ||
| 107 | """The location of the install root directory. | ||
| 108 | |||
| 109 | This is the directory into which the system is installed. Subclasses may | ||
| 110 | mount a filesystem image here or copy files to/from here. | ||
| 111 | |||
| 112 | Note, this directory does not exist before ImageCreator.mount() is called. | ||
| 113 | |||
| 114 | Note also, this is a read-only attribute. | ||
| 115 | |||
| 116 | """ | ||
| 117 | |||
| 118 | |||
| 119 | # | ||
| 120 | # Hooks for subclasses | 100 | # Hooks for subclasses |
| 121 | # | 101 | # |
| 122 | def _mount_instroot(self, base_on = None): | 102 | def _create(self): |
| 123 | """Mount or prepare the install root directory. | 103 | """Create partitions for the disk image(s) |
| 124 | 104 | ||
| 125 | This is the hook where subclasses may prepare the install root by e.g. | 105 | This is the hook where subclasses may create the partitions |
| 126 | mounting creating and loopback mounting a filesystem image to | 106 | that will be assembled into disk image(s). |
| 127 | _instroot. | ||
| 128 | 107 | ||
| 129 | There is no default implementation. | 108 | There is no default implementation. |
| 130 | |||
| 131 | base_on -- this is the value passed to mount() and can be interpreted | ||
| 132 | as the subclass wishes; it might e.g. be the location of | ||
| 133 | a previously created ISO containing a system image. | ||
| 134 | |||
| 135 | """ | 109 | """ |
| 136 | pass | 110 | pass |
| 137 | 111 | ||
| @@ -176,19 +150,16 @@ class BaseImageCreator(object): | |||
| 176 | 150 | ||
| 177 | runner.show('umount -l %s' % self.workdir) | 151 | runner.show('umount -l %s' % self.workdir) |
| 178 | 152 | ||
| 179 | def mount(self): | 153 | def create(self): |
| 180 | """Setup the target filesystem in preparation for an install. | 154 | """Create partitions for the disk image(s) |
| 181 | 155 | ||
| 182 | This function sets up the filesystem which the ImageCreator will | 156 | Create the partitions that will be assembled into disk |
| 183 | install into and configure. The ImageCreator class merely creates an | 157 | image(s). |
| 184 | install root directory, bind mounts some system directories (e.g. /dev) | ||
| 185 | and writes out /etc/fstab. Other subclasses may also e.g. create a | ||
| 186 | sparse file, format it and loopback mount it to the install root. | ||
| 187 | """ | 158 | """ |
| 188 | self.__setup_tmpdir() | 159 | self.__setup_tmpdir() |
| 189 | self.__ensure_builddir() | 160 | self.__ensure_builddir() |
| 190 | 161 | ||
| 191 | self._mount_instroot() | 162 | self._create() |
| 192 | 163 | ||
| 193 | def unmount(self): | 164 | def unmount(self): |
| 194 | """Unmounts the target filesystem. | 165 | """Unmounts the target filesystem. |
