Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Ed Bartosh <ed.bartosh@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [wic][PATCH 4/7] wic: Use gptmbr.bin MBR for gpt partitions
Date: Tue,  2 Jun 2015 17:02:02 +0300	[thread overview]
Message-ID: <1433253725-14089-5-git-send-email-ed.bartosh@linux.intel.com> (raw)
In-Reply-To: <1433253725-14089-1-git-send-email-ed.bartosh@linux.intel.com>

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>

diff --git a/scripts/lib/wic/plugins/source/bootimg-pcbios.py b/scripts/lib/wic/plugins/source/bootimg-pcbios.py
index c28b9af..ab62b7a 100644
--- a/scripts/lib/wic/plugins/source/bootimg-pcbios.py
+++ b/scripts/lib/wic/plugins/source/bootimg-pcbios.py
@@ -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)
diff --git a/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py b/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py
index 29c873d..cdd7c84 100644
--- a/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py
+++ b/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py
@@ -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)
 
-- 
2.1.4



  parent reply	other threads:[~2015-06-02 15:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-02 14:01 [wic][PATCH 0/7] wic: Fixed support of GPT partition table Ed Bartosh
2015-06-02 14:01 ` [wic][PATCH 1/7] wic: set legacy_boot flag for gpt partitions Ed Bartosh
2015-06-02 14:02 ` [wic][PATCH 2/7] wic: check if part_type is set only for msdos partition table Ed Bartosh
2015-06-02 14:02 ` [wic][PATCH 3/7] wic: Add gpt to the list of supported partition table formats Ed Bartosh
2015-06-02 14:02 ` Ed Bartosh [this message]
2015-06-02 14:02 ` [wic][PATCH 5/7] wic: Make _ptable_format public Ed Bartosh
2015-06-02 14:02 ` [wic][PATCH 6/7] wic: create directdisk-gpt.wks Ed Bartosh
2015-06-02 14:02 ` [wic][PATCH 7/7] wic: Test creation of directdisk image with GPT table Ed Bartosh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1433253725-14089-5-git-send-email-ed.bartosh@linux.intel.com \
    --to=ed.bartosh@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox