[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH] Clear a partition's BOOT flag when formatting it



The BOOT flag of a partition indicates that it can be used to boot the OS
from. Surely this is no longer true after we've formatted it. Note that
we will set the BOOT flag on /boot later on.
---
 storage/deviceaction.py |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/storage/deviceaction.py b/storage/deviceaction.py
index 9337c8f..dbfaf60 100644
--- a/storage/deviceaction.py
+++ b/storage/deviceaction.py
@@ -26,7 +26,7 @@ from udev import *
 from devices import StorageDevice, PartitionDevice
 from formats import getFormat
 from errors import *
-from parted import partitionFlag, PARTITION_BOOT, PARTITION_LBA
+from parted import partitionFlag, PARTITION_LBA
 
 import gettext
 _ = lambda x: gettext.ldgettext("anaconda", x)
@@ -264,10 +264,9 @@ class ActionCreateFormat(DeviceAction):
         self.device.setup()
 
         if isinstance(self.device, PartitionDevice):
-            # Flags which are truely flags, not types, so we shouldn't reset
-            reallyFlags = [ PARTITION_BOOT, PARTITION_LBA ]
             for flag in partitionFlag.keys():
-                if flag in reallyFlags or flag == self.format.partedFlag:
+                # Keep the LBA flag on pre-existing partitions
+                if flag in [ PARTITION_LBA, self.format.partedFlag ]:
                     continue
                 self.device.unsetFlag(flag)
 
-- 
1.6.5.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]