[pykickstart:rhel7/master] Allow recommended flag for non-prexisting logical volumes (#1149718)
by Anne Mulhern
Resolves: rhbz#1149718
Signed-off-by: mulhern <amulhern(a)redhat.com>
---
pykickstart/commands/logvol.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pykickstart/commands/logvol.py b/pykickstart/commands/logvol.py
index cca3dd1..7c3c9c9 100644
--- a/pykickstart/commands/logvol.py
+++ b/pykickstart/commands/logvol.py
@@ -485,7 +485,7 @@ class F20_LogVol(F18_LogVol):
errorMsg = _("The logvol and autopart commands can't be used at the same time")
raise KickstartParseError(formatErrorMsg(self.lineno, msg=errorMsg))
- if not retval.preexist and not retval.percent and not retval.size:
+ if not retval.preexist and not retval.percent and not retval.size and not retval.recommended:
errorMsg = _("Size required")
raise KickstartParseError(formatErrorMsg(self.lineno, msg=errorMsg))
--
1.9.3
9 years, 7 months
[rhel7] Fix the value written to /etc/sysconfig/desktop
by David Shea
Related: rhbz#1121678
---
pyanaconda/desktop.py | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/pyanaconda/desktop.py b/pyanaconda/desktop.py
index 8b5a388..7428a71 100644
--- a/pyanaconda/desktop.py
+++ b/pyanaconda/desktop.py
@@ -45,9 +45,8 @@ class Desktop(object):
def write(self):
if self.desktop:
- f = open(iutil.getSysroot() + "/etc/sysconfig/desktop", "w")
- f.write(str(self))
- f.close()
+ with open(iutil.getSysroot() + "/etc/sysconfig/desktop", "w") as f:
+ f.write("DESKTOP=%s\n" % self.desktop)
if not os.path.isdir(iutil.getSysroot() + '/etc/systemd/system'):
log.warning("there is no /etc/systemd/system directory, cannot update default.target!")
--
1.9.3
9 years, 7 months
[master 00/17] Improve child process starting and management
by David Shea
The overall goal is to ensure that any time we start a new process, it should
be started with a clean set of signal handlers (in particular, make sure that
SIGPIPE is set to SIG_DFL instead of the SIG_IGN set by python) and no file
descriptors from the parent make it through exec() other than stdin, stdout and
stderr.
The first five are cleanups in the main anaconda script that I hope will be
uncontroversial, one of them obviously a typo that I pushed a couple weeks
ago. Oops.
Patches 6, 7, and 15 are related to the SIGCHLD handler. We don't want to throw
an exception if X or metacity exits before anaconda during a reboot, so clear
the watched process list in exitHandler. Patch 6 rearranges the anaconda script
in order to catch exceptions from watched processes, so we can do the ipmi
stuff when X crashes. Patch 15 moves the watch methods into iutil and modifies
them to use Popen objects instead of a custom fork-exec protocol.
The "Simplify iutil.execReadlines" patch we've discussed before, I've just
split the bits not directly related to execReadlines into separate commits and
expanded the commit message to hopefully explain and address the concerns from
last time. The rest of the patches are for creating a process starting
interface flexible enough for all of our process starts, and getting everyone
to use it.
I'm not real happy about patch 7, but I think we ought to do something in order
to send the ipmi report. Some discussion points:
- I went with raise instead of sys.exit because I thought it would be
unhelpful if anaconda rebooted in such a case. Is there something better
we could do?
- Should we catch Exception, instead? I don't think we do any ipmi stuff if
something crashes and we get a meh handler, but I'm not 100% sure about
that. ExitErrors will always be delivered to the main thread, but if we
catch Exception, would we need a handler in the threading module as well?
- None of this ever actually gets called, because gdk calls _exit(1) (!!)
when it loses the X connection. How do we work around that?
* If we override the error handlers with our own XSetErrorHandler and
XSetIOErrorHandler calls, there will still be a gap between Gdk init
and our calls where X could crash and cause anaconda to exit, also
having XLib calls in anaconda would be super gross
* If we launch the graphical stuff in a separate process that would be
medium gross
* If we ask the Gtk to not freaking exit in a library call they probably
won't
- Also how much of this stuff needs to go to rhel7-branch
David Shea (17):
Fix a typo in a comment
Import gettext in iutil instead of passing the module reference to
iutil
Import _ from the i18n module instead of hand-crafting a copy of it
Remove uses of the deprecated string.split method.
Remove the exitCode parameter from exitHandler.
Clear the list of watched PIDs before exiting.
Handle watched processes exiting.
Lock program_log_lock closer to where the log is written.
Add a method startProgram to handle process starting
Add an option to startProgram to reset signal handlers.
Add close_fds to the Popen call.
Simplify iutil.execReadlines.
Add an option to only capture stdout with execWithCapture
Close file descriptors while daemonizing auditd
Move process watching to iutil.
Move the X startup logic to iutil
Always use iutil to start processes.
anaconda | 384 ++++++++++----------------------
pyanaconda/anaconda_log.py | 4 +-
pyanaconda/ihelp.py | 4 +-
pyanaconda/isys/auditd.c | 5 +
pyanaconda/iutil.py | 373 ++++++++++++++++++++++++-------
pyanaconda/kickstart.py | 32 +--
pyanaconda/rescue.py | 4 +-
pyanaconda/ui/gui/spokes/network.py | 6 +-
pyanaconda/ui/tui/spokes/askvnc.py | 5 +-
pyanaconda/ui/tui/spokes/shell_spoke.py | 6 +-
pyanaconda/vnc.py | 14 +-
scripts/instperf | 3 +-
tests/pyanaconda_tests/iutil_test.py | 227 +++++++++++++++----
13 files changed, 615 insertions(+), 452 deletions(-)
--
1.9.3
9 years, 7 months
[PATCH master/rhel7-branch] Graphically handle errors arising from ostree repo pull problems.
by Chris Lumens
This requires setting up a new glib main context as well, so ostree doesn't
nuke the one we're currently using and make it impossible to do anything
with GTK.
Resolves: rhbz#1131382
---
pyanaconda/packaging/rpmostreepayload.py | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/packaging/rpmostreepayload.py b/pyanaconda/packaging/rpmostreepayload.py
index 1dca94a..70a4903 100644
--- a/pyanaconda/packaging/rpmostreepayload.py
+++ b/pyanaconda/packaging/rpmostreepayload.py
@@ -22,7 +22,9 @@
import os
import shutil
+import sys
+from pyanaconda import constants
from pyanaconda import iutil
from pyanaconda.i18n import _
from pyanaconda.progress import progressQ
@@ -85,6 +87,9 @@ class RPMOSTreePayload(ArchivePayload):
progressQ.send_message("Writing objects")
def install(self):
+ mainctx = GLib.MainContext.new()
+ mainctx.push_thread_default()
+
cancellable = None
from gi.repository import OSTree
ostreesetup = self.data.ostreesetup
@@ -117,7 +122,16 @@ class RPMOSTreePayload(ArchivePayload):
progress = OSTree.AsyncProgress.new()
progress.connect('changed', self._pullProgressCb)
- repo.pull(ostreesetup.remote, [ostreesetup.ref], 0, progress, cancellable)
+
+ try:
+ repo.pull(ostreesetup.remote, [ostreesetup.ref], 0, progress, cancellable)
+ except GLib.GError as e:
+ exn = PayloadInstallError("Failed to pull from repository: %s" % e)
+ log.error(str(exn))
+ if errors.errorHandler.cb(exn) == errors.ERROR_RAISE:
+ progressQ.send_quit(1)
+ iutil.ipmi_report(constants.IPMI_ABORTED)
+ sys.exit(1)
progressQ.send_message(_("Preparing deployment of %s") % (ostreesetup.ref, ))
@@ -161,6 +175,8 @@ class RPMOSTreePayload(ArchivePayload):
log.info("Copying bootloader data: " + fname)
shutil.copytree(srcpath, os.path.join(physboot, fname))
+ mainctx.pop_thread_default()
+
def prepareMountTargets(self, storage):
ostreesetup = self.data.ostreesetup
--
1.9.3
9 years, 7 months
[blivet][master/rhel7-branch] devicefactory and raid (#1148373)
by David Lehman
Patch 2 is the main event. The others are just things I saw that needed
fixing while I was in there.
We have new code that validates member addition/removal against current
raid level for btrfs. The way the devicefactory toggles encryption of
container members is to remove each one from the container and then re-add
it after either adding or removing the encrypted layer. This triggers the
raid level checks, which raise an exception, thus preventing a valid
configuration change. I want to get to the point where we validate every
raid level change and member set change to ensure devices are always in
a sensible state, so I have to find a way to bypass the checks while
reconfiguring devices via the factory. The obvious way to do that is to
set the raid level to something that does not impose any restrictions on
member count. It seems a little bit dirty, but we always overwrite the
raid levels as part of reconfiguration anyway, so it should be safe. We
still get validation of the member count explicitly in
DeviceFactory._configure and again when we set the raid level.
9 years, 7 months
[anaconda][rhel7-branch/master][PATCH] Fix autotools rules to properly include help placeholders (#1072033)
by Martin Kolman
Related: rhbz#1072033
Signed-off-by: Martin Kolman <mkolman(a)redhat.com>
---
anaconda.spec.in | 1 +
configure.ac | 2 ++
data/Makefile.am | 2 +-
data/help/Makefile.am | 2 +-
data/help/en-US/Makefile.am | 2 +-
5 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/anaconda.spec.in b/anaconda.spec.in
index a1fa861..3918155 100644
--- a/anaconda.spec.in
+++ b/anaconda.spec.in
@@ -271,6 +271,7 @@ update-desktop-database &> /dev/null || :
%{_sysconfdir}/X11/xinit/xinitrc.d/*
%{_datadir}/applications/*.desktop
%{_datadir}/icons/hicolor/*
+%{_datadir}/doc/anaconda/*
%endif
%files gui
diff --git a/configure.ac b/configure.ac
index 238ab32..7b613e8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -229,6 +229,8 @@ AC_CONFIG_FILES([Makefile
data/icons/hicolor/256x256/Makefile
data/icons/hicolor/256x256/apps/Makefile
data/systemd/Makefile
+ data/help/Makefile
+ data/help/en-US/Makefile
po/Makefile.in
scripts/Makefile
pyanaconda/Makefile
diff --git a/data/Makefile.am b/data/Makefile.am
index ebbdaaf..cf5894b 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -17,7 +17,7 @@
#
# Author: Martin Sivak <msivak(a)redhat.com>
-SUBDIRS = command-stubs icons liveinst pixmaps systemd post-scripts
+SUBDIRS = command-stubs icons liveinst pixmaps systemd post-scripts help
CLEANFILES = *~
diff --git a/data/help/Makefile.am b/data/help/Makefile.am
index 8be7029..ed2eda3 100644
--- a/data/help/Makefile.am
+++ b/data/help/Makefile.am
@@ -16,6 +16,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Author: Martin Kolman <mkolman(a)redhat.com>
+SUBDIRS = en-US
MAINTAINERCLEANFILES = Makefile.in
-SUBDIRS = en-US
diff --git a/data/help/en-US/Makefile.am b/data/help/en-US/Makefile.am
index 0cd10bc..0b46f4a 100644
--- a/data/help/en-US/Makefile.am
+++ b/data/help/en-US/Makefile.am
@@ -17,7 +17,7 @@
#
# Author: Martin Kolman <mkolman(a)redhat.com>
-enplacholderdir = $(docdir)/en-US
+enplaceholderdir = $(docdir)/en-US
dist_enplaceholder_DATA = FedoraPlaceholder.html FedoraPlaceholderWithLinks.html RHEL7Placeholder.html RHEL7PlaceholderWithLinks.html
MAINTAINERCLEANFILES = Makefile.in
--
1.9.3
9 years, 7 months
[master/rhel7-branch] fix detection of dasd disklabels (#1144410)
by David Lehman
blkid can't detect them, so for dasd disk we fallback to parted detection.
There have been several bugs caused by us ignoring partitions (and
therefore also lvm, &c) on disks that we failed to detect a disklabel on.
It always ends up with us trying to remove partitions in use by the active
lvm that we failed to detect. We shouldn't try to proceed with an install
in these cases. That's the rationale for patch 2.
9 years, 7 months
[initial-setup][rhel7-branch][PATCH] Fix Initial Setup to correctly support the Anaconda built-in Help (#1072033)
by Martin Kolman
There are a couple of small Initial Setup specific tweaks that need to be
applied to make the help system work as well as in Anaconda:
* add yelp dependency for the Initial Setup GUI package
* add a post-install-class providing hosting the help paths
* add help file names for the Initial Setup hub and EULA spoke
Related: rhbz#1072033
Signed-off-by: Martin Kolman <mkolman(a)redhat.com>
---
initial-setup.spec | 1 +
initial_setup/__main__.py | 3 ++-
initial_setup/gui/hubs/initial_setup_hub.py | 1 +
initial_setup/gui/spokes/eula.py | 1 +
initial_setup/post_installclass.py | 27 +++++++++++++++++++++++++++
5 files changed, 32 insertions(+), 1 deletion(-)
create mode 100644 initial_setup/post_installclass.py
diff --git a/initial-setup.spec b/initial-setup.spec
index 0e57df1..fad3c26 100644
--- a/initial-setup.spec
+++ b/initial-setup.spec
@@ -48,6 +48,7 @@ a series of steps that allows for easier configuration of the machine.
Summary: Graphical user interface for the initial-setup utility
Requires: gtk3
Requires: anaconda-gui >= %{anacondaver}
+Requires: yelp
%description gui
The initial-setup-gui package contains a graphical user interface for the
diff --git a/initial_setup/__main__.py b/initial_setup/__main__.py
index 429008a..4b07386 100644
--- a/initial_setup/__main__.py
+++ b/initial_setup/__main__.py
@@ -4,6 +4,7 @@ import sys
import signal
import pykickstart
from pyanaconda.users import Users
+from initial_setup.post_installclass import InstallClass
signal.signal(signal.SIGINT, signal.SIG_IGN)
@@ -91,7 +92,7 @@ if mode == "gui":
gui.InitialSetupGraphicalUserInterface.update_paths(addon_module_paths)
# Initialize the UI
- ui = gui.InitialSetupGraphicalUserInterface(None, None, None)
+ ui = gui.InitialSetupGraphicalUserInterface(None, None, InstallClass())
else:
# Import IS gui specifics
import tui
diff --git a/initial_setup/gui/hubs/initial_setup_hub.py b/initial_setup/gui/hubs/initial_setup_hub.py
index 690c4ae..24b9edd 100644
--- a/initial_setup/gui/hubs/initial_setup_hub.py
+++ b/initial_setup/gui/hubs/initial_setup_hub.py
@@ -32,6 +32,7 @@ class InitialSetupMainHub(Hub):
builderObjects = ["summaryWindow"]
mainWidgetName = "summaryWindow"
translationDomain = "initial-setup"
+ helpFile = "InitialSetupHub.xml"
def __init__(self, *args):
Hub.__init__(self, *args)
diff --git a/initial_setup/gui/spokes/eula.py b/initial_setup/gui/spokes/eula.py
index 415eff1..ed3b521 100644
--- a/initial_setup/gui/spokes/eula.py
+++ b/initial_setup/gui/spokes/eula.py
@@ -21,6 +21,7 @@ class EULAspoke(FirstbootOnlySpokeMixIn, NormalSpoke):
builderObjects = ["eulaBuffer", "eulaWindow"]
mainWidgetName = "eulaWindow"
uiFile = "eula.glade"
+ helpFile = "EULAspoke.xml"
icon = "application-certificate-symbolic"
title = N_("_LICENSE INFORMATION")
diff --git a/initial_setup/post_installclass.py b/initial_setup/post_installclass.py
new file mode 100644
index 0000000..8745dcc
--- /dev/null
+++ b/initial_setup/post_installclass.py
@@ -0,0 +1,27 @@
+#
+# Simple post-install class
+#
+# Copyright (C) 2014 Red Hat, Inc. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+from pyanaconda.installclass import BaseInstallClass
+
+class InstallClass(BaseInstallClass):
+ help_placeholder = "RHEL7Placeholder.html"
+ help_placeholder_with_links = "RHEL7PlaceholderWithLinks.html"
+
+ def __init__(self):
+ BaseInstallClass.__init__(self)
--
1.9.3
9 years, 7 months
[anaconda:master 0/4] #1076055 inspired patches
by Anne Mulhern
A bunch of obvious things that I wanted to do on RHEL7, but that were too
invasive. The less obvious things will take a bit more work.
Actually, I went ahead with patch 1 on RHEL7 as well, but I'm considering
it part of this patch set for master, so here it is.
mulhern (4):
Use Size, not int, for size (#1076055)
Get rid of unnecessary raid_level variable
Be more restrictive displaying btrfs device type.
Refactor handling of fsCombo considerations.
pyanaconda/ui/gui/spokes/custom.py | 111 +++++++++++++++++++++++--------------
1 file changed, 70 insertions(+), 41 deletions(-)
--
1.9.3
9 years, 7 months