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>
This commit is contained in:
parent
312479cf07
commit
ff1aa2358e
|
@ -32,7 +32,7 @@ import shutil
|
||||||
from mic import kickstart, msger
|
from mic import kickstart, msger
|
||||||
from mic.utils import fs_related, runner, misc
|
from mic.utils import fs_related, runner, misc
|
||||||
from mic.utils.partitionedfs import Image
|
from mic.utils.partitionedfs import Image
|
||||||
from mic.utils.errors import CreatorError, MountError
|
from mic.utils.errors import CreatorError, ImageError
|
||||||
from mic.imager.baseimager import BaseImageCreator
|
from mic.imager.baseimager import BaseImageCreator
|
||||||
from mic.utils.oe.misc import *
|
from mic.utils.oe.misc import *
|
||||||
from mic.plugin import pluginmgr
|
from mic.plugin import pluginmgr
|
||||||
|
@ -358,6 +358,6 @@ class DirectImageCreator(BaseImageCreator):
|
||||||
if not self.__image is None:
|
if not self.__image is None:
|
||||||
try:
|
try:
|
||||||
self.__image.cleanup()
|
self.__image.cleanup()
|
||||||
except MountError, err:
|
except ImageError, err:
|
||||||
msger.warning("%s" % err)
|
msger.warning("%s" % err)
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ class BootimgEFIPlugin(SourcePlugin):
|
||||||
if cr._ptable_format == 'msdos':
|
if cr._ptable_format == 'msdos':
|
||||||
rootstr = rootdev
|
rootstr = rootdev
|
||||||
else:
|
else:
|
||||||
raise MountError("Unsupported partition table format found")
|
raise ImageError("Unsupported partition table format found")
|
||||||
|
|
||||||
grubefi_conf += "linux %s root=%s rootwait %s\n" \
|
grubefi_conf += "linux %s root=%s rootwait %s\n" \
|
||||||
% (kernel, rootstr, options)
|
% (kernel, rootstr, options)
|
||||||
|
|
|
@ -62,7 +62,7 @@ class BootimgPcbiosPlugin(SourcePlugin):
|
||||||
rc = runner.show(['dd', 'if=%s' % mbrfile,
|
rc = runner.show(['dd', 'if=%s' % mbrfile,
|
||||||
'of=%s' % full_path, 'conv=notrunc'])
|
'of=%s' % full_path, 'conv=notrunc'])
|
||||||
if rc != 0:
|
if rc != 0:
|
||||||
raise MountError("Unable to set MBR to %s" % full_path)
|
raise ImageError("Unable to set MBR to %s" % full_path)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def do_configure_partition(self, part, cr, cr_workdir, oe_builddir,
|
def do_configure_partition(self, part, cr, cr_workdir, oe_builddir,
|
||||||
|
@ -107,7 +107,7 @@ class BootimgPcbiosPlugin(SourcePlugin):
|
||||||
if cr._ptable_format == 'msdos':
|
if cr._ptable_format == 'msdos':
|
||||||
rootstr = rootdev
|
rootstr = rootdev
|
||||||
else:
|
else:
|
||||||
raise MountError("Unsupported partition table format found")
|
raise ImageError("Unsupported partition table format found")
|
||||||
|
|
||||||
syslinux_conf += "APPEND label=boot root=%s %s\n" % (rootstr, options)
|
syslinux_conf += "APPEND label=boot root=%s %s\n" % (rootstr, options)
|
||||||
|
|
||||||
|
|
|
@ -40,11 +40,8 @@ class Usage(CreatorError):
|
||||||
self.msg = str(self.msg)
|
self.msg = str(self.msg)
|
||||||
return self.keyword + self.msg + ', please use "--help" for more info'
|
return self.keyword + self.msg + ', please use "--help" for more info'
|
||||||
|
|
||||||
class Abort(CreatorError):
|
|
||||||
keyword = ''
|
|
||||||
|
|
||||||
class KsError(CreatorError):
|
class KsError(CreatorError):
|
||||||
keyword = '<kickstart>'
|
keyword = '<kickstart>'
|
||||||
|
|
||||||
class MountError(CreatorError):
|
class ImageError(CreatorError):
|
||||||
keyword = '<mount>'
|
keyword = '<mount>'
|
||||||
|
|
|
@ -22,7 +22,7 @@ import os
|
||||||
|
|
||||||
from mic import msger
|
from mic import msger
|
||||||
from mic.utils import runner
|
from mic.utils import runner
|
||||||
from mic.utils.errors import MountError
|
from mic.utils.errors import ImageError
|
||||||
from mic.utils.fs_related import *
|
from mic.utils.fs_related import *
|
||||||
from mic.utils.oe.misc import *
|
from mic.utils.oe.misc import *
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ class Image:
|
||||||
msger.debug("Assigning %s partitions to disks" % ptable_format)
|
msger.debug("Assigning %s partitions to disks" % ptable_format)
|
||||||
|
|
||||||
if ptable_format not in ('msdos'):
|
if ptable_format not in ('msdos'):
|
||||||
raise MountError("Unknown partition table format '%s', supported " \
|
raise ImageError("Unknown partition table format '%s', supported " \
|
||||||
"formats are: 'msdos'" % ptable_format)
|
"formats are: 'msdos'" % ptable_format)
|
||||||
|
|
||||||
if self._partitions_layed_out:
|
if self._partitions_layed_out:
|
||||||
|
@ -134,14 +134,14 @@ class Image:
|
||||||
p = self.partitions[n]
|
p = self.partitions[n]
|
||||||
|
|
||||||
if not self.disks.has_key(p['disk_name']):
|
if not self.disks.has_key(p['disk_name']):
|
||||||
raise MountError("No disk %s for partition %s" \
|
raise ImageError("No disk %s for partition %s" \
|
||||||
% (p['disk_name'], p['mountpoint']))
|
% (p['disk_name'], p['mountpoint']))
|
||||||
|
|
||||||
if p['part_type']:
|
if p['part_type']:
|
||||||
# The --part-type can also be implemented for MBR partitions,
|
# The --part-type can also be implemented for MBR partitions,
|
||||||
# in which case it would map to the 1-byte "partition type"
|
# in which case it would map to the 1-byte "partition type"
|
||||||
# filed at offset 3 of the partition entry.
|
# filed at offset 3 of the partition entry.
|
||||||
raise MountError("setting custom partition type is not " \
|
raise ImageError("setting custom partition type is not " \
|
||||||
"implemented for msdos partitions")
|
"implemented for msdos partitions")
|
||||||
|
|
||||||
# Get the disk where the partition is located
|
# Get the disk where the partition is located
|
||||||
|
|
Loading…
Reference in New Issue