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 > ArchLinux > ArchLinux General Discussion

 
 
LinkBack Thread Tools
 
Old 02-10-2012, 07:13 PM
David Lehman
 
Default Clear partitions' metadata when 'clearpart --initlabel' used. (#783841)

---
pyanaconda/storage/devicetree.py | 5 +----
pyanaconda/storage/partitioning.py | 11 +++++++----
2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/pyanaconda/storage/devicetree.py b/pyanaconda/storage/devicetree.py
index 9400539..a0b7fa6 100644
--- a/pyanaconda/storage/devicetree.py
+++ b/pyanaconda/storage/devicetree.py
@@ -1158,13 +1158,10 @@ class DeviceTree(object):
labelType = self.platform.bestDiskLabelType(device)

try:
- # XXX if initlabel is True we don't ever instantiate a format
- # for the original disklabel, so we will only have a
- # DeviceFormat instance to destroy.
format = getFormat("disklabel",
device=device.path,
labelType=labelType,
- exists=not initlabel)
+ exists=True)
except InvalidDiskLabelError:
# if we have a cb function use it. else we ignore the device.
if initcb is not None and initcb():
diff --git a/pyanaconda/storage/partitioning.py b/pyanaconda/storage/partitioning.py
index b00d5a4..49faa78 100644
--- a/pyanaconda/storage/partitioning.py
+++ b/pyanaconda/storage/partitioning.py
@@ -511,13 +511,16 @@ def clearPartitions(storage, bootloader=None):
# now remove any empty extended partitions
removeEmptyExtendedPartitions(storage)

- # make sure that the the boot device has the correct disklabel type if
- # we're going to completely clear it.
+ # make sure that the the boot device, along with any other disk we are
+ # supposed to reinitialize, has the correct disklabel type if we're going
+ # to completely clear it.
+ boot_drive = getattr(bootloader, "stage1_drive", None)
for disk in storage.partitioned:
- if not bootloader or not bootloader.stage1_drive:
+ if not boot_drive and not storage.config.reinitializeDisks:
break

- if disk != bootloader.stage1_drive:
+ if not storage.config.reinitializeDisks and
+ (boot_drive is not None and disk != boot_drive):
continue

if storage.config.clearPartType != CLEARPART_TYPE_ALL or
--
1.7.8.4

_______________________________________________
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 11:20 AM.

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