summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Zanussi <tom.zanussi@linux.intel.com>2014-08-08 15:11:31 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-08-11 10:53:12 +0100
commitff1aa2358eb31f21c3acdb980633f5bbc77bda77 (patch)
tree45c56fac452e19b46d51d445e886183f97f0e8c0
parent312479cf075fc614afb9588412c03d716c850ab6 (diff)
downloadpoky-ff1aa2358eb31f21c3acdb980633f5bbc77bda77.tar.gz
wic: Rename MountError
wic doesn't mount anything, so can't have a mount error; rename it to something more appropriate. (From OE-Core rev: e1edee656fc9c0a791c0eb62796d1afa483be34e) Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--scripts/lib/mic/imager/direct.py4
-rw-r--r--scripts/lib/mic/plugins/source/bootimg-efi.py2
-rw-r--r--scripts/lib/mic/plugins/source/bootimg-pcbios.py4
-rw-r--r--scripts/lib/mic/utils/errors.py5
-rw-r--r--scripts/lib/mic/utils/partitionedfs.py8
5 files changed, 10 insertions, 13 deletions
diff --git a/scripts/lib/mic/imager/direct.py b/scripts/lib/mic/imager/direct.py
index a4f5691f79..2f2bd4e072 100644
--- a/scripts/lib/mic/imager/direct.py
+++ b/scripts/lib/mic/imager/direct.py
@@ -32,7 +32,7 @@ import shutil
32from mic import kickstart, msger 32from mic import kickstart, msger
33from mic.utils import fs_related, runner, misc 33from mic.utils import fs_related, runner, misc
34from mic.utils.partitionedfs import Image 34from mic.utils.partitionedfs import Image
35from mic.utils.errors import CreatorError, MountError 35from mic.utils.errors import CreatorError, ImageError
36from mic.imager.baseimager import BaseImageCreator 36from mic.imager.baseimager import BaseImageCreator
37from mic.utils.oe.misc import * 37from mic.utils.oe.misc import *
38from mic.plugin import pluginmgr 38from mic.plugin import pluginmgr
@@ -358,6 +358,6 @@ class DirectImageCreator(BaseImageCreator):
358 if not self.__image is None: 358 if not self.__image is None:
359 try: 359 try:
360 self.__image.cleanup() 360 self.__image.cleanup()
361 except MountError, err: 361 except ImageError, err:
362 msger.warning("%s" % err) 362 msger.warning("%s" % err)
363 363
diff --git a/scripts/lib/mic/plugins/source/bootimg-efi.py b/scripts/lib/mic/plugins/source/bootimg-efi.py
index e880358103..5b1a5332c4 100644
--- a/scripts/lib/mic/plugins/source/bootimg-efi.py
+++ b/scripts/lib/mic/plugins/source/bootimg-efi.py
@@ -77,7 +77,7 @@ class BootimgEFIPlugin(SourcePlugin):
77 if cr._ptable_format == 'msdos': 77 if cr._ptable_format == 'msdos':
78 rootstr = rootdev 78 rootstr = rootdev
79 else: 79 else:
80 raise MountError("Unsupported partition table format found") 80 raise ImageError("Unsupported partition table format found")
81 81
82 grubefi_conf += "linux %s root=%s rootwait %s\n" \ 82 grubefi_conf += "linux %s root=%s rootwait %s\n" \
83 % (kernel, rootstr, options) 83 % (kernel, rootstr, options)
diff --git a/scripts/lib/mic/plugins/source/bootimg-pcbios.py b/scripts/lib/mic/plugins/source/bootimg-pcbios.py
index 53ed7c3195..959cf411bf 100644
--- a/scripts/lib/mic/plugins/source/bootimg-pcbios.py
+++ b/scripts/lib/mic/plugins/source/bootimg-pcbios.py
@@ -62,7 +62,7 @@ class BootimgPcbiosPlugin(SourcePlugin):
62 rc = runner.show(['dd', 'if=%s' % mbrfile, 62 rc = runner.show(['dd', 'if=%s' % mbrfile,
63 'of=%s' % full_path, 'conv=notrunc']) 63 'of=%s' % full_path, 'conv=notrunc'])
64 if rc != 0: 64 if rc != 0:
65 raise MountError("Unable to set MBR to %s" % full_path) 65 raise ImageError("Unable to set MBR to %s" % full_path)
66 66
67 @classmethod 67 @classmethod
68 def do_configure_partition(self, part, cr, cr_workdir, oe_builddir, 68 def do_configure_partition(self, part, cr, cr_workdir, oe_builddir,
@@ -107,7 +107,7 @@ class BootimgPcbiosPlugin(SourcePlugin):
107 if cr._ptable_format == 'msdos': 107 if cr._ptable_format == 'msdos':
108 rootstr = rootdev 108 rootstr = rootdev
109 else: 109 else:
110 raise MountError("Unsupported partition table format found") 110 raise ImageError("Unsupported partition table format found")
111 111
112 syslinux_conf += "APPEND label=boot root=%s %s\n" % (rootstr, options) 112 syslinux_conf += "APPEND label=boot root=%s %s\n" % (rootstr, options)
113 113
diff --git a/scripts/lib/mic/utils/errors.py b/scripts/lib/mic/utils/errors.py
index 38fda307cf..86e230ac19 100644
--- a/scripts/lib/mic/utils/errors.py
+++ b/scripts/lib/mic/utils/errors.py
@@ -40,11 +40,8 @@ class Usage(CreatorError):
40 self.msg = str(self.msg) 40 self.msg = str(self.msg)
41 return self.keyword + self.msg + ', please use "--help" for more info' 41 return self.keyword + self.msg + ', please use "--help" for more info'
42 42
43class Abort(CreatorError):
44 keyword = ''
45
46class KsError(CreatorError): 43class KsError(CreatorError):
47 keyword = '<kickstart>' 44 keyword = '<kickstart>'
48 45
49class MountError(CreatorError): 46class ImageError(CreatorError):
50 keyword = '<mount>' 47 keyword = '<mount>'
diff --git a/scripts/lib/mic/utils/partitionedfs.py b/scripts/lib/mic/utils/partitionedfs.py
index f4ce4a9dee..68e4cabbe0 100644
--- a/scripts/lib/mic/utils/partitionedfs.py
+++ b/scripts/lib/mic/utils/partitionedfs.py
@@ -22,7 +22,7 @@ import os
22 22
23from mic import msger 23from mic import msger
24from mic.utils import runner 24from mic.utils import runner
25from mic.utils.errors import MountError 25from mic.utils.errors import ImageError
26from mic.utils.fs_related import * 26from mic.utils.fs_related import *
27from mic.utils.oe.misc import * 27from mic.utils.oe.misc import *
28 28
@@ -121,7 +121,7 @@ class Image:
121 msger.debug("Assigning %s partitions to disks" % ptable_format) 121 msger.debug("Assigning %s partitions to disks" % ptable_format)
122 122
123 if ptable_format not in ('msdos'): 123 if ptable_format not in ('msdos'):
124 raise MountError("Unknown partition table format '%s', supported " \ 124 raise ImageError("Unknown partition table format '%s', supported " \
125 "formats are: 'msdos'" % ptable_format) 125 "formats are: 'msdos'" % ptable_format)
126 126
127 if self._partitions_layed_out: 127 if self._partitions_layed_out:
@@ -134,14 +134,14 @@ class Image:
134 p = self.partitions[n] 134 p = self.partitions[n]
135 135
136 if not self.disks.has_key(p['disk_name']): 136 if not self.disks.has_key(p['disk_name']):
137 raise MountError("No disk %s for partition %s" \ 137 raise ImageError("No disk %s for partition %s" \
138 % (p['disk_name'], p['mountpoint'])) 138 % (p['disk_name'], p['mountpoint']))
139 139
140 if p['part_type']: 140 if p['part_type']:
141 # The --part-type can also be implemented for MBR partitions, 141 # The --part-type can also be implemented for MBR partitions,
142 # in which case it would map to the 1-byte "partition type" 142 # in which case it would map to the 1-byte "partition type"
143 # filed at offset 3 of the partition entry. 143 # filed at offset 3 of the partition entry.
144 raise MountError("setting custom partition type is not " \ 144 raise ImageError("setting custom partition type is not " \
145 "implemented for msdos partitions") 145 "implemented for msdos partitions")
146 146
147 # Get the disk where the partition is located 147 # Get the disk where the partition is located