[rhel7/master/f21-blivet] Add ability to set a default fstype for the boot partition (#1112697)
by Brian C. Lane
By default the boot partition fstype is the first in the list returned
by the bootloader. This adds setDefaultBootFSType() which can be used to
override this.
Related: rhbz#1112697
---
blivet/__init__.py | 37 ++++++++++++++++++++++++++++++-------
1 file changed, 30 insertions(+), 7 deletions(-)
diff --git a/blivet/__init__.py b/blivet/__init__.py
index ad8e8c5..37693b6 100644
--- a/blivet/__init__.py
+++ b/blivet/__init__.py
@@ -336,6 +336,7 @@ class Blivet(object):
self.__luksDevs = {}
self.size_sets = []
self.setDefaultFSType(get_default_filesystem_type())
+ self._defaultBootFSType = None
self.iscsi = iscsi.iscsi()
self.fcoe = fcoe.fcoe()
@@ -1856,21 +1857,19 @@ class Blivet(object):
@property
def defaultBootFSType(self):
"""The default filesystem type for the boot partition."""
+ if self._defaultBootFSType:
+ return self._defaultBootFSType
+
fstype = None
if self.bootloader:
fstype = self.bootFSTypes[0]
return fstype
- @property
- def defaultFSType(self):
- return self._defaultFSType
-
- def setDefaultFSType(self, newtype):
- """ Set the default fstype for this instance.
+ def _check_valid_fstype(self, newtype):
+ """ Check the fstype to see if it is valid
Raise ValueError on invalid input.
"""
- log.debug("trying to set new default fstype to '%s'", newtype)
fmt = getFormat(newtype)
if fmt.type is None:
raise ValueError("unrecognized value %s for new default fs type" % newtype)
@@ -1882,6 +1881,30 @@ class Blivet(object):
self._defaultFSType = newtype # pylint: disable=attribute-defined-outside-init
+ def setDefaultBootFSType(self, newtype):
+ """ Set the default /boot fstype for this instance.
+
+ Raise ValueError on invalid input.
+ """
+ log.debug("trying to set new default /boot fstype to '%s'", newtype)
+ # This will raise ValueError if it isn't valid
+ self._check_valid_fstype(newtype)
+ self._defaultBootFSType = newtype
+
+ @property
+ def defaultFSType(self):
+ return self._defaultFSType
+
+ def setDefaultFSType(self, newtype):
+ """ Set the default fstype for this instance.
+
+ Raise ValueError on invalid input.
+ """
+ log.debug("trying to set new default fstype to '%s'", newtype)
+ # This will raise ValueError if it isn't valid
+ self._check_valid_fstype(newtype)
+ self._defaultFSType = newtype # pylint: disable=attribute-defined-outside-init
+
@property
def mountpoints(self):
return self.fsset.mountpoints
--
1.9.3
9 years, 6 months
[f21/master] Lightly rearrange the nav_area
by David Shea
This changes the grid allocation for the product string so that it
overhangs the help button and aligns the help button to the right
instead of the left of its grid box.
---
widgets/src/BaseWindow.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/widgets/src/BaseWindow.c b/widgets/src/BaseWindow.c
index 4793ce7..9df46f5 100644
--- a/widgets/src/BaseWindow.c
+++ b/widgets/src/BaseWindow.c
@@ -353,7 +353,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
/* Create the help button. */
win->priv->help_button = gtk_button_new_with_label(HELP_BUTTON_LABEL);
- gtk_widget_set_halign(win->priv->help_button, GTK_ALIGN_START);
+ gtk_widget_set_halign(win->priv->help_button, GTK_ALIGN_END);
gtk_widget_set_vexpand(win->priv->help_button, FALSE);
gtk_widget_set_valign(win->priv->help_button, GTK_ALIGN_END);
gtk_widget_set_margin_bottom(win->priv->help_button, 6);
@@ -369,7 +369,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
/* Add everything to the nav area. */
gtk_grid_attach(GTK_GRID(win->priv->nav_area), win->priv->name_label, 0, 0, 1, 1);
- gtk_grid_attach(GTK_GRID(win->priv->nav_area), win->priv->distro_label, 1, 0, 1, 1);
+ gtk_grid_attach(GTK_GRID(win->priv->nav_area), win->priv->distro_label, 1, 0, 2, 1);
gtk_grid_attach(GTK_GRID(win->priv->nav_area), win->priv->beta_label, 1, 1, 1, 1);
gtk_grid_attach(GTK_GRID(win->priv->nav_area), win->priv->layout_indicator, 1, 2, 1, 1);
gtk_grid_attach(GTK_GRID(win->priv->nav_area), win->priv->help_button, 2, 1, 1, 2);
--
2.1.0
9 years, 6 months
[blivet][rhel7-branch] Pass a list of string items to log_method_return. (#1155984)
by Samantha N. Bueno
Otherwise there is some serious lagging in the UI when you select/de-select
a disk in the anaconda storage spoke.
Resolves: rhbz#1155984
---
blivet/devicetree.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/blivet/devicetree.py b/blivet/devicetree.py
index a5310b7..8173e93 100644
--- a/blivet/devicetree.py
+++ b/blivet/devicetree.py
@@ -2298,7 +2298,7 @@ class DeviceTree(object):
continue
if device.serial == serial:
retval.append(device)
- log_method_return(self, retval)
+ log_method_return(self, [r.name for r in retval])
return retval
def getDeviceByLabel(self, label, incomplete=False, hidden=False):
@@ -2376,7 +2376,7 @@ class DeviceTree(object):
log_method_call(self, device_type=device_type, incomplete=incomplete, hidden=hidden)
devices = self._filterDevices(incomplete=incomplete, hidden=hidden)
result = [d for d in devices if d.type == device_type]
- log_method_return(self, result)
+ log_method_return(self, [r.name for r in result])
return result
def getDevicesByInstance(self, device_class, incomplete=False, hidden=False):
@@ -2391,7 +2391,7 @@ class DeviceTree(object):
log_method_call(self, device_class=device_class, incomplete=incomplete, hidden=hidden)
devices = self._filterDevices(incomplete=incomplete, hidden=hidden)
result = [d for d in devices if isinstance(d, device_class)]
- log_method_return(self, result)
+ log_method_return(self, [r.name for r in result])
return result
def getDeviceByID(self, id_num, incomplete=False, hidden=False):
--
1.9.3
9 years, 6 months
[master] Rework the placement of items on hubs.
by David Shea
We have been using xscale=0.5 on the hub alignment to center and pad
items when the alignment's children do not use the entire width of the
hub. This has a couple of problems. When the alignment does not need a
lot of space, the scrollbar, if shown, is way over to the left instead
of all the way on the right side of the screen. If the alignment does
need a lot of space, there's no padding so the spokes are pushed all the
way against the left sidebar and the right edge of the window.
Redo the alignment of the hub GtkAlignment to match the one on the
spokes: xalign=0.5, xscale=1.0. Add left and right padding to the
alignment to keep things away from the sidebar and the edge of the
window.
---
pyanaconda/ui/gui/hubs/progress.glade | 6 +++++-
pyanaconda/ui/gui/hubs/summary.glade | 6 +++++-
widgets/src/HubWindow.c | 4 ++--
widgets/src/glade-adaptor.c | 17 ++++++++---------
4 files changed, 20 insertions(+), 13 deletions(-)
diff --git a/pyanaconda/ui/gui/hubs/progress.glade b/pyanaconda/ui/gui/hubs/progress.glade
index f459ce0..b072e32 100644
--- a/pyanaconda/ui/gui/hubs/progress.glade
+++ b/pyanaconda/ui/gui/hubs/progress.glade
@@ -23,6 +23,9 @@
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</object>
</child>
</object>
@@ -36,7 +39,8 @@
<object class="GtkAlignment" id="AnacondaHubWindow-alignment1">
<property name="can_focus">False</property>
<property name="yalign">0</property>
- <property name="xscale">0.5</property>
+ <property name="left_padding">12</property>
+ <property name="right_padding">6</property>
<child internal-child="action_area">
<object class="GtkBox" id="progressWindow-actionArea">
<property name="can_focus">False</property>
diff --git a/pyanaconda/ui/gui/hubs/summary.glade b/pyanaconda/ui/gui/hubs/summary.glade
index 8588791..88313c2 100644
--- a/pyanaconda/ui/gui/hubs/summary.glade
+++ b/pyanaconda/ui/gui/hubs/summary.glade
@@ -24,6 +24,9 @@
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</object>
</child>
</object>
@@ -37,7 +40,8 @@
<object class="GtkAlignment" id="AnacondaHubWindow-alignment1">
<property name="can_focus">False</property>
<property name="yalign">0</property>
- <property name="xscale">0.5</property>
+ <property name="left_padding">12</property>
+ <property name="right_padding">6</property>
<child internal-child="action_area">
<object class="GtkBox" id="summaryWindow-actionArea">
<property name="can_focus">False</property>
diff --git a/widgets/src/HubWindow.c b/widgets/src/HubWindow.c
index bfdd228..a093bce 100644
--- a/widgets/src/HubWindow.c
+++ b/widgets/src/HubWindow.c
@@ -133,8 +133,8 @@ static void anaconda_hub_window_init(AnacondaHubWindow *win) {
/* The hub has different alignment requirements than a spoke. */
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- gtk_alignment_set(GTK_ALIGNMENT(anaconda_base_window_get_alignment(ANACONDA_BASE_WINDOW(win))),
- 0.5, 0.0, 0.5, 1.0);
+ gtk_alignment_set_padding(GTK_ALIGNMENT(anaconda_base_window_get_alignment(ANACONDA_BASE_WINDOW(win))),
+ 0, 0, 12, 6);
G_GNUC_END_IGNORE_DEPRECATIONS
}
diff --git a/widgets/src/glade-adaptor.c b/widgets/src/glade-adaptor.c
index 8cc37d2..b5146f1 100644
--- a/widgets/src/glade-adaptor.c
+++ b/widgets/src/glade-adaptor.c
@@ -62,15 +62,14 @@ void anaconda_standalone_window_post_create(GladeWidgetAdaptor *adaptor,
alignment_widget = glade_widget_get_from_gobject(anaconda_base_window_get_alignment(window));
+ glade_widget_property_set(alignment_widget, "xalign", 0.5);
+ glade_widget_property_set(alignment_widget, "yalign", 0.0);
+ glade_widget_property_set(alignment_widget, "xscale", 1.0);
+ glade_widget_property_set(alignment_widget, "yscale", 1.0);
+
+ /* Set padding on hubs */
if (ANACONDA_IS_HUB_WINDOW(object)) {
- glade_widget_property_set(alignment_widget, "xalign", 0.5);
- glade_widget_property_set(alignment_widget, "yalign", 0.0);
- glade_widget_property_set(alignment_widget, "xscale", 0.5);
- glade_widget_property_set(alignment_widget, "yscale", 1.0);
- } else {
- glade_widget_property_set(alignment_widget, "xalign", 0.5);
- glade_widget_property_set(alignment_widget, "yalign", 0.0);
- glade_widget_property_set(alignment_widget, "xscale", 1.0);
- glade_widget_property_set(alignment_widget, "yscale", 1.0);
+ glade_widget_property_set(alignment_widget, "left-padding", 12);
+ glade_widget_property_set(alignment_widget, "right-padding", 6);
}
}
--
2.1.0
9 years, 6 months
[PATCH] Setup mdadm to turn off homehost (#1156614)
by Brian C. Lane
---
share/runtime-postinstall.tmpl | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/share/runtime-postinstall.tmpl b/share/runtime-postinstall.tmpl
index eaa3fd6..b383e87 100644
--- a/share/runtime-postinstall.tmpl
+++ b/share/runtime-postinstall.tmpl
@@ -18,6 +18,10 @@ move ${PYTHONDIR}/site-packages/pyanaconda/sitecustomize.py ${PYTHONDIR}/site-pa
## move_repos()
move etc/yum.repos.d etc/anaconda.repos.d
+## Setup mdadm config to turn off homehost
+remove etc/mdadm.conf
+append etc/mdadm.conf "AUTO -all\nHOMEHOST <any>\n"
+
## Configure systemd to start anaconda
remove etc/systemd/system/default.target
symlink /lib/systemd/system/anaconda.target etc/systemd/system/default.target
--
1.9.3
9 years, 6 months
[master/f21] Wait until all spokes are setup before updating continue button
by Brian C. Lane
There's no need to call this inside the hub's spoke loop, wait until the
end. This shaves about 6 seconds off the delay between the welcome
screen and the status hub in my tests.
---
pyanaconda/ui/gui/hubs/__init__.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/hubs/__init__.py b/pyanaconda/ui/gui/hubs/__init__.py
index 523580e..98b5e3f 100644
--- a/pyanaconda/ui/gui/hubs/__init__.py
+++ b/pyanaconda/ui/gui/hubs/__init__.py
@@ -154,7 +154,7 @@ class Hub(GUIObject, common.Hub):
# Set some default values on the associated selector that
# affect its display on the hub.
- self._updateCompleteness(spoke)
+ self._updateCompleteness(spoke, update_continue=False)
spoke.selector.connect("button-press-event", self._on_spoke_clicked, spoke)
spoke.selector.connect("key-release-event", self._on_spoke_clicked, spoke)
@@ -194,6 +194,7 @@ class Hub(GUIObject, common.Hub):
spokeArea.add(viewport)
setViewportBackground(viewport)
+ self._updateContinue()
def _updateCompleteness(self, spoke, update_continue=True):
spoke.selector.set_sensitive(spoke.sensitive and spoke.ready)
--
1.9.3
9 years, 6 months
[master/f21] Allow adding prepboot to a blank disk in custom (#1155660)
by Brian C. Lane
On systems where the stage1 device can only be a partition (PPC for
example) the self.data.bootloader.bootDrive isn't setup until you add a
prepboot partition. If you start with a totally blank disk and added a
prepboot partition first the accordion wouldn't be populated, resulting
in a traceback.
This changes custom to allow biosboot and prepboot to be added when
self.data.bootloader.bootDrive hasn't been setup yet.
This would also happen on UEFI when adding biosboot or prepboot as the
first partition to a blank disk.
---
pyanaconda/ui/gui/spokes/custom.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 83b2272..60e4b98 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -308,8 +308,10 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
if device.format.type not in format_types:
continue
- disk_names = [d.name for d in device.disks]
- if self.data.bootloader.bootDrive in disk_names:
+ disk_names = (d.name for d in device.disks)
+ # bootDrive may not be setup because it IS one of these.
+ if not self.data.bootloader.bootDrive or \
+ self.data.bootloader.bootDrive in disk_names:
devices.append(device)
return devices
--
1.9.3
9 years, 6 months
[blivet][f21] Avoid alignment-related resize snafus (#1120964)
by David Lehman
We currently align the end sector of partitions when resizing them.
Without these patches, that can cause problems because the alignment
changes the target size without propagating the change to related
actions (eg: resize of filesystem on the partition). This means it is
possible to have the alignment knock the partition's target size down
below the target size for the filesystem, which leads to a corrupt fs.
The approach taken is to require that all resize target sizes account
for alignment. We provide a method to make this easy. Trying to set a
new target size that would yield an unaligned partition will result in
a ValueError. We also change minSize and maxSize to always return a size
that is acceptable in terms of alignment.
David Lehman (6):
Check new target size against min size and max size.
Specify ntfs resize target in bytes. (#1120964)
Align end sector in the appropriate direction for resize. (#1120964)
Allow generating aligned geometry for arbitrary target size.
Split out code to determine max unaligned partition size to a
property.
Require resize target sizes to yield aligned partitions. (#1120964)
blivet/devices/partition.py | 86 ++++++++++++++++++++++++++++++---
blivet/devices/storage.py | 21 +++++++-
blivet/formats/fs.py | 3 +-
tests/devices_test.py | 115 ++++++++++++++++++++++++++++++++++++++++++++
tests/storagetestcase.py | 2 +
5 files changed, 215 insertions(+), 12 deletions(-)
--
1.9.3
9 years, 6 months
[blivet:master+? 0/5] More work on blivet.size (v3)
by Anne Mulhern
The only change between this and (v2) is that the block of code
associated with the comment recognized by the regular expression
"Search for.*partial match" has been toughened up a bit in "Rewrite..." patch.
mulhern (5):
Use b"", not u"", for _EMPTY_PREFIX.
Make _lowerASCII() python 3 compatible and add a method header.
Rewrite _parseSpec() and convertTo()
Add xlate parameter to humanReadable().
Add a number of new tests.
blivet/size.py | 205 +++++++++++++++++++++++++++--------------------------
tests/size_test.py | 98 +++++++++++++++++++++----
2 files changed, 192 insertions(+), 111 deletions(-)
--
1.9.3
9 years, 6 months