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

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

On 11/26/2009 11:58 AM, Hans de Goede wrote:
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):

          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 ]:


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