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 > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 09-23-2011, 06:37 PM
David Lehman
 
Default Put bios boot partitions on all gpt disk on bios systems. (#738964)

On Fri, 2011-09-23 at 14:21 -0400, Chris Lumens wrote:
> > + if storage.platform.weight(fstype="biosboot") > 0:
> > + # add a request for a bios boot partition on every disk that contains a
> > + # gpt disklabel if we're on a bios platform.
> > + # XXX we can't just use GRUB2._gpt_disk_has_bios_boot because it can't
> > + # see not-yet-allocated partitions
> > + for disk in disks:
> > + if getattr(disk.format, "labelType", None) == "gpt":
>
> Just a stylistic nitpick, I prefer to do this kind of stuff in reverse:
>
> if getattr(disk.format, "labelType", None) != "gpt":
> continue

Done.

>
> That way you don't have to do as much indentation. Save the
> whitespaces, I suppose.
>
> > + free_list = disk.format.partedDisk.getFreeSpaceRegions()
> > + free_list.sort(key=lambda f: f.length, reverse=True)
> > + free = 0
> > + if free_list:
> > + free_space = sectorsToSize(free_list[0].length,
> > + free_list[0].device.sectorSize)
> > + used = sum([p.req_size for p in partitions])
> > + free = free_space - used
> > +
> > + if free <= 0:
> > + log.warning("can't add BIOS Boot partition to full disk %s"
> > + % disk.name)
>
> I mentioned this in person, but for the benefit of everyone not sitting
> in the room right now... it really seems like we should already have
> code like this somewhere. Basically, you're just checking to see if the
> disk is full or not. I can't believe we're not doing that elsewhere in
> storage.

Oddly enough the only place we ever had this is in Joel's old patch that
tried to determine whether a disk has free space to decide whether to
offer a button to create a new partition. It was ill-fated because it
just didn't work for that purpose. For this it can work because the bios
boot partition is not growable.

Dave

>
> - Chris
>
> _______________________________________________
> 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
 

Thread Tools




All times are GMT. The time now is 09:42 AM.

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