Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Ubuntu User (http://www.linux-archive.org/ubuntu-user/)
-   -   Do not set boot flag when there is already a partition with the flag (http://www.linux-archive.org/ubuntu-user/286054-do-not-set-boot-flag-when-there-already-partition-flag.html)

Martin Sivak 11-25-2009 12:45 PM

Do not set boot flag when there is already a partition with the flag
 
This looks reasonable to me, but I would still wait for some input from somebody more familiar with storage stuff.

Martin

----- "Hans de Goede" <hdegoede@redhat.com> wrote:

> In F-10 and before we did not set the boot flag for /boot on msdos
> labels,
> this could lead to issues when asked to install grub into a
> partition,
> or with certain BIOS's which won't boot from a disk when there are no
> active partitions on the disk. However our new behavior of always
> setting
> the boot flag for /boot is wrong for msdos labels too, and is causing
> various
> issues, see (amongst others) bug 530894 and:
> http://forums.fedoraforum.org/showthread.php?t=231421
> http://forums.fedoraforum.org/showthread.php?t=2348
> ---
> storage/__init__.py | 13 +++++++++++++
> 1 files changed, 13 insertions(+), 0 deletions(-)
>
> diff --git a/storage/__init__.py b/storage/__init__.py
> index b3da135..ea89633 100644
> --- a/storage/__init__.py
> +++ b/storage/__init__.py
> @@ -291,6 +291,19 @@ class Storage(object):
> else:
> for dev in bootDevs:
> if hasattr(dev, "bootable"):
> + # Dos labels can only have one partition marked
> as active
> + # and unmarking ie the windows partition is not a
> good idea
> + skip = False
> + if dev.disk.format.partedDisk.type == "msdos":
> + for p in
> dev.disk.format.partedDisk.partitions:
> + if p.type == parted.PARTITION_NORMAL and
>
> + p.getFlag(parted.PARTITION_BOOT):
> + skip = True
> + break
> + if skip:
> + log.info("not setting boot flag on %s as
> there is"
> + "another active partition" %
> dev.name)
> + continue
> log.info("setting boot flag on %s" % dev.name)
> dev.bootable = True
> dev.disk.setup()
> --
> 1.6.5.2
>
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list@redhat.com
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list

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


All times are GMT. The time now is 05:39 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.