[master 0/2] a couple of miscellaneous patches
by David Shea
I found these two on my signal-handling branch but they're not really signal
related. I guess the second one sort of is. I was trying to figure out why
killall anaconda was doing weird things to metacity, and this is why.
David Shea (2):
Remove the /usr/bin/liveinst symlink during uninstall
Use exec instead of system to run metacity
anaconda | 11 +++++------
data/liveinst/Makefile.am | 3 +++
2 files changed, 8 insertions(+), 6 deletions(-)
--
2.0.0
9 years, 9 months
[master/rhel7 0/2] Make selected languages more visible
by David Shea
This is the implemention of the mockups that mizmo posted to
anaconda-devel-list, plus a bonus patch because I found setting multiple
properties with cell_data_func to be a huge pain.
Patches are against rhel7-branch. If you want to try it against rawhide, I
created an updates.img at https://dshea.fedorapeople.org/1072355.img
David Shea (2):
Add a wrapper function for GtkTreeViewColumn.set_cell_data_func
Highlight languages in langsupport that contain selected locales
(#1072355)
pyanaconda/ui/gui/spokes/datetime_spoke.py | 12 +++--
pyanaconda/ui/gui/spokes/keyboard.py | 15 +++---
pyanaconda/ui/gui/spokes/langsupport.glade | 8 ++++
pyanaconda/ui/gui/spokes/langsupport.py | 55 +++++++++++++++++-----
.../ui/gui/spokes/lib/lang_locale_handler.py | 10 ++--
pyanaconda/ui/gui/utils.py | 34 +++++++++++++
6 files changed, 105 insertions(+), 29 deletions(-)
--
2.0.0
9 years, 9 months
[PATCH] Remove the STANDALONE #ifdef from auditd.
by David Shea
We don't care about the non-standalone case anymore, and the ifdef
confuses cppcheck.
---
pyanaconda/isys/Makefile.am | 2 +-
pyanaconda/isys/auditd.c | 14 --------------
2 files changed, 1 insertion(+), 15 deletions(-)
diff --git a/pyanaconda/isys/Makefile.am b/pyanaconda/isys/Makefile.am
index cdb3baf..dbf0f62 100644
--- a/pyanaconda/isys/Makefile.am
+++ b/pyanaconda/isys/Makefile.am
@@ -33,7 +33,7 @@ _isys_la_SOURCES = isys.c
auditddir = $(libexecdir)/$(PACKAGE_NAME)
auditd_PROGRAMS = auditd
auditd_SOURCES = auditd.c
-auditd_CFLAGS = -DSTANDALONE $(SELINUX_CFLAGS)
+auditd_CFLAGS = $(SELINUX_CFLAGS)
auditd_LDFLAGS = -laudit
MAINTAINERCLEANFILES = Makefile.in
diff --git a/pyanaconda/isys/auditd.c b/pyanaconda/isys/auditd.c
index d598f8d..a75289c 100644
--- a/pyanaconda/isys/auditd.c
+++ b/pyanaconda/isys/auditd.c
@@ -107,14 +107,6 @@ int audit_daemonize(void) {
if (child < 0)
return -1;
-#ifndef STANDALONE
- for (fd = 0; fd < getdtablesize(); fd++)
- close(fd);
- signal(SIGTTOU, SIG_IGN);
- signal(SIGTTIN, SIG_IGN);
- signal(SIGTSTP, SIG_IGN);
-#endif /* !defined(STANDALONE) */
-
if ((fd = open("/proc/self/oom_score_adj", O_RDWR)) >= 0) {
write(fd, "-1000", 5);
close(fd);
@@ -123,14 +115,9 @@ int audit_daemonize(void) {
do_auditd(fd);
audit_close(fd);
-#ifndef STANDALONE
- exit(0);
-#endif /* !defined(STANDALONE) */
-
return 0;
}
-#ifdef STANDALONE
int main(void) {
if (audit_daemonize() < 0)
{
@@ -140,7 +127,6 @@ int main(void) {
return 0;
}
-#endif /* STANDALONE */
/*
* vim:ts=8:sw=4:sts=4:et
--
2.0.0
9 years, 9 months
[anaconda][master] Fix issues reported by pyflakes
by Vratislav Podzimek
Unused imports and variables.
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
pyanaconda/isys/__init__.py | 9 ---------
pyanaconda/ui/categories/__init__.py | 1 -
pyanaconda/ui/gui/__init__.py | 1 +
pyanaconda/ui/gui/hubs/__init__.py | 4 ----
pyanaconda/ui/gui/spokes/__init__.py | 1 -
pyanaconda/ui/tui/__init__.py | 1 -
tests/gui/inside/__init__.py | 2 --
tests/gui/outside/__init__.py | 1 -
8 files changed, 1 insertion(+), 19 deletions(-)
diff --git a/pyanaconda/isys/__init__.py b/pyanaconda/isys/__init__.py
index 44f6144..f29f08b 100644
--- a/pyanaconda/isys/__init__.py
+++ b/pyanaconda/isys/__init__.py
@@ -29,16 +29,7 @@ except ImportError:
# up PYTHONPATH and just do this basic import.
import _isys
-import os
-import os.path
-import socket
-import stat
-import sys
-from pyanaconda import iutil
import blivet.arch
-import re
-import struct
-import dbus
import time
import datetime
diff --git a/pyanaconda/ui/categories/__init__.py b/pyanaconda/ui/categories/__init__.py
index 6a0e270..5fa3ccd 100644
--- a/pyanaconda/ui/categories/__init__.py
+++ b/pyanaconda/ui/categories/__init__.py
@@ -19,7 +19,6 @@
# Red Hat Author(s): Chris Lumens <clumens(a)redhat.com>
#
-import os.path
from pyanaconda.i18n import N_
__all__ = ["SpokeCategory"]
diff --git a/pyanaconda/ui/gui/__init__.py b/pyanaconda/ui/gui/__init__.py
index 6364f54..bbbdb9c 100644
--- a/pyanaconda/ui/gui/__init__.py
+++ b/pyanaconda/ui/gui/__init__.py
@@ -615,6 +615,7 @@ class GraphicalUserInterface(UserInterface):
dlg.refresh(details)
rc = dlg.run()
dlg.window.destroy()
+ return rc
@gtk_action_wait
def showYesNoQuestion(self, message):
diff --git a/pyanaconda/ui/gui/hubs/__init__.py b/pyanaconda/ui/gui/hubs/__init__.py
index e2cb44a..a89248b 100644
--- a/pyanaconda/ui/gui/hubs/__init__.py
+++ b/pyanaconda/ui/gui/hubs/__init__.py
@@ -19,8 +19,6 @@
# Red Hat Author(s): Chris Lumens <clumens(a)redhat.com>
#
-import os
-
from gi.repository import GLib
from pyanaconda.flags import flags
@@ -29,9 +27,7 @@ from pyanaconda.product import distributionText
from pyanaconda.ui import common
from pyanaconda.ui.gui import GUIObject
-from pyanaconda.ui.gui.spokes import StandaloneSpoke
from pyanaconda.ui.gui.utils import gtk_call_once, escape_markup
-from pyanaconda.constants import ANACONDA_ENVIRON
import logging
log = logging.getLogger("anaconda")
diff --git a/pyanaconda/ui/gui/spokes/__init__.py b/pyanaconda/ui/gui/spokes/__init__.py
index 53989c3..183dc6f 100644
--- a/pyanaconda/ui/gui/spokes/__init__.py
+++ b/pyanaconda/ui/gui/spokes/__init__.py
@@ -21,7 +21,6 @@
from pyanaconda.ui import common
from pyanaconda.ui.gui import GUIObject
-import os.path
__all__ = ["StandaloneSpoke", "NormalSpoke"]
diff --git a/pyanaconda/ui/tui/__init__.py b/pyanaconda/ui/tui/__init__.py
index 655913a..cb510b5 100644
--- a/pyanaconda/ui/tui/__init__.py
+++ b/pyanaconda/ui/tui/__init__.py
@@ -149,7 +149,6 @@ class TextUserInterface(ui.UserInterface):
_hubs = self._list_hubs()
# First, grab a list of all the standalone spokes.
- path = os.path.join(os.path.dirname(__file__), "spokes")
spokes = self._collectActionClasses(self.paths["spokes"], StandaloneSpoke)
actionClasses = self._orderActionClasses(spokes, _hubs)
diff --git a/tests/gui/inside/__init__.py b/tests/gui/inside/__init__.py
index cf4cf90..5b42cbe 100644
--- a/tests/gui/inside/__init__.py
+++ b/tests/gui/inside/__init__.py
@@ -17,12 +17,10 @@
#
# Author: Chris Lumens <clumens(a)redhat.com>
from dogtail.config import config
-from dogtail.predicate import GenericPredicate
from dogtail.tree import SearchError, root
from dogtail.utils import doDelay, screenshot
import glob
-import os
import unittest
class UITestCase(unittest.TestCase):
diff --git a/tests/gui/outside/__init__.py b/tests/gui/outside/__init__.py
index a8e02bb..a5f5144 100644
--- a/tests/gui/outside/__init__.py
+++ b/tests/gui/outside/__init__.py
@@ -26,7 +26,6 @@ import os
import shutil
import subprocess
import tempfile
-import unittest
class Creator(object):
"""A Creator subclass defines all the parameters for making a VM to run a
--
1.9.3
9 years, 9 months
[master/f21-branch] Move and fix sanityCheck
by Vratislav Podzimek
sanityCheck code is installer-specific so it should live in the anaconda
codebase. And it should check minimal RAM requirements properly based on the
installation mode.
Vratislav Podzimek (2):
Move sanityCheck code to anaconda's codebase
Make storage sanity check aware of base RAM requirements (#1123466)
pyanaconda/isys/__init__.py | 1 +
pyanaconda/kickstart.py | 7 +-
pyanaconda/storage_utils.py | 192 +++++++++++++++++++++++++++++++++++-
pyanaconda/ui/gui/spokes/custom.py | 13 +--
pyanaconda/ui/gui/spokes/storage.py | 3 +-
pyanaconda/ui/helpers.py | 9 +-
pyanaconda/ui/tui/spokes/storage.py | 6 +-
7 files changed, 213 insertions(+), 18 deletions(-)
--
1.9.3
9 years, 9 months
[blivet][master/f21-branch] Hot-fix for a bug #1123466
by Vratislav Podzimek
With the zRAM patches I've removed what seemed to be an unused constant --
EARLY_SWAP_RAM. Turns out blivet uses it to check if the installation will work
without swap or not. I have no idea how the constant's name relates to that, but
instead of adding it back I'd like to start with removing the check from blivet.
The actual amount of RAM anaconda requires for installation without swap depends
on the installation mode (GUI/TUI) so the check needs to be more complex. And it
shouldn't be done in blivet in the first place.
A follow-up patch I'll sent during the week will add the check back, but into
Anaconda's codebase. Maybe moving all the sanityCheck code from blivet as it is
installer specific and has nothing to do with blivet.
Vratislav Podzimek (1):
Remove a wrong RAM/swap check (#1123466)
blivet/__init__.py | 24 +++++-------------------
1 file changed, 5 insertions(+), 19 deletions(-)
--
1.9.3
9 years, 9 months
[blivet] Remove unused code using pyblock
by Vratislav Podzimek
The pyblock module is quite a pain if we want to make blivet python3 compatible,
it kills tracing if we want to turn it on for anaconda and is in general quite a
crazy old CPython code. That's why I'd like to drop it as blivet's dependency by
implementing the required stuff in the libblockdev library. However, I'm not
much a fan of adding some cryptic C code only for something that is actually
never called and exists as a piece of code only for documentation purposes.
Vratislav Podzimek (1):
Remove two methods that are never called
blivet/devices.py | 38 --------------------------------------
1 file changed, 38 deletions(-)
--
1.9.3
9 years, 9 months
[master] Resurrect auditd
by David Shea
All of auditd except for the parts that call exit() was wrapped in
USESELINUX ifdefs, which was not defined, so our fake auditd hasn't
done anything for a while. Remove the ifdefs since building an auditd that
does that much nothing is kind of silly. Fix the LDFLAGS needed to link.
Switch from oom_adj to oom_score_adj since the former was deprecated
some time ago and complains when you use it now. Add auditd to
makeupdates.
---
configure.ac | 3 +++
pyanaconda/isys/Makefile.am | 2 +-
pyanaconda/isys/auditd.c | 8 ++------
scripts/makeupdates | 24 ++++++++++++++++++++++++
4 files changed, 30 insertions(+), 7 deletions(-)
diff --git a/configure.ac b/configure.ac
index 707aa7c..34ef03b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -86,6 +86,9 @@ AC_CHECK_FUNCS([getcwd memset mkdir strchr strdup],
[],
[ANACONDA_SOFT_FAILURE([Function $ac_func not found.])])
+AC_CHECK_LIB([audit], [audit_open], [:],
+ [ANACONDA_SOFT_FAILURE([libaudit not found])])
+
AM_PATH_PYTHON(python_required_version)
# Check for the python extension paths
diff --git a/pyanaconda/isys/Makefile.am b/pyanaconda/isys/Makefile.am
index c787f60..cdb3baf 100644
--- a/pyanaconda/isys/Makefile.am
+++ b/pyanaconda/isys/Makefile.am
@@ -34,6 +34,6 @@ auditddir = $(libexecdir)/$(PACKAGE_NAME)
auditd_PROGRAMS = auditd
auditd_SOURCES = auditd.c
auditd_CFLAGS = -DSTANDALONE $(SELINUX_CFLAGS)
-auditd_LDADD = $(SELINUX_LIBS) $(LIBNL_LIBS)
+auditd_LDFLAGS = -laudit
MAINTAINERCLEANFILES = Makefile.in
diff --git a/pyanaconda/isys/auditd.c b/pyanaconda/isys/auditd.c
index 3d41b73..d598f8d 100644
--- a/pyanaconda/isys/auditd.c
+++ b/pyanaconda/isys/auditd.c
@@ -38,7 +38,6 @@
#include "auditd.h"
-#ifdef USESELINUX
static int done;
static void sig_done(int sig)
@@ -92,10 +91,8 @@ static void do_auditd(int fd) {
}
return;
}
-#endif /* USESELINUX */
int audit_daemonize(void) {
-#ifdef USESELINUX
int fd;
pid_t child;
@@ -118,8 +115,8 @@ int audit_daemonize(void) {
signal(SIGTSTP, SIG_IGN);
#endif /* !defined(STANDALONE) */
- if ((fd = open("/proc/self/oom_adj", O_RDWR)) >= 0) {
- write(fd, "-17", 3);
+ if ((fd = open("/proc/self/oom_score_adj", O_RDWR)) >= 0) {
+ write(fd, "-1000", 5);
close(fd);
}
fd = audit_open();
@@ -130,7 +127,6 @@ int audit_daemonize(void) {
exit(0);
#endif /* !defined(STANDALONE) */
-#endif /* USESELINUX */
return 0;
}
diff --git a/scripts/makeupdates b/scripts/makeupdates
index 4d143cd..b631657 100755
--- a/scripts/makeupdates
+++ b/scripts/makeupdates
@@ -342,6 +342,10 @@ def isysChanged(tag):
def widgetsChanged(tag):
return _compilableChanged(tag, 'widgets')
+def auditdChanged(tag):
+ return _compilableChanged(tag, 'pyanaconda/isys/auditd.c') or \
+ _compilableChanged(tag, 'pyanaconda/isys/auditd.h')
+
def checkAutotools(srcdir, builddir):
# Assumes that cwd is srcdir
if not os.path.isfile(os.path.join(builddir, 'Makefile')):
@@ -374,6 +378,23 @@ def copyUpdatedIsys(updates, srcdir, builddir):
if os.path.isfile(isysmodule):
shutil.copy2(isysmodule, tmpupdates)
+def copyUpdatedAuditd(updates, srcdir, builddir):
+ os.chdir(srcdir)
+ print("copyUpdatedIsys BUILLDIR %s" % builddir)
+ auditdir = updates + '/usr/sbin'
+
+ checkAutotools(srcdir, builddir)
+
+ os.system('make -C %s -j %d auditd' % (builddir + '/pyanaconda/isys', multiprocessing.cpu_count()))
+
+ # Copy the auditd binary to /usr/sbin
+ if not os.path.isdir(auditdir):
+ os.makedirs(auditdir)
+
+ auditd = builddir + '/pyanaconda/isys/auditd'
+ if os.path.isfile(auditd):
+ shutil.copy2(auditd, auditdir)
+
def copyUpdatedWidgets(updates, srcdir, builddir):
os.chdir(srcdir)
@@ -951,6 +972,9 @@ def main():
if widgetsChanged(args.tag):
copyUpdatedWidgets(updates, cwd, builddir)
+ if auditdChanged(args.tag):
+ copyUpdatedAuditd(updates, cwd, builddir)
+
if args.po:
copyTranslations(updates, cwd, builddir)
--
2.0.0
9 years, 9 months
[pykickstart 1/3] Add --install flag to repo command (#1119867)
by Brian C. Lane
---
pykickstart/commands/repo.py | 29 +++++++++++++++++++++++++++++
pykickstart/handlers/f21.py | 4 ++--
pykickstart/handlers/rhel7.py | 4 ++--
tests/commands/repo.py | 10 ++++++++++
4 files changed, 43 insertions(+), 4 deletions(-)
diff --git a/pykickstart/commands/repo.py b/pykickstart/commands/repo.py
index 6e0da76..3ee114c 100644
--- a/pykickstart/commands/repo.py
+++ b/pykickstart/commands/repo.py
@@ -132,6 +132,24 @@ RHEL6_RepoData = F14_RepoData
F15_RepoData = F14_RepoData
+class F21_RepoData(F14_RepoData):
+ removedKeywords = F14_RepoData.removedKeywords
+ removedAttrs = F14_RepoData.removedAttrs
+
+ def __init__(self, *args, **kwargs):
+ F14_RepoData.__init__(self, *args, **kwargs)
+ self.install = kwargs.get("install", False)
+
+ def _getArgsAsStr(self):
+ retval = F14_RepoData._getArgsAsStr(self)
+
+ if self.install:
+ retval += " --install"
+
+ return retval
+
+RHEL7_RepoData = F21_RepoData
+
class FC6_Repo(KickstartCommand):
removedKeywords = KickstartCommand.removedKeywords
removedAttrs = KickstartCommand.removedAttrs
@@ -252,3 +270,14 @@ class F15_Repo(F14_Repo):
removedAttrs = F14_Repo.removedAttrs
urlRequired = False
+
+class F21_Repo(F15_Repo):
+ removedKeywords = F15_Repo.removedKeywords
+ removedAttrs = F15_Repo.removedAttrs
+
+ def _getParser(self):
+ op = F15_Repo._getParser(self)
+ op.add_option("--install", action="store_true", default=False)
+ return op
+
+RHEL7_Repo = F21_Repo
diff --git a/pykickstart/handlers/f21.py b/pykickstart/handlers/f21.py
index cac66bc..3f377da 100644
--- a/pykickstart/handlers/f21.py
+++ b/pykickstart/handlers/f21.py
@@ -69,7 +69,7 @@ class F21Handler(BaseHandler):
"raid": commands.raid.F20_Raid,
"realm": commands.realm.F19_Realm,
"reboot": commands.reboot.F18_Reboot,
- "repo": commands.repo.F15_Repo,
+ "repo": commands.repo.F21_Repo,
"rescue": commands.rescue.F10_Rescue,
"rootpw": commands.rootpw.F18_RootPw,
"selinux": commands.selinux.FC3_SELinux,
@@ -103,7 +103,7 @@ class F21Handler(BaseHandler):
"NetworkData": commands.network.F21_NetworkData,
"PartData": commands.partition.F18_PartData,
"RaidData": commands.raid.F18_RaidData,
- "RepoData": commands.repo.F15_RepoData,
+ "RepoData": commands.repo.F21_RepoData,
"SshPwData": commands.sshpw.F13_SshPwData,
"UserData": commands.user.F19_UserData,
"VolGroupData": commands.volgroup.F21_VolGroupData,
diff --git a/pykickstart/handlers/rhel7.py b/pykickstart/handlers/rhel7.py
index a128182..94609ac 100644
--- a/pykickstart/handlers/rhel7.py
+++ b/pykickstart/handlers/rhel7.py
@@ -68,7 +68,7 @@ class RHEL7Handler(BaseHandler):
"raid": commands.raid.F20_Raid,
"realm": commands.realm.F19_Realm,
"reboot": commands.reboot.F18_Reboot,
- "repo": commands.repo.F15_Repo,
+ "repo": commands.repo.RHEL7_Repo,
"rescue": commands.rescue.F10_Rescue,
"rootpw": commands.rootpw.F18_RootPw,
"selinux": commands.selinux.FC3_SELinux,
@@ -103,7 +103,7 @@ class RHEL7Handler(BaseHandler):
"NetworkData": commands.network.RHEL7_NetworkData,
"PartData": commands.partition.F18_PartData,
"RaidData": commands.raid.F18_RaidData,
- "RepoData": commands.repo.F15_RepoData,
+ "RepoData": commands.repo.RHEL7_RepoData,
"SshPwData": commands.sshpw.F13_SshPwData,
"UserData": commands.user.F19_UserData,
"VolGroupData": commands.volgroup.FC16_VolGroupData,
diff --git a/tests/commands/repo.py b/tests/commands/repo.py
index e03e7da..b944c54 100644
--- a/tests/commands/repo.py
+++ b/tests/commands/repo.py
@@ -118,5 +118,15 @@ class F15_TestCase(F14_TestCase):
def runTest(self, urlRequired=False):
F14_TestCase.runTest(self, urlRequired=urlRequired)
+class F21_TestCase(F15_TestCase):
+ def runTest(self, urlRequired=False):
+ F15_TestCase.runTest(self, urlRequired=urlRequired)
+ #pass
+ self.assert_parse("repo --name=blah --baseurl=https://www.domain.com --install",
+ "repo --name=\"blah\" --baseurl=https://www.domain.com --install\n")
+ #fail
+ self.assert_parse_error("repo --name=blah --baseurl=https://www.domain.com --install=yeeeaah", KickstartParseError)
+
+
if __name__ == "__main__":
unittest.main()
--
1.9.3
9 years, 9 months