wic: Use gptmbr.bin MBR for gpt partitions

Used proper syslinux MBR gptmbr.bin for GPT partitons.
Added check for unsupported partition formats.

(From OE-Core rev: 6174983e20bd24422e5cee57e78dce9c92cb3c15)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ed Bartosh 2015-06-02 17:02:02 +03:00 committed by Richard Purdie
parent 76f503535f
commit 179fb20603
2 changed files with 13 additions and 1 deletions

View File

@ -46,6 +46,10 @@ class BootimgPcbiosPlugin(SourcePlugin):
mbrfile = "%s/syslinux/" % bootimg_dir
if cr._ptable_format == 'msdos':
mbrfile += "mbr.bin"
elif cr._ptable_format == 'gpt':
mbrfile += "gptmbr.bin"
else:
msger.error("Unsupported partition table: %s" % cr._ptable_format)
if not os.path.exists(mbrfile):
msger.error("Couldn't find %s. If using the -e option, do you have the right MACHINE set in local.conf? If not, is the bootimg_dir path correct?" % mbrfile)

View File

@ -169,7 +169,15 @@ class RootfsPlugin(SourcePlugin):
Called after all partitions have been prepared and assembled into a
disk image. In this case, we install the MBR.
"""
mbrfile = os.path.join(native_sysroot, "usr/share/syslinux/mbr.bin")
mbrfile = os.path.join(native_sysroot, "usr/share/syslinux/")
if image_creator._ptable_format == 'msdos':
mbrfile += "mbr.bin"
elif image_creator._ptable_format == 'gpt':
mbrfile += "gptmbr.bin"
else:
msger.error("Unsupported partition table: %s" % \
image_creator._ptable_format)
if not os.path.exists(mbrfile):
msger.error("Couldn't find %s. Has syslinux-native been baked?" % mbrfile)