[PATCH] Fix some introspection warnings
by Stef Walter
Fixes these warnings:
GISCAN AnacondaWidgets-1.0.gir
BaseWindow.c:483: Warning: AnacondaWidgets: missing ':' at column 36:
* anaconda_base_window_retranslate
^
StandaloneWindow.c:198: Warning: AnacondaWidgets: missing ':' at column 42:
* anaconda_standalone_window_retranslate
^
11 years, 7 months
[master] [PATCH] Encode unicode strings from XklWrapper (#873762)
by Vratislav Podzimek
Before concatenating byte string (output from gettext) with unicode
string (from XklWrapper), we have to encode the unicode string as utf-8.
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
pyanaconda/ui/gui/spokes/keyboard.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/spokes/keyboard.py b/pyanaconda/ui/gui/spokes/keyboard.py
index 81d59e2..07548f5 100644
--- a/pyanaconda/ui/gui/spokes/keyboard.py
+++ b/pyanaconda/ui/gui/spokes/keyboard.py
@@ -363,7 +363,8 @@ class KeyboardSpoke(NormalSpoke):
first_option = self.data.keyboard.switch_options[0]
desc = self._xkl_wrapper.switch_to_show_str[first_option]
- self._layoutSwitchLabel.set_text(_(LAYOUT_SWITCHING_INFO) % desc)
+ self._layoutSwitchLabel.set_text(_(LAYOUT_SWITCHING_INFO) % \
+ desc.encode("utf-8"))
else:
self._layoutSwitchLabel.set_text(_("Layout switching not "
"configured."))
--
1.7.11.7
11 years, 7 months
[PATCH master] Network spoke: improve status info (shorten)
by Radek Vykydal
old:
Wireless (wlan0) connected to anaconda_wifi_test4
new:
Wireless connected to anaconda_wifi_test4
old:
Connected devices: eth0, wlan0 (anaconda_wifi_test4)
new:
Connected: eth0, anaconda_wifi_test4
---
pyanaconda/ui/gui/spokes/network.py | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py
index 15aa3bc..db1e5f0 100644
--- a/pyanaconda/ui/gui/spokes/network.py
+++ b/pyanaconda/ui/gui/spokes/network.py
@@ -987,8 +987,8 @@ class NetworkSpoke(NormalSpoke):
if len(ac) == 1:
device, ssid = ac[0]
if ssid:
- msg = _("Wireless (%s) connected to %s" %
- (device, ssid))
+ msg = _("Wireless connected to %s" %
+ ssid)
else:
msg = _("Wired (%s) connected") % device
else:
@@ -996,11 +996,11 @@ class NetworkSpoke(NormalSpoke):
devlist = ", ".join(["%s" % device for device, ssid
in ac
if ssid is None] +
- ["%s (%s)" % (device, ssid) for device, ssid
+ ["%s" % ssid for device, ssid
in ac
if ssid is not None])
- msg = _("Connected devices: %s") % devlist
+ msg = _("Connected: %s") % devlist
else:
msg = _("Not connected")
--
1.7.4
11 years, 7 months
[PATCH 1/2 master] Network spoke: Update status of networking in hub (#868704)
by Radek Vykydal
---
pyanaconda/ui/gui/spokes/network.py | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py
index f8ebcf5..dcee120 100644
--- a/pyanaconda/ui/gui/spokes/network.py
+++ b/pyanaconda/ui/gui/spokes/network.py
@@ -35,7 +35,7 @@
from gi.repository import Gtk, AnacondaWidgets
from pyanaconda.flags import flags
-from pyanaconda.ui.gui import GUIObject
+from pyanaconda.ui.gui import GUIObject, communication
from pyanaconda.ui.gui.spokes import NormalSpoke, StandaloneSpoke
from pyanaconda.ui.gui.categories.software import SoftwareCategory
from pyanaconda.ui.gui.hubs.summary import SummaryHub
@@ -957,6 +957,9 @@ class NetworkSpoke(NormalSpoke):
def __init__(self, *args, **kwargs):
NormalSpoke.__init__(self, *args, **kwargs)
self.network_control_box = NetworkControlBox(self.builder)
+ self.network_control_box.client.connect("notify::%s" %
+ NMClient.CLIENT_STATE, self.on_nm_state_changed)
+
def apply(self):
hostname = self.data.network.hostname
@@ -1016,6 +1019,9 @@ class NetworkSpoke(NormalSpoke):
NormalSpoke.refresh(self)
self.network_control_box.refresh()
+ def on_nm_state_changed(self, *args):
+ communication.send_message(self.__class__.__name__, self.status)
+
class NetworkStandaloneSpoke(StandaloneSpoke):
builderObjects = ["networkStandaloneWindow", "networkControlBox_vbox", "liststore_wireless_network", "liststore_devices"]
mainWidgetName = "networkStandaloneWindow"
--
1.7.4
11 years, 7 months
Churn, baby, churn.
by David Lehman
This set fixes several bugs, and then several more that I hit
while testing the fixes. I spent all day today testing these,
doing as many combinations as I could think of of custom and
automatic partitioning, encrypted and not, btrfs, lvm, md, &c.
I'm getting pretty bored with installing fedora all the time.
11 years, 7 months
[PATCHES] for master
by Chris Lumens
The first sets up some logging for what I believe is a race condition but
haven't been able to fix yet. The last two break a bunch of strings, but
mizmo has been nice enough to go through and update all the translations
manually, so translations should be fine.
- Chris
11 years, 7 months
[master] Use tooltips to show full spokes' statuses
by Vratislav Podzimek
This could be helpful, but I'm not sure we want to use tooltips
for this or for anything else. However they are not used at all now.
Vratislav Podzimek (1):
Set SpokeSelector's tooltip to spoke's status
pyanaconda/ui/gui/hubs/__init__.py | 3 +++
1 file changed, 3 insertions(+)
--
1.7.11.7
11 years, 7 months
[PATCH] Default to LVM on text installs too (#874586).
by Chris Lumens
---
pyanaconda/ui/tui/spokes/storage.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/ui/tui/spokes/storage.py b/pyanaconda/ui/tui/spokes/storage.py
index a8b3d9f..963681a 100644
--- a/pyanaconda/ui/tui/spokes/storage.py
+++ b/pyanaconda/ui/tui/spokes/storage.py
@@ -25,6 +25,7 @@
from pyanaconda.ui.tui.spokes import NormalTUISpoke
from pyanaconda.ui.tui.simpleline import TextWidget, CheckboxWidget
+from pyanaconda.storage import DEVICE_TYPE_LVM
from pyanaconda.storage.size import Size
from pyanaconda.storage.errors import StorageError
from pyanaconda.flags import flags
@@ -233,8 +234,7 @@ class StorageSpoke(NormalTUISpoke):
self.data.ignoredisk.onlyuse = self.selected_disks[:]
self.data.clearpart.drives = self.selected_disks[:]
- # no thanks, lvm
- self.data.autopart.type = AUTOPART_TYPE_PLAIN
+ self.data.autopart.type = DEVICE_TYPE_LVM
if self.autopart:
self.clearPartType = CLEARPART_TYPE_ALL
--
1.7.11.2
11 years, 7 months
[PATCH] check for small grub2 embed space (#737508)
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
Depending on the filesystem choices for stage2 grub2's core.img may be
too large to fit into the area between the mbr and the first partition.
This adds a check that will show an error if the stage2 fs isn't extX
and the first partition starts lower than 512K.
---
pyanaconda/bootloader.py | 41 +++++++++++++++++++++++++++++++++++++++++
pyanaconda/storage/__init__.py | 3 +++
2 files changed, 44 insertions(+)
diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index 8fa3f8b..b556330 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -25,6 +25,7 @@ import sys
import os
import re
import struct
+from parted import PARTITION_BIOS_GRUB
from pyanaconda import iutil
from pyanaconda.storage.devicelibs import mdraid
@@ -728,6 +729,10 @@ class BootLoader(object):
return t
+ def check(self):
+ """ Run additional bootloader checks """
+ return True
+
# pylint: disable-msg=E0102,E0202,E1101
@timeout.setter
def timeout(self, seconds):
@@ -1546,6 +1551,40 @@ class GRUB2(GRUB):
sync()
self.stage2_device.format.sync(root=ROOT_PATH)
+ def check(self):
+ """ When installing to the mbr of a disk grub2 needs enough space
+ before the first partition in order to embed its core.img
+
+ Until we have a way to ask grub2 what the size is we check to make
+ sure it starts >= 512K, otherwise return an error.
+ """
+ ret = True
+ self.errors = []
+ self.warnings = []
+
+ for (stage1dev, stage2dev) in self.install_targets:
+ if stage1dev == stage2dev:
+ continue
+
+ # These are small enough to fit
+ if stage2dev.format.type in ("ext2", "ext3", "ext4") \
+ and stage2dev.type == "partition":
+ continue
+
+ # If the first partition starts too low show an error.
+ parts = stage1dev.format.partedDisk.partitions
+ for p in parts:
+ start = p.geometry.start * p.disk.device.sectorSize
+ if not p.getFlag(PARTITION_BIOS_GRUB) and start < 1024*512:
+ msg = _("%s may not have enough space for grub2 to embed "
+ "core.img when using the %s filesystem on %s") \
+ % (stage1dev.name, stage2dev.format.type, stage2dev.type)
+ log.error(msg)
+ self.errors.append(msg)
+ ret = False
+ break
+ return ret
+
class EFIGRUB(GRUB2):
packages = ["grub2-efi", "efibootmgr", "shim"]
can_dual_boot = False
@@ -1640,6 +1679,8 @@ class EFIGRUB(GRUB2):
self.install()
self.write_config()
+ def check(self):
+ return True
class MacEFIGRUB(EFIGRUB):
def mactel_config(self):
diff --git a/pyanaconda/storage/__init__.py b/pyanaconda/storage/__init__.py
index aec2386..d15e24d 100644
--- a/pyanaconda/storage/__init__.py
+++ b/pyanaconda/storage/__init__.py
@@ -1505,6 +1505,9 @@ class Storage(object):
"please create a 1MB 'BIOS Boot' type "
"partition.") % productName)
+ if not self.bootloader.check():
+ errors.extend(self.bootloader.errors)
+
if not swaps:
from pyanaconda.storage.size import Size
--
1.7.11.7
11 years, 7 months
[PATCH master] Dump default auto connection's ifcfg file instead of writing a new one (#870922)
by Radek Vykydal
The case:
1) Dracut does not use network so it does not write any ifcfg file
(e.g. DVD install)
2) NM creates default auto connection (DHCP) because it can't find
any ifcfg file for a device.
3) Anaconda writes out default ifcfg file (e.g. ifcfg-eth0)
4) When editing a connection in nm-c-e, ifcfg file of edited default
auto connection (Wired connection 1) is created
(ifcfg-Wired_connection_1).
5) If anaconda tweaks any ifcfg file later (setting ONBOOT, NM_CONTROLLED),
it is the ifcfg-eth0.
6) Both ifcfg files are copied to the target system at the end of
installation
Luckily, the ifcfg-Wired_connection_1 seems to be used after installation,
but bug #870922 suggests it might be not so in all cases.
Anyway, we shouldn't create anaconda's ifcfg-ethX default file in this case.
---
pyanaconda/isys/__init__.py | 1 +
pyanaconda/network.py | 40 +++++++++++++++++++++++++++++++++++-----
2 files changed, 36 insertions(+), 5 deletions(-)
diff --git a/pyanaconda/isys/__init__.py b/pyanaconda/isys/__init__.py
index ca72438..f14eab6 100755
--- a/pyanaconda/isys/__init__.py
+++ b/pyanaconda/isys/__init__.py
@@ -48,6 +48,7 @@ log = logging.getLogger("anaconda")
NM_SERVICE = "org.freedesktop.NetworkManager"
NM_MANAGER_PATH = "/org/freedesktop/NetworkManager"
+NM_SETTINGS_PATH = "/org/freedesktop/NetworkManager/Settings"
NM_MANAGER_IFACE = "org.freedesktop.NetworkManager"
NM_ACTIVE_CONNECTION_IFACE = "org.freedesktop.NetworkManager.Connection.Active"
NM_CONNECTION_IFACE = "org.freedesktop.NetworkManager.Settings.Connection"
diff --git a/pyanaconda/network.py b/pyanaconda/network.py
index b4f3b16..dbdf5df 100644
--- a/pyanaconda/network.py
+++ b/pyanaconda/network.py
@@ -419,12 +419,42 @@ class WirelessNetworkDevice(NetworkDevice):
def write(self):
pass
+def get_NM_object(path):
+ return dbus.SystemBus().get_object(isys.NM_SERVICE, path)
+
+# Handle default auto connections created by NM upon start
+# For server, those will be turned off in NetworkManager.conf
def createMissingDefaultIfcfgs():
- for iface in getDevices():
- if not isys.isWirelessDevice(iface):
- device = NetworkDevice(netscriptsDir, iface)
- if not os.access(device.path, os.R_OK):
- device.setDefaultConfig()
+ nm = get_NM_object(isys.NM_MANAGER_PATH)
+ dev_paths = nm.GetDevices()
+ settings = get_NM_object(isys.NM_SETTINGS_PATH)
+ con_paths = settings.ListConnections()
+ for devpath in dev_paths:
+ device = get_NM_object(devpath)
+ device_props_iface = dbus.Interface(device, isys.DBUS_PROPS_IFACE)
+ devicetype = device_props_iface.Get(isys.NM_DEVICE_IFACE, "DeviceType")
+ if devicetype == isys.NM_DEVICE_TYPE_WIFI:
+ continue
+ # if there is no ifcfg file for the device
+ interface = str(device_props_iface.Get(isys.NM_DEVICE_IFACE, "Interface"))
+ device_cfg = NetworkDevice(netscriptsDir, interface)
+ if os.access(device_cfg.path, os.R_OK):
+ continue
+ # check if there is a connection for the device (default autoconnection)
+ hwaddr = device_props_iface.Get(isys.NM_DEVICE_WIRED_IFACE, "HwAddress")
+ for con_path in con_paths:
+ con = get_NM_object(con_path)
+ setting = con.GetSettings()
+ con_hwaddr = ":".join("%02X" % byte for byte in
+ setting['802-3-ethernet']['mac-address'])
+ # if so, write its configuration with name changed to iface
+ if con_hwaddr.upper() == hwaddr.upper():
+ setting['connection']['id'] = interface
+ con.Update(setting)
+ break
+ else:
+ # if there is no connection, create default ifcfg
+ device_cfg.setDefaultConfig()
def getDevices():
# TODO: filter with existence of ifcfg file?
--
1.7.4
11 years, 7 months