[initial-setup][rhel7-branch][PATCH] Use systemd service status for run detection in S390 console (#1181209)
by Martin Kolman
This greatly simplifies the S390 console scripts and makes
IS activation on the S390 much simpler.
Users now just enable the initial-setup-text service and longer need to
manipulate the /etc/sysconfig/initial-setup configuration file,
which is now ignored.
Resolves: rhbz#1181209
Signed-off-by: Martin Kolman <mkolman(a)redhat.com>
---
scripts/initial-setup.csh | 20 ++++++--------------
scripts/initial-setup.sh | 21 ++++++---------------
2 files changed, 12 insertions(+), 29 deletions(-)
diff --git a/scripts/initial-setup.csh b/scripts/initial-setup.csh
index 6853c85..1d69315 100644
--- a/scripts/initial-setup.csh
+++ b/scripts/initial-setup.csh
@@ -1,22 +1,14 @@
# initial-setup.csh
set IS_EXEC = /usr/bin/initial-setup
-set IS_CONF = /etc/sysconfig/initial-setup
+set IS_UNIT = initial-setup-text.service
-# check if we should run initial-setup
-grep -i "RUN_INITIAL_SETUP=NO" $IS_CONF >/dev/null
-if (( $? != 0 ) && ( -x $IS_EXEC )) then
+set IS_AVAILABLE = 0
+# check if the Initial Setup unit is enabled and the executable is available
+systemctl -q is-enabled $IS_UNIT && ( -x $IS_EXEC ) && set IS_AVAILABLE = 1
+if (( $IS_AVAILABLE == 1 ) then
# check if we're not on 3270 terminal and root
if (( `/sbin/consoletype` == "pty" ) && ( `/usr/bin/id -u` == 0 )) then
- set args = ""
- grep -i "reconfig" /proc/cmdline >/dev/null
- if (( $? == 0 ) || ( -e /etc/reconfigSys )) then
- set args = "--reconfig"
- endif
-
- $IS_EXEC $args
- if ( $? == 0 ) then
- [ $? -eq 0 ] && sed -r -i 's/^RUN_INITIAL_SETUP\s*=\s*[yY][eE][sS]\s*/RUN_INITIAL_SETUP=NO/' $IS_CONF
- endif
+ $IS_EXEC && systemctl -q disable $IS_UNIT
endif
endif
diff --git a/scripts/initial-setup.sh b/scripts/initial-setup.sh
index c980323..35d36d0 100644
--- a/scripts/initial-setup.sh
+++ b/scripts/initial-setup.sh
@@ -1,23 +1,14 @@
# initial-setup.sh
IS_EXEC=/usr/bin/initial-setup
-IS_CONF=/etc/sysconfig/initial-setup
+IS_UNIT=initial-setup-text.service
-# source the config file
-[ -f $IS_CONF ] && . $IS_CONF
-
-# check if we should run initial-setup
-if [ -f $IS_EXEC ] && [ "${RUN_INITIAL_SETUP,,}" = "yes" ]; then
+IS_AVAILABLE=0
+# check if the Initial Setup unit is enabled and the executable is available
+systemctl -q is-enabled $IS_UNIT && [ -f $IS_EXEC ] && IS_AVAILABLE=1
+if [ $IS_AVAILABLE -eq 1 ]; then
# check if we're not on 3270 terminal and root
if [ $(/sbin/consoletype) = "pty" ] && [ $EUID -eq 0 ]; then
- args=""
- if grep -i "reconfig" /proc/cmdline >/dev/null || [ -f /etc/reconfigSys ]; then
- args="--reconfig"
- fi
-
- . /etc/locale.conf
- . /etc/vconsole.conf
- $IS_EXEC $args
- [ $? -eq 0 ] && sed -r -i 's/^RUN_INITIAL_SETUP\s*=\s*[yY][eE][sS]\s*/RUN_INITIAL_SETUP=NO/' $IS_CONF
+ $IS_EXEC && systemctl -q disable $IS_UNIT
fi
fi
--
2.4.3
8 years, 10 months
[RHEL 7.2/PATCH] Disable Label Entry for PPC PReP Boot (#1172773)
by Robert Marshall
The manual partitioning window in the installer allowed users to
type in and attempt to set a label on PPC PReP Boot filesystems.
This would cause the installer to register an error and go back to the
previous settings. Updated the behavior to automatically clear the
label if the PPC PReP Boot filesystem type is chosen and disabled
the label entry field to prevent users from being able to enter
information that is invalid for this filesystem type. This fix will
also do the same for any other filesystem format that does not
support labels.
Resolves: rhbz#1172773
---
pyanaconda/ui/gui/spokes/custom.py | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 77f3414..0644cc6 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -1389,7 +1389,12 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
self._labelEntry.set_text(device.format.label)
else:
self._labelEntry.set_text("")
- fancy_set_sensitive(self._labelEntry, True)
+
+ # Only Allow Labels on Filesystems Supporting It
+ if device.format.labeling():
+ fancy_set_sensitive(self._labelEntry, True)
+ else:
+ fancy_set_sensitive(self._labelEntry, False)
self._device_size_text = device.size.humanReadable(max_places=2)
self._sizeEntry.set_text(self._device_size_text)
@@ -2308,6 +2313,13 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
fmt = getFormat(new_type)
fancy_set_sensitive(self._mountPointEntry, fmt.mountable)
+ # Only Allow Labels on Filesystems Supporting It
+ if fmt.labeling():
+ fancy_set_sensitive(self._labelEntry, True)
+ else:
+ fancy_set_sensitive(self._labelEntry, False)
+ self._labelEntry.set_text("")
+
def _populate_container(self, device=None):
""" Set up the vg widgets for lvm or hide them for other types. """
device_type = self._get_current_device_type()
--
1.8.3.1
8 years, 10 months
[PATCH blivet master] Add support for specifying arbitrary mkfs options.
by Chris Lumens
While we have support for fsprofile, that is only supported by the
various ext* filesystems. We have no way to support passing options for
any of the other filesystems, including the default in RHEL.
Resolves: rhbz#1220898
---
blivet/formats/__init__.py | 23 +++++++++++++++++++----
blivet/formats/fs.py | 1 +
blivet/tasks/fsmkfs.py | 4 +++-
3 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/blivet/formats/__init__.py b/blivet/formats/__init__.py
index b3e58fa..89976e6 100644
--- a/blivet/formats/__init__.py
+++ b/blivet/formats/__init__.py
@@ -187,19 +187,22 @@ class DeviceFormat(ObjectID):
self.uuid = kwargs.get("uuid")
self.exists = kwargs.get("exists", False)
self.options = kwargs.get("options")
+ self._createOptions = kwargs.get("createOptions")
def __repr__(self):
s = ("%(classname)s instance (%(id)s) object id %(object_id)d--\n"
" type = %(type)s name = %(name)s status = %(status)s\n"
" device = %(device)s uuid = %(uuid)s exists = %(exists)s\n"
- " options = %(options)s supported = %(supported)s"
+ " options = %(options)s\n"
+ " createOptions = %(createOptions)s supported = %(supported)s"
" formattable = %(format)s resizable = %(resize)s\n" %
{"classname": self.__class__.__name__, "id": "%#x" % id(self),
- "object_id": self.id,
+ "object_id": self.id, "createOptions": self.createOptions,
"type": self.type, "name": self.name, "status": self.status,
"device": self.device, "uuid": self.uuid, "exists": self.exists,
"options": self.options, "supported": self.supported,
- "format": self.formattable, "resize": self.resizable})
+ "format": self.formattable, "resize": self.resizable,
+ "createOptions": self.createOptions})
return s
@property
@@ -218,7 +221,7 @@ class DeviceFormat(ObjectID):
d = {"type": self.type, "name": self.name, "device": self.device,
"uuid": self.uuid, "exists": self.exists,
"options": self.options, "supported": self.supported,
- "resizable": self.resizable}
+ "resizable": self.resizable, "createOptions": self.createOptions}
return d
def labeling(self):
@@ -290,6 +293,18 @@ class DeviceFormat(ObjectID):
doc="fstab entry option string"
)
+ def _setCreateOptions(self, options):
+ self._createOptions = options
+
+ def _getCreateOptions(self):
+ return self._createOptions
+
+ createOptions = property(
+ lambda s: s._getCreateOptions(),
+ lambda s,v: s._setCreateOptions(v),
+ doc="options to be used when running mkfs"
+ }
+
def _deviceCheck(self, devspec):
""" Verifies that device spec has a proper format.
diff --git a/blivet/formats/fs.py b/blivet/formats/fs.py
index e2c5ef3..90cbca6 100644
--- a/blivet/formats/fs.py
+++ b/blivet/formats/fs.py
@@ -782,6 +782,7 @@ class FS(DeviceFormat):
else:
data.fsopts = ""
+ data.mkfsopts = self.createOptions or ""
data.fsprofile = self.fsprofile or ""
class Ext2FS(FS):
diff --git a/blivet/tasks/fsmkfs.py b/blivet/tasks/fsmkfs.py
index 542e61d..15138ae 100644
--- a/blivet/tasks/fsmkfs.py
+++ b/blivet/tasks/fsmkfs.py
@@ -20,6 +20,7 @@
# Red Hat Author(s): Anne Mulhern <amulhern(a)redhat.com>
import abc
+import shlex
from six import add_metaclass
@@ -90,7 +91,8 @@ class FSMkfs(task.BasicApplication, FSMkfsTask):
raise FSError("options parameter must be a list.")
label_options = self._labelOptions if label else []
- return options + self.args + label_options + [self.fs.device]
+ create_options = shlex.split(self.fs.createOptions or "")
+ return options + self.args + label_options + create_options + [self.fs.device]
def _mkfsCommand(self, options, label):
"""Return the command to make the filesystem.
--
2.4.3
8 years, 10 months
[pykickstart][rhel7-branch][PATCH] Cleanup reqpart pollution
by Martin Kolman
This is basically a companion patch to the reconfig patch set as
Initial Setup uses the kickstart generation machinery and thus
rogue reqpart commands can easily lead to invalid kickstarts
due to colliding with autopart and other partitioning commands.
Martin Kolman (1):
Avoid polluting generated kickstarts by unexpected reqpart commands
(#1164660)
pykickstart/commands/reqpart.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--
2.4.3
8 years, 10 months
[blivet][master,rhel7-branch] don't crash doing cleanup w/ iscsi
by David Lehman
We don't set up the iscsi or dasd classes when doing cleanup, so don't
try to use them.
David Lehman (1):
Don't crash on cleanup with DASDs or iSCSI devices present.
blivet/devicetree.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--
2.4.3
8 years, 10 months