Skip to content

Commit

Permalink
Force the correct FS label on macefi custom (#1141981)
Browse files Browse the repository at this point in the history
On Mac we want the FS label to be 'Linux HFS+ ESP' so we can detect
previous installations. In custom the user may not know this, so force
the FS label to be the correct one when it is selected.
  • Loading branch information
bcl committed Mar 11, 2015
1 parent 72c36f0 commit e805fd8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pyanaconda/ui/gui/spokes/custom.py
Expand Up @@ -977,6 +977,11 @@ def _save_right_side(self, selector):
new_device_info["encrypted"] = encrypted

# FS LABEL
# The Linux HFS+ ESP partition needs to have the correct FS label.
# Override anything the user sets for it.
if fs_type == "macefi":
self._labelEntry.set_text(new_fs.label)

label = self._labelEntry.get_text()
old_label = getattr(device.format, "label", "")
changed_label = (label != old_label)
Expand Down

3 comments on commit e805fd8

@mulkieran
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this change this shouldn be happening in _populate_right_size instead of _save_right_side.

@bcl
Copy link
Owner Author

@bcl bcl commented on e805fd8 Mar 12, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I only want to make the change after the user has selected the filesystem. If it happens in populate it won't be forced to the right label when update it hit. populate picks up the change when it is made, so everything looks right.

@mulkieran
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about?

diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 625cf0a..c76f40f 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -2405,6 +2405,8 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
             return
         log.debug("fs type changed: %s", new_type)
         fmt = getFormat(new_type)
+        if fmt.label:
+            self._labelEntry.set_text(fmt.label)
         fancy_set_sensitive(self._mountPointEntry, fmt.mountable)

     def _populate_container(self, device=None):

Please sign in to comment.