]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: Use gptmbr.bin MBR for gpt partitions
authorEd Bartosh <ed.bartosh@linux.intel.com>
Tue, 2 Jun 2015 14:02:02 +0000 (17:02 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 11 Jun 2015 22:55:37 +0000 (23:55 +0100)
Used proper syslinux MBR gptmbr.bin for GPT partitons.
Added check for unsupported partition formats.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/lib/wic/plugins/source/bootimg-pcbios.py
scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py

index c28b9af036e8154589362afbdbf8d55aec0f851f..ab62b7a9e98e17dac379bf34ec8ba7699478a5c5 100644 (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)
index 29c873dc7b72324da6c31a23a1c3a0b9af9ae25c..cdd7c84c1235eeca03a46024daae525abf62bb4a 100644 (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)