from mic import msger
from mic.utils import misc, fs_related
-from mic.utils.errors import CreatorError
+from mic.utils.errors import CreatorError, MountError
from mic.utils.partitionedfs import PartitionedMount
from livecd import LiveCDImageCreator
import shutil
from mic import kickstart, msger
-from mic.utils.errors import CreatorError
+from mic.utils.errors import CreatorError, MountError
from mic.utils.fs_related import ExtDiskMount, BtrfsDiskMount, SparseLoopbackDisk
from baseimager import BaseImageCreator
cfgmgr.setProperty("ksconf", ksconf)
creatoropts = cfgmgr.create
+ if creatoropts['arch'].startswith('arm'):
+ msger.warning('livecd cannot support arm images, Quit')
+ return
+
# try to find the pkgmgr
pkgmgr = None
plgmgr = pluginmgr.PluginMgr()
creator.print_outimage_info()
outimage = creator.outimage
- except CreatorError, e:
+ except errors.CreatorError, e:
raise errors.CreatorError("failed to create image : %s" % e)
finally:
try:
extloop.mount()
- except MountError, e:
+ except errors.MountError, e:
extloop.cleanup()
shutil.rmtree(extmnt, ignore_errors = True)
shutil.rmtree(os_image_dir, ignore_errors = True)
imgloop = fs_related.DiskMount(fs_related.LoopbackDisk(img, 0), imgmnt)
try:
imgloop.mount()
- except MountError, e:
+ except errors.MountError, e:
imgloop.cleanup()
raise errors.CreatorError("Failed to loopback mount '%s' : %s" %(img, e))
creatoropts = cfgmgr.create
cfgmgr.setProperty("ksconf", args[0])
+ if creatoropts['arch'].startswith('arm'):
+ msger.warning('liveusb cannot support arm images, Quit')
+ return
+
# try to find the pkgmgr
pkgmgr = None
plgmgr = pluginmgr.PluginMgr()
creator.print_outimage_info()
outimage = creator.outimage
- except CreatorError, e:
+ except errors.CreatorError, e:
raise errors.CreatorError("failed to create image : %s" % e)
finally:
creator.cleanup()
try:
extloop.mount()
- except MountError, e:
+ except errors.MountError, e:
extloop.cleanup()
shutil.rmtree(extmnt, ignore_errors = True)
raise errors.CreatorError("Failed to loopback mount '%s' : %s" %(os_image, e))
imgloop.add_partition(imgsize/1024/1024, "/dev/sdb", "/", "vfat", boot=False)
try:
imgloop.mount()
- except MountError, e:
+ except errors.MountError, e:
imgloop.cleanup()
raise errors.CreatorError("Failed to loopback mount '%s' : %s" %(img, e))
creator.configure(creatoropts["repomd"])
creator.unmount()
creator.package(creatoropts["outdir"])
- except CreatorError, e:
+ except errors.CreatorError, e:
raise errors.CreatorError("failed to create image : %s" % e)
finally:
creator.cleanup()
try:
extloop.mount()
- except MountError, e:
+ except errors.MountError, e:
extloop.cleanup()
shutil.rmtree(extmnt, ignore_errors = True)
raise errors.CreatorError("Failed to loopback mount '%s' : %s" %(img, e))
creator.print_outimage_info()
outimage = creator.outimage
- except CreatorError, e:
+ except errors.CreatorError, e:
raise errors.CreatorError("failed to create image : %s" % e)
finally:
try:
imgloop.mount()
- except MountError, e:
+ except errors.MountError, e:
imgloop.cleanup()
raise errors.CreatorError("Failed to loopback mount '%s' : %s" % (img, e))
try:
srcloop.mount()
- except MountError, e:
+ except errors.MountError, e:
srcloop.cleanup()
raise errors.CreatorError("Failed to loopback mount '%s' : %s" %
(srcimg, e))