diff options
author | Tom Zanussi <tom.zanussi@linux.intel.com> | 2014-08-08 10:09:12 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-08-11 10:53:11 +0100 |
commit | 4d1f5ee6d1ae1eb7f60d58c4e960dde879ae0e7f (patch) | |
tree | 087941c279fec075d2213303253451fac6ffc385 /scripts/lib/mic/imager/baseimager.py | |
parent | bd0dd4489e15700333185a6afc6ea53a397246fb (diff) | |
download | poky-4d1f5ee6d1ae1eb7f60d58c4e960dde879ae0e7f.tar.gz |
wic: Update/rename/delete mount-related code
The wic code inherited a basic image-creation flow based on mounting
loop devices, but wic doesn't actually mount anything, so rename parts
of the code dealing with mounting to something more appropriate, and
remove related unused code.
(From OE-Core rev: 94e15c18c011b0d7d71276cd4566be2417c2c6be)
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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. |