[PATCH] Function getDefaultHostname was renamed some time ago.
by Radek Vykydal
---
anaconda | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/anaconda b/anaconda
index e5b9d41..043852e 100755
--- a/anaconda
+++ b/anaconda
@@ -607,7 +607,7 @@ def prompt_for_ssh():
except Exception as e:
stdoutLog.debug("Exception caught trying to get host name of %s: %s" %
(ipstr, e))
- name = network.getDefaultHostname(None)
+ name = network.getHostname()
else:
if len(hinfo) == 3:
name = hinfo[0]
--
1.7.11.7
11 years, 4 months
[PATCH rhel6-branch] Disconnect active slaves before activating bond (#662007)
by Radek Vykydal
Related: rhbz#662007
---
loader/net.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/loader/net.c b/loader/net.c
index 15a7fe0..93a9c6f 100644
--- a/loader/net.c
+++ b/loader/net.c
@@ -2313,6 +2313,26 @@ int activateDevice(struct loaderData_s * loaderData, iface_t * iface) {
}
}
+ if (loaderData->bonding_slaves) {
+ gchar **slaves = NULL;
+ int i;
+
+ if ((slaves = g_strsplit(loaderData->bonding_slaves, ",", 0)) != NULL) {
+ for (i=0; i < g_strv_length(slaves); i++) {
+ if (slaves[i] != NULL && g_strcmp0(slaves[i], "")) {
+ if (is_iface_activated(slaves[i])) {
+ logMessage(INFO, "bond slave device %s is already activated", slaves[i]);
+ if ((rc = disconnectDevice(slaves[i])) != 0) {
+ logMessage(ERROR, "device disconnection failed with return code %d", rc);
+ }
+ }
+ }
+ }
+ g_strfreev(slaves);
+ }
+ }
+
+
/* we don't want to end up asking about interface more than once
* if we're in a kickstart-ish case (#100724) */
loaderData->netDev_set = 1;
--
1.7.4
11 years, 4 months
[lorax] [PATCH] Add trigger for Anaconda's exception handling to bash_history
by Vratislav Podzimek
Sending SIGUSR1 to the Anaconda process raises an exception with
some random data. This can be used to test exception handling and
bug reporting.
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
share/config_files/common/bash_history | 1 +
1 file changed, 1 insertion(+)
diff --git a/share/config_files/common/bash_history b/share/config_files/common/bash_history
index 11ecdfc..511b790 100644
--- a/share/config_files/common/bash_history
+++ b/share/config_files/common/bash_history
@@ -1,5 +1,6 @@
kill -USR2 `cat /var/run/anaconda.pid`
kill -HUP `cat /var/run/anaconda.pid`
+kill -USR1 `cat /var/run/anaconda.pid`
udevadm info --export-db | less
tail -f /tmp/storage.log
echo b > /proc/sysrq-trigger
--
1.7.11.7
11 years, 4 months
[python-meh] Text interface and some additional changes
by Vratislav Podzimek
PATCH 1/4 changes the usage of libreport to use its new API.
Patches 2/4 and 3/4 are only minor issues I've hit when working on the new text
interface.
And finally, PATCH 4/4 replaces the old newt-based text interface by the new
purely textual one.
I've tested these changes and everything seems to be working great.
Vratislav Podzimek (4):
Get rid of the accountManager and use new libreport API
Destroy main window after running it
Add dumb enableNetwork implementation to GraphicalIntf
New purely textual text interface
meh/handler.py | 9 ++--
meh/ui/__init__.py | 2 +-
meh/ui/gui.py | 18 +++----
meh/ui/text.py | 156 ++++++++++++++++++++++++++++++++++-------------------
python-meh.spec | 8 +--
5 files changed, 120 insertions(+), 73 deletions(-)
--
1.7.11.7
11 years, 4 months
[master] Exception handling in text mode and new python-meh
by Vratislav Podzimek
These patches follow the ones proposed for the python-meh. Once those are
pushed and a new python-meh build is available, we can push these two.
Vratislav Podzimek (2):
python-meh's saveExceptionWindow no longer uses the accountManager
Exception handling in text mode
anaconda | 5 ++---
anaconda.spec.in | 2 +-
pyanaconda/ui/gui/__init__.py | 4 ++--
pyanaconda/ui/tui/__init__.py | 9 +++++++++
4 files changed, 14 insertions(+), 6 deletions(-)
--
1.7.11.7
11 years, 4 months
[PATCH] Split __init__ and setup in TUI screens so we can set the environment and search paths
by Martin Sivak
---
pyanaconda/ui/tui/__init__.py | 10 +++++++---
pyanaconda/ui/tui/hubs/__init__.py | 7 ++++---
pyanaconda/ui/tui/simpleline/base.py | 8 ++++++++
3 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/pyanaconda/ui/tui/__init__.py b/pyanaconda/ui/tui/__init__.py
index ba6d5b8..c8212b6 100644
--- a/pyanaconda/ui/tui/__init__.py
+++ b/pyanaconda/ui/tui/__init__.py
@@ -112,6 +112,8 @@ class YesNoDialog(tui.UIScreen):
class TextUserInterface(ui.UserInterface):
"""This is the main class for Text user interface."""
+ ENVIRONMENT = "anaconda"
+
def __init__(self, storage, payload, instclass):
"""
For detailed description of the arguments see
@@ -145,7 +147,7 @@ class TextUserInterface(ui.UserInterface):
os.path.join(path, "hubs"))
for path in pathlist]
}
-
+
def _list_hubs(self):
"""returns the list of hubs to use"""
return [SummaryHub, ProgressHub]
@@ -153,7 +155,7 @@ class TextUserInterface(ui.UserInterface):
def _is_standalone(self, spoke):
"""checks if the passed spoke is standalone"""
return isinstance(spoke, StandaloneSpoke)
-
+
def setup(self, data):
"""Construct all the objects required to implement this interface.
This method must be provided by all subclasses.
@@ -165,7 +167,7 @@ class TextUserInterface(ui.UserInterface):
path = os.path.join(os.path.dirname(__file__), "spokes")
spokes = self._collectActionClasses(self.paths["spokes"], StandaloneSpoke)
actionClasses = self._orderActionClasses(spokes, _hubs)
-
+
for klass in actionClasses:
obj = klass(self._app, data, self.storage, self.payload, self.instclass)
@@ -179,6 +181,8 @@ class TextUserInterface(ui.UserInterface):
if hasattr(obj, "set_path"):
obj.set_path("spokes", self.paths["spokes"])
+ obj.setup(self.ENVIRONMENT)
+
self._app.schedule_screen(obj)
def run(self):
diff --git a/pyanaconda/ui/tui/hubs/__init__.py b/pyanaconda/ui/tui/hubs/__init__.py
index 7d16ff3..73e3e62 100644
--- a/pyanaconda/ui/tui/hubs/__init__.py
+++ b/pyanaconda/ui/tui/hubs/__init__.py
@@ -50,6 +50,7 @@ class TUIHub(TUIObject, common.Hub):
self._keys = {} # holds spokes referenced by their user input key
self._spoke_count = 0
+ def setup(self, environment = "anaconda"):
# look for spokes having category present in self.categories
for c in self.categories:
spokes = collect_spokes(self.paths["spokes"], c)
@@ -57,10 +58,10 @@ class TUIHub(TUIObject, common.Hub):
# sort them according to their priority
for s in sorted(spokes, key = lambda s: s.priority):
# Check if this spoke is to be shown in anaconda
- if not s.should_run("anaconda", self.data):
+ if not s.should_run(environment, self.data):
continue
-
- spoke = s(app, data, storage, payload, instclass)
+
+ spoke = s(self.app, self.data, self.storage, self.payload, self.instclass)
spoke.initialize()
if not spoke.showable:
diff --git a/pyanaconda/ui/tui/simpleline/base.py b/pyanaconda/ui/tui/simpleline/base.py
index 97a8c81..e3039d2 100644
--- a/pyanaconda/ui/tui/simpleline/base.py
+++ b/pyanaconda/ui/tui/simpleline/base.py
@@ -344,6 +344,14 @@ class UIScreen(object):
# list that holds the content to be printed out
self._window = []
+ # index of the page (subset of screen) shown during show_all
+ # indexing starts with 0
+ self._page = 0
+
+ def setup(self, environment):
+ """Do additional setup right before this screen is used."""
+ pass
+
def refresh(self, args = None):
"""Method which prepares the content desired on the screen to self._window.
--
1.7.11.7
11 years, 4 months
[PATCH lorax/F18 and master] Dynamically generate the list of installed platforms for .treeinfo
by d.marlin
From: "d.marlin" <dmarlin(a)redhat.com>
The list of ARM platforms was represented as a static list to be
installed in .treeinfo for Beaker support, but as ARM moves to use
the multiplatform kernel the platform specific kernel images will
no longer be needed. This process is beginning in F18 (3.7 kernel)
with HighBank being the first to use the baseline kernel. Due to
this change, there will be no 'highbank' platform images, but Beaker
tries to import all platforms listed in .treeinfo. To avoid errors,
we should dynamically create the list of ARM plaforms, including
only those that are actually provided.
Signed-off-by: David A. Marlin <dmarlin(a)redhat.com>
---
share/arm.tmpl | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/share/arm.tmpl b/share/arm.tmpl
index fdf5326..a343359 100644
--- a/share/arm.tmpl
+++ b/share/arm.tmpl
@@ -16,21 +16,26 @@ kernelAddress = { 'baseline' : '0x00008000',
'omap' : '0x80008000',
'tegra' : '0x00008000',
}
+
+# keep a comma-delimited list of platforms installed to add to .treeinfo
+platforms = ""
+delimiter = ''
%>
mkdir ${LIVEDIR}
install ${runtime_img} ${LIVEDIR}/squashfs.img
treeinfo stage2 mainimage ${LIVEDIR}/squashfs.img
-# Add platforms to treeinfo for Beaker support.
-treeinfo ${basearch} platforms highbank,imx,mvebu,omap,tegra
-
## install kernels
mkdir ${KERNELDIR}
%for kernel in kernels:
%if kernel.flavor:
installkernel images-${kernel.flavor}-${basearch} ${kernel.path} ${KERNELDIR}/vmlinuz-${kernel.flavor}
installinitrd images-${kernel.flavor}-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd-${kernel.flavor}.img
+<%
+ platforms = platforms + delimiter + kernel.flavor
+ delimiter = ','
+%>
%if doupgrade:
## install upgrade image
@@ -87,6 +92,9 @@ mkdir ${KERNELDIR}
%endif
%endfor
+# add platform to treeinfo for Beaker support
+treeinfo ${basearch} platforms ${platforms}
+
## FIXME: ARM may need some extra boot config
--
1.7.10.2
11 years, 4 months
[PATCH] Display the background gradient image from a map signal handler.
by Chris Lumens
Doing it from the init method means we need to call gtk_widget_realize so all
the gdk and cairo stuff has something to operate on. However, that realize
call screws up glade so that the window gets displayed separately and widgets
cannot be clicked upon.
This reorganization moves the gradient setup to after the widget has been
realized.
---
widgets/src/SpokeWindow.c | 53 +++++++++++++++++++++++++++--------------------
1 file changed, 30 insertions(+), 23 deletions(-)
diff --git a/widgets/src/SpokeWindow.c b/widgets/src/SpokeWindow.c
index 16ce3f8..2874e58 100644
--- a/widgets/src/SpokeWindow.c
+++ b/widgets/src/SpokeWindow.c
@@ -61,6 +61,7 @@ G_DEFINE_TYPE(AnacondaSpokeWindow, anaconda_spoke_window, ANACONDA_TYPE_BASE_WIN
static void anaconda_spoke_window_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static void anaconda_spoke_window_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
+static void anaconda_spoke_window_realize(GtkWidget *widget, gpointer user_data);
static void anaconda_spoke_window_button_clicked(GtkButton *button,
AnacondaSpokeWindow *win);
@@ -124,16 +125,40 @@ GtkWidget *anaconda_spoke_window_new() {
}
static void anaconda_spoke_window_init(AnacondaSpokeWindow *win) {
+ GtkWidget *nav_area;
+
+ win->priv = G_TYPE_INSTANCE_GET_PRIVATE(win,
+ ANACONDA_TYPE_SPOKE_WINDOW,
+ AnacondaSpokeWindowPrivate);
+
+ g_signal_connect(win, "map", G_CALLBACK(anaconda_spoke_window_realize), NULL);
+
+ /* Set some default properties. */
+ gtk_window_set_modal(GTK_WINDOW(win), TRUE);
+
+ /* Create the buttons. */
+ win->priv->button = gtk_button_new_with_mnemonic(DEFAULT_BUTTON_LABEL);
+ gtk_widget_set_halign(win->priv->button, GTK_ALIGN_START);
+
+ /* Hook up some signals for that button. The signal handlers here will
+ * just raise our own custom signals for the whole window.
+ */
+ g_signal_connect(win->priv->button, "clicked",
+ G_CALLBACK(anaconda_spoke_window_button_clicked), win);
+
+ /* And then put the button into the navigation area. */
+ nav_area = anaconda_base_window_get_nav_area(ANACONDA_BASE_WINDOW(win));
+ gtk_grid_attach(GTK_GRID(nav_area), win->priv->button, 0, 1, 1, 1);
+}
+
+static void anaconda_spoke_window_realize(GtkWidget *widget, gpointer user_data) {
GError *error;
- GtkWidget *nav_area, *nav_box;
GdkPixbuf *pixbuf;
cairo_pattern_t *pattern;
cairo_surface_t *surface;
cairo_t *cr;
- win->priv = G_TYPE_INSTANCE_GET_PRIVATE(win,
- ANACONDA_TYPE_SPOKE_WINDOW,
- AnacondaSpokeWindowPrivate);
+ AnacondaSpokeWindow *window = ANACONDA_SPOKE_WINDOW(widget);
/* Set the background gradient in the header. If we fail to load the
* background for any reason, just print an error message and display the
@@ -145,9 +170,8 @@ static void anaconda_spoke_window_init(AnacondaSpokeWindow *win) {
fprintf(stderr, "could not load header background: %s\n", error->message);
g_error_free(error);
} else {
- nav_box = anaconda_base_window_get_nav_area_background_window(ANACONDA_BASE_WINDOW(win));
+ GtkWidget *nav_box = anaconda_base_window_get_nav_area_background_window(ANACONDA_BASE_WINDOW(window));
gtk_widget_set_size_request(nav_box, -1, gdk_pixbuf_get_height (pixbuf));
- gtk_widget_realize(nav_box);
surface = gdk_window_create_similar_surface(gtk_widget_get_window(nav_box), CAIRO_CONTENT_COLOR_ALPHA,
gdk_pixbuf_get_width(pixbuf), gdk_pixbuf_get_height(pixbuf));
@@ -162,23 +186,6 @@ static void anaconda_spoke_window_init(AnacondaSpokeWindow *win) {
cairo_pattern_set_extend(pattern, CAIRO_EXTEND_REPEAT);
gdk_window_set_background_pattern(gtk_widget_get_window(nav_box), pattern);
}
-
- /* Set some default properties. */
- gtk_window_set_modal(GTK_WINDOW(win), TRUE);
-
- /* Create the buttons. */
- win->priv->button = gtk_button_new_with_mnemonic(DEFAULT_BUTTON_LABEL);
- gtk_widget_set_halign(win->priv->button, GTK_ALIGN_START);
-
- /* Hook up some signals for that button. The signal handlers here will
- * just raise our own custom signals for the whole window.
- */
- g_signal_connect(win->priv->button, "clicked",
- G_CALLBACK(anaconda_spoke_window_button_clicked), win);
-
- /* And then put the button into the navigation area. */
- nav_area = anaconda_base_window_get_nav_area(ANACONDA_BASE_WINDOW(win));
- gtk_grid_attach(GTK_GRID(nav_area), win->priv->button, 0, 1, 1, 1);
}
static void anaconda_spoke_window_button_clicked(GtkButton *button,
--
1.7.11.2
11 years, 4 months
[PATCH 1/5] Remove more references to system-config-*.
by Chris Lumens
---
anaconda | 1 -
tests/pylint/runpylint.sh | 5 +----
2 files changed, 1 insertion(+), 5 deletions(-)
diff --git a/anaconda b/anaconda
index f291fb0..0f08db3 100755
--- a/anaconda
+++ b/anaconda
@@ -295,7 +295,6 @@ def parseOptions(argv=None, cmdline=None):
def setupPythonPath():
# First add our updates path
sys.path.insert(0, '/tmp/updates/')
- sys.path.append('/usr/share/system-config-date')
def setupEnvironment():
# Silly GNOME stuff
diff --git a/tests/pylint/runpylint.sh b/tests/pylint/runpylint.sh
index 9b771cd..13ad187 100755
--- a/tests/pylint/runpylint.sh
+++ b/tests/pylint/runpylint.sh
@@ -86,10 +86,7 @@ for i in $(find pyanaconda -type f -name '*py'); do
sys.path.insert(2, "pyanaconda/isys"); \
sys.path.insert(3, "pyanaconda"); \
sys.path.insert(4, "pyanaconda/.libs"); \
- sys.path.insert(5, "pyanaconda/iw"); \
- sys.path.insert(6, "pyanaconda/textw"); \
- sys.path.insert(7, "/usr/share/system-config-date"); \
- sys.path.insert(8, "/usr/share/system-config-keyboard")' \
+ sys.path.insert(6, "pyanaconda/textw")' \
-i y -r n --disable=C,R --rcfile=/dev/null \
$DISABLED_WARN_OPTIONS \
$DISABLED_ERR_OPTIONS \
--
1.7.11.2
11 years, 4 months
[PATCH master] (v2) Take over dhcp connection by NM for network root (eg nfs) (#883451, #893656)
by Radek Vykydal
We need to pass dhcp lease file to NM's dhclient also in case of
kickstart installs. For non-kickstart case, this is done in dracut,
modules.d/45ifcfg/write-ifcfg.sh.
See dracut's commit 66666c670a462548df4ea4c8069d54b8c309ecf4
---
dracut/parse-kickstart | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/dracut/parse-kickstart b/dracut/parse-kickstart
index 333849b..7aeaecd 100755
--- a/dracut/parse-kickstart
+++ b/dracut/parse-kickstart
@@ -13,6 +13,8 @@
import sys, os
import logging
+import shutil
+import uuid
from pykickstart.parser import KickstartParser, preprocessKickstart
from pykickstart.version import returnClassForVersion
from pykickstart.errors import KickstartError
@@ -267,7 +269,8 @@ def ksnet_to_ifcfg(net, filename=None):
os.makedirs("/tmp/ifcfg")
ifcfg['DEVICE'] = dev
ifcfg['HWADDR'] = readsysfile("/sys/class/net/%s/address" % dev)
- ifcfg['UUID'] = readsysfile("/proc/sys/kernel/random/uuid")
+ uuid = str(uuid.uuid4())
+ ifcfg['UUID'] = uuid
# we set real ONBOOT value in anaconda, here
# we use it to activate devcies by NM on start
ifcfg['ONBOOT'] = "yes" if net.activate else "no"
@@ -305,6 +308,15 @@ def ksnet_to_ifcfg(net, filename=None):
# TODO: dhcpclass, ethtool, essid/wepkey/wpakay, etc.
+ if net.bootProto == 'dhcp':
+ srcpath = "/tmp/dhclient.%s.lease" % dev
+ dstdir = "/tmp/ifcfg-leases"
+ dstpath = "%s/dhclient-%s-%s.lease" % (dstdir, uuid, dev)
+ if os.path.exists(srcpath):
+ if not os.path.isdir(dstdir):
+ os.makedirs(dstdir)
+ shutil.copyfile(srcpath, dstpath)
+
try:
log.info("writing ifcfg for %s", dev)
outf = open(filename, "w")
--
1.7.11.7
11 years, 4 months