summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/plugins/source/bootimg-pcbios.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/wic/plugins/source/bootimg-pcbios.py')
-rw-r--r--scripts/lib/wic/plugins/source/bootimg-pcbios.py20
1 files changed, 8 insertions, 12 deletions
diff --git a/scripts/lib/wic/plugins/source/bootimg-pcbios.py b/scripts/lib/wic/plugins/source/bootimg-pcbios.py
index 8f53fa2a48..2ded2dac52 100644
--- a/scripts/lib/wic/plugins/source/bootimg-pcbios.py
+++ b/scripts/lib/wic/plugins/source/bootimg-pcbios.py
@@ -26,10 +26,9 @@
26 26
27import logging 27import logging
28import os 28import os
29import sys
30 29
31from wic.engine import get_custom_config 30from wic.engine import get_custom_config
32from wic.errors import ImageError 31from wic.errors import ImageError, WicError
33from wic.utils import runner 32from wic.utils import runner
34from wic.pluginbase import SourcePlugin 33from wic.pluginbase import SourcePlugin
35from wic.utils.misc import (exec_cmd, exec_native_cmd, 34from wic.utils.misc import (exec_cmd, exec_native_cmd,
@@ -57,14 +56,13 @@ class BootimgPcbiosPlugin(SourcePlugin):
57 elif creator.ptable_format == 'gpt': 56 elif creator.ptable_format == 'gpt':
58 mbrfile += "gptmbr.bin" 57 mbrfile += "gptmbr.bin"
59 else: 58 else:
60 logger.error("Unsupported partition table: %s", creator.ptable_format) 59 raise WicError("Unsupported partition table: %s" %
61 sys.exit(1) 60 creator.ptable_format)
62 61
63 if not os.path.exists(mbrfile): 62 if not os.path.exists(mbrfile):
64 logger.error("Couldn't find %s. If using the -e option, do you " 63 raise WicError("Couldn't find %s. If using the -e option, do you "
65 "have the right MACHINE set in local.conf? If not, " 64 "have the right MACHINE set in local.conf? If not, "
66 "is the bootimg_dir path correct?", mbrfile) 65 "is the bootimg_dir path correct?" % mbrfile)
67 sys.exit(1)
68 66
69 full_path = creator._full_path(workdir, disk_name, "direct") 67 full_path = creator._full_path(workdir, disk_name, "direct")
70 logger.debug("Installing MBR on disk %s as %s with size %s bytes", 68 logger.debug("Installing MBR on disk %s as %s with size %s bytes",
@@ -152,11 +150,9 @@ class BootimgPcbiosPlugin(SourcePlugin):
152 if not _has_syslinux(bootimg_dir): 150 if not _has_syslinux(bootimg_dir):
153 bootimg_dir = get_bitbake_var("STAGING_DATADIR", "wic-tools") 151 bootimg_dir = get_bitbake_var("STAGING_DATADIR", "wic-tools")
154 if not bootimg_dir: 152 if not bootimg_dir:
155 logger.error("Couldn't find STAGING_DATADIR, exiting\n") 153 raise WicError("Couldn't find STAGING_DATADIR, exiting")
156 sys.exit(1)
157 if not _has_syslinux(bootimg_dir): 154 if not _has_syslinux(bootimg_dir):
158 logger.error("Please build syslinux first\n") 155 raise WicError("Please build syslinux first")
159 sys.exit(1)
160 # just so the result notes display it 156 # just so the result notes display it
161 creator.bootimg_dir = bootimg_dir 157 creator.bootimg_dir = bootimg_dir
162 158