FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 03-02-2012, 04:53 PM
"Brian C. Lane"
 
Default only allow GPT boot flag on EFI System partition (#746895)

From: "Brian C. Lane" <bcl@redhat.com>

When parted sets the boot flag on a GPT labeled disk's partition it
sets the EFI System GUID type. This results in BIOS systems' boot
partition having the wrong GUID type, and EFI systems having multiple
EFI System partitions.
---
pyanaconda/storage/__init__.py | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/storage/__init__.py b/pyanaconda/storage/__init__.py
index 5317c1b..edda836 100644
--- a/pyanaconda/storage/__init__.py
+++ b/pyanaconda/storage/__init__.py
@@ -398,9 +398,16 @@ class Storage(object):
p.getFlag(parted.PARTITION_BOOT):
skip = True
break
+
+ # GPT labeled disks should only have bootable set on the
+ # EFI system partition (parted sets the EFI System GUID on
+ # GPT partitions with the boot flag)
+ if dev.disk.format.partedDisk.type == "gpt" and
+ dev.disk.format.type != "efi":
+ skip = True
+
if skip:
- log.info("not setting boot flag on %s as there is"
- "another active partition" % dev.name)
+ log.info("not setting boot flag on %s" % dev.name)
continue
# hfs+ partitions on gpt can't be marked bootable via
# parted
--
1.7.7.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 03-05-2012, 02:28 PM
"Brian C. Lane"
 
Default only allow GPT boot flag on EFI System partition (#746895)

NOTE: This is for master and F17

--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 03-06-2012, 02:24 AM
David Lehman
 
Default only allow GPT boot flag on EFI System partition (#746895)

On Fri, 2012-03-02 at 09:53 -0800, Brian C. Lane wrote:
> From: "Brian C. Lane" <bcl@redhat.com>
>
> When parted sets the boot flag on a GPT labeled disk's partition it
> sets the EFI System GUID type. This results in BIOS systems' boot
> partition having the wrong GUID type, and EFI systems having multiple
> EFI System partitions.

The idea is fine, but I think there are a couple of issues.

> ---
> pyanaconda/storage/__init__.py | 11 +++++++++--
> 1 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/pyanaconda/storage/__init__.py b/pyanaconda/storage/__init__.py
> index 5317c1b..edda836 100644
> --- a/pyanaconda/storage/__init__.py
> +++ b/pyanaconda/storage/__init__.py
> @@ -398,9 +398,16 @@ class Storage(object):
> p.getFlag(parted.PARTITION_BOOT):
> skip = True
> break
> +
> + # GPT labeled disks should only have bootable set on the
> + # EFI system partition (parted sets the EFI System GUID on
> + # GPT partitions with the boot flag)
> + if dev.disk.format.partedDisk.type == "gpt" and

You could just use dev.disk.format.labelType here.

> + dev.disk.format.type != "efi":

dev.disk.format.type is going to be 'disklabel' every time. I think you
want dev.format.type instead.

> + skip = True
> +
> if skip:
> - log.info("not setting boot flag on %s as there is"
> - "another active partition" % dev.name)
> + log.info("not setting boot flag on %s" % dev.name)
> continue
> # hfs+ partitions on gpt can't be marked bootable via
> # parted


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 10:11 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org