[PATCH master] Network spoke: use chr() instead of str() to convert dbus.Byte (#849395)
by Radek Vykydal
---
pyanaconda/ui/gui/spokes/network.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py
index 9142ad0..d254bf8 100644
--- a/pyanaconda/ui/gui/spokes/network.py
+++ b/pyanaconda/ui/gui/spokes/network.py
@@ -636,7 +636,7 @@ class NetworkControlBox():
config = dbus.SystemBus().get_object(NM_SERVICE, ipv6cfg.get_path())
addr, prefix, gw = getNMObjProperty(config, ".IP6Config",
"Addresses")[0]
- ipv6_addr = socket.inet_ntop(socket.AF_INET6, "".join(str(byte) for byte in addr))
+ ipv6_addr = socket.inet_ntop(socket.AF_INET6, "".join(chr(byte) for byte in addr))
self._set_device_info_value(dt, "ipv6", ipv6_addr)
if ipv4cfg and ipv6_addr:
--
1.7.4
11 years, 9 months
[PATCH 1/2] livemedia-creator: add location option
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
--location specifies an iso directory tree to be used by virt-install
instead of the iso. This allows you to update the initrd in the tree for
debugging.
virt-install uses the images/pxeboot/ directory for initrd.img and
vmlinux.
An iso is still required for the LiveOS/squashfs.img stage2 file.
---
src/sbin/livemedia-creator | 33 +++++++++++++++++++++++++--------
1 file changed, 25 insertions(+), 8 deletions(-)
diff --git a/src/sbin/livemedia-creator b/src/sbin/livemedia-creator
index e781b8e..9344636 100755
--- a/src/sbin/livemedia-creator
+++ b/src/sbin/livemedia-creator
@@ -170,15 +170,27 @@ class IsoMountpoint(object):
vmlinuz and initrd.img files exist
Check the iso for a LiveOS directory and set a flag.
Extract the iso's label.
+
+ initrd_path can be used to point to a boot.iso tree with a newer
+ initrd.img than the iso has. The iso is still used for stage2.
"""
- def __init__( self, iso_path ):
+ def __init__( self, iso_path, initrd_path=None ):
+ """ iso_path is the path to a boot.iso
+ initrd_path overrides mounting the iso for access to
+ initrd and vmlinuz.
+ """
self.label = None
self.iso_path = iso_path
- self.mount_dir = tempfile.mkdtemp()
- if not self.mount_dir:
- raise Exception("Error creating temporary directory")
+ self.initrd_path = initrd_path
- execWithRedirect("mount", ["-o", "loop", self.iso_path, self.mount_dir])
+ if not self.initrd_path:
+ self.mount_dir = tempfile.mkdtemp()
+ if not self.mount_dir:
+ raise Exception("Error creating temporary directory")
+
+ execWithRedirect("mount", ["-o", "loop", self.iso_path, self.mount_dir])
+ else:
+ self.mount_dir = self.initrd_path
self.kernel = self.mount_dir+"/isolinux/vmlinuz"
self.initrd = self.mount_dir+"/isolinux/initrd.img"
@@ -200,8 +212,9 @@ class IsoMountpoint(object):
self.get_iso_label()
def umount( self ):
- execWithRedirect("umount", [self.mount_dir])
- os.rmdir( self.mount_dir )
+ if not self.initrd_path:
+ execWithRedirect("umount", [self.mount_dir])
+ os.rmdir( self.mount_dir )
def get_iso_label( self ):
"""
@@ -580,6 +593,10 @@ if __name__ == '__main__':
parser.add_argument( "--armplatform",
help="the platform to use when creating images for ARM, "
"i.e., highbank, mvebu, omap, tegra, etc." )
+ parser.add_argument( "--location", default=None, type=os.path.abspath,
+ help="location of iso directory tree with initrd.img "
+ "and vmlinuz. Used to run virt-install with a "
+ "newer initrd than the iso." )
parser.add_argument( "--logfile", default="./livemedia.log",
type=os.path.abspath,
@@ -771,7 +788,7 @@ if __name__ == '__main__':
loop_detach(get_loop_name(disk_img))
else:
- iso_mount = IsoMountpoint( opts.iso )
+ iso_mount = IsoMountpoint( opts.iso, opts.location )
log_monitor = LogMonitor( install_log )
kernel_args = ""
--
1.7.11.2
11 years, 9 months
[PATCH] Use chvt command for tty switching
by Vratislav Podzimek
isys.vtActivate is problematic when using tmux, chvt command works
well and we use it so rarely that it should be okay to call an
external command.
---
anaconda | 2 +-
anaconda.spec.in | 1 +
pyanaconda/exception.py | 12 ++++--------
pyanaconda/isys/__init__.py | 5 -----
pyanaconda/isys/isys.c | 15 ---------------
pyanaconda/iutil.py | 22 ++++++++++++++++++++++
6 files changed, 28 insertions(+), 29 deletions(-)
diff --git a/anaconda b/anaconda
index a6bb720..8e67ec5 100755
--- a/anaconda
+++ b/anaconda
@@ -44,7 +44,7 @@ def exitHandler(rebootData, storage, exitCode=None):
anaconda.intf.shutdown()
if "nokill" in flags.cmdline:
- isys.vtActivate(1)
+ iutil.vtActivate(1)
print "anaconda halting due to nokill flag."
print "The system will be rebooted when you press Ctrl-Alt-Delete."
while True:
diff --git a/anaconda.spec.in b/anaconda.spec.in
index 1cc1c41..72a1051 100644
--- a/anaconda.spec.in
+++ b/anaconda.spec.in
@@ -161,6 +161,7 @@ Requires: dhclient
Requires: anaconda-yum-plugins
Requires: libselinux-python >= %{libselinuxver}
Requires: fcoe-utils >= %{fcoeutilsver}
+Requires: kbd
%ifarch %{sparc}
Requires: elftoaout piggyback
%endif
diff --git a/pyanaconda/exception.py b/pyanaconda/exception.py
index 70deed5..b18f228 100644
--- a/pyanaconda/exception.py
+++ b/pyanaconda/exception.py
@@ -23,6 +23,7 @@
from meh.handler import *
from meh.dump import *
import isys
+import iutil
import sys
import os
import shutil
@@ -94,10 +95,7 @@ class AnacondaExceptionHandler(ExceptionHandler):
def runDebug(self, (ty, value, tb)):
# vtActivate does not work on certain ppc64 machines, so just skip
# that and continue with the rest of the debugger setup.
- try:
- isys.vtActivate(1)
- except SystemError:
- pass
+ iutil.vtActivate(1)
pidfl = "/tmp/vncshell.pid"
if os.path.exists(pidfl) and os.path.isfile(pidfl):
@@ -126,10 +124,8 @@ class AnacondaExceptionHandler(ExceptionHandler):
"the main window")
import pdb
pdb.post_mortem (tb)
- try:
- isys.vtActivate(6)
- except SystemError:
- pass
+
+ iutil.vtActivate(6)
def initExceptionHandling(anaconda):
fileList = [ "/tmp/anaconda.log",
diff --git a/pyanaconda/isys/__init__.py b/pyanaconda/isys/__init__.py
index 63edbf6..8195f0d 100755
--- a/pyanaconda/isys/__init__.py
+++ b/pyanaconda/isys/__init__.py
@@ -265,11 +265,6 @@ def driveUsesModule(device, modules):
pass
return rc
-def vtActivate (num):
- if iutil.isS390():
- return
- _isys.vtActivate (num)
-
def isPseudoTTY (fd):
return _isys.isPseudoTTY (fd)
diff --git a/pyanaconda/isys/isys.c b/pyanaconda/isys/isys.c
index 9b9046a..82dc404 100644
--- a/pyanaconda/isys/isys.c
+++ b/pyanaconda/isys/isys.c
@@ -125,7 +125,6 @@ static PyMethodDef isysModuleMethods[] = {
{ "resetresolv", (PyCFunction) doResetResolv, METH_VARARGS, NULL },
{ "swapon", (PyCFunction) doSwapon, METH_VARARGS, NULL },
{ "swapoff", (PyCFunction) doSwapoff, METH_VARARGS, NULL },
- { "vtActivate", (PyCFunction) doVtActivate, METH_VARARGS, NULL},
{ "isPseudoTTY", (PyCFunction) doisPseudoTTY, METH_VARARGS, NULL},
{ "isVioConsole", (PyCFunction) doisVioConsole, METH_NOARGS, NULL},
{ "sync", (PyCFunction) doSync, METH_VARARGS, NULL},
@@ -444,20 +443,6 @@ static PyObject * doEjectCdrom(PyObject * s, PyObject * args) {
return Py_None;
}
-static PyObject * doVtActivate(PyObject * s, PyObject * args) {
- int vtnum;
-
- if (!PyArg_ParseTuple(args, "i", &vtnum)) return NULL;
-
- if (ioctl(0, VT_ACTIVATE, vtnum)) {
- PyErr_SetFromErrno(PyExc_SystemError);
- return NULL;
- }
-
- Py_INCREF(Py_None);
- return Py_None;
-}
-
static PyObject * doisPseudoTTY(PyObject * s, PyObject * args) {
int fd;
struct stat sb;
diff --git a/pyanaconda/iutil.py b/pyanaconda/iutil.py
index fd0b985..f232309 100644
--- a/pyanaconda/iutil.py
+++ b/pyanaconda/iutil.py
@@ -1074,6 +1074,28 @@ def get_option_value(opt_name, options):
if name == opt_name:
return val.strip()
+def vtActivate(num):
+ """
+ Try to switch to tty number $num.
+
+ @type num: int
+ @return: whether the switch was successful or not
+ @rtype: bool
+
+ """
+
+ try:
+ ret = execWithRedirect("chvt", [num], stdout="/dev/tty5",
+ stderr="/dev/tty5")
+ except OSError as oserr:
+ ret = -1
+ log.error("Failed to run chvt: %s", oserr.strerror)
+
+ if ret != 0:
+ log.error("Failed to switch tty to tty%d", num)
+
+ return ret == 0
+
class ProxyStringError(Exception):
pass
--
1.7.11.2
11 years, 9 months
[PATCH] parse-anaconda-net: Add missing semicolon for dhclient.conf
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
---
dracut/parse-anaconda-net.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dracut/parse-anaconda-net.sh b/dracut/parse-anaconda-net.sh
index 683a009..411b1f5 100755
--- a/dracut/parse-anaconda-net.sh
+++ b/dracut/parse-anaconda-net.sh
@@ -51,6 +51,6 @@ fi
# set dhcp vendor class
dhcpclass=$(getarg inst.dhcpclass) || dhcpclass="anaconda-$(uname -srm)"
-echo "send vendor-class-identifier \"$dhcpclass\"" >> /etc/dhclient.conf
+echo "send vendor-class-identifier \"$dhcpclass\";" >> /etc/dhclient.conf
unset CMDLINE
--
1.7.11.2
11 years, 9 months
[PATCH] anaconda-modprobe: fix .ko removal
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
---
dracut/anaconda-modprobe.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dracut/anaconda-modprobe.sh b/dracut/anaconda-modprobe.sh
index 6a6b20d..f8ac2ca 100644
--- a/dracut/anaconda-modprobe.sh
+++ b/dracut/anaconda-modprobe.sh
@@ -14,7 +14,7 @@ for m in $SCSI_MODULES/*.ko; do
# Shell spew to work around not having basename
# Trim the paths off the prefix, then the . suffix
a="${m##*/}"
- MODULE_LIST+=" ${a%*.}"
+ MODULE_LIST+=" ${a%.*}"
done
if [ "$ARCH" != "s390" -a "$ARCH" != "s390x" ]; then
--
1.7.11.2
11 years, 9 months
[PATCH] dracut: fix rd.neednet use in parse-kickstart (#849672)
by Will Woods
rd.neednet is no longer in use by dracut. This is how you tell dracut
"definitely bring up the network interfaces, dammit" now.
Related: 861d6e3fc9d9cd3f719f7e2dbbff31244dc80142
---
dracut/parse-kickstart | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dracut/parse-kickstart b/dracut/parse-kickstart
index daa87cc..55bc43a 100755
--- a/dracut/parse-kickstart
+++ b/dracut/parse-kickstart
@@ -263,7 +263,8 @@ def ksnet_to_dracut(args, lineno, net, bootdev=False):
if bootdev:
if net.device:
line.append("bootdev=%s" % net.device)
- line.append("rd.neednet=1")
+ # touch /tmp/net.ifaces to make sure dracut brings up network
+ open("/tmp/net.ifaces", "a")
if net.essid or net.wepkey or net.wpakey:
# TODO: make dracut support wireless? (do we care?)
--
1.7.11.2
11 years, 9 months
[PATCH] Only devices that already exist may be ISO install sources (#849482).
by Chris Lumens
---
pyanaconda/image.py | 2 +-
pyanaconda/ui/gui/spokes/source.py | 45 ++++++++++++++++++++------------------
2 files changed, 25 insertions(+), 22 deletions(-)
diff --git a/pyanaconda/image.py b/pyanaconda/image.py
index 009e38a..0bc5c99 100644
--- a/pyanaconda/image.py
+++ b/pyanaconda/image.py
@@ -203,7 +203,7 @@ def opticalInstallMedia(devicetree, mountpoint=INSTALL_TREE):
# Return a list of Device instances that may have HDISO install media
# somewhere. Candidate devices are simply any that we can mount.
def potentialHdisoSources(devicetree):
- return filter(lambda d: d.format.mountable, devicetree.getDevicesByType("partition"))
+ return filter(lambda d: d.exists and d.format.mountable, devicetree.getDevicesByType("partition"))
def umountImage(tree):
if os.path.ismount(tree):
diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py
index fd40b5c..b9f544c 100644
--- a/pyanaconda/ui/gui/spokes/source.py
+++ b/pyanaconda/ui/gui/spokes/source.py
@@ -641,27 +641,6 @@ class SourceSpoke(NormalSpoke):
self._autodetectBox.set_no_show_all(False)
self._autodetectButton.set_no_show_all(False)
- # Find all hard drive partitions that could hold an ISO and add each
- # to the diskStore.
- store = self.builder.get_object("partitionStore")
-
- added = False
- active = 0
- idx = 0
- for dev in potentialHdisoSources(self.storage.devicetree):
- store.append([dev, "%s (%s MB)" % (self._sanitize_model(dev.disk.model), int(dev.size))])
- if dev.name == self.data.method.partition:
- active = idx
- added = True
- idx += 1
-
- # Again, only display these widgets if an HDISO source was found.
- if added:
- self._isoBox.set_no_show_all(False)
- self._isoButton.set_no_show_all(False)
- combo = self.builder.get_object("isoPartitionCombo")
- combo.set_active(active)
-
# Add the mirror manager URL in as the default for HTTP and HTTPS.
# We'll override this later in the refresh() method, if they've already
# provided a URL.
@@ -673,6 +652,30 @@ class SourceSpoke(NormalSpoke):
def refresh(self):
NormalSpoke.refresh(self)
+ # Find all hard drive partitions that could hold an ISO and add each
+ # to the partitionStore. This has to be done here because if the user
+ # has done partitioning first, they may have blown away partitions
+ # found during _initialize on the partitioning spoke.
+ store = self.builder.get_object("partitionStore")
+ store.clear()
+
+ added = False
+ active = 0
+ idx = 0
+ for dev in potentialHdisoSources(self.storage.devicetree):
+ store.append([dev, "%s (%s MB)" % (self._sanitize_model(dev.disk.model), int(dev.size))])
+ if dev.name == self.data.method.partition:
+ active = idx
+ added = True
+ idx += 1
+
+ # Again, only display these widgets if an HDISO source was found.
+ if added:
+ self._isoBox.set_no_show_all(False)
+ self._isoButton.set_no_show_all(False)
+ combo = self.builder.get_object("isoPartitionCombo")
+ combo.set_active(active)
+
# We default to the mirror list, and then if the method tells us
# something different later, we can change it.
self._protocolComboBox.set_active(0)
--
1.7.11.2
11 years, 9 months
[PATCH rhel5-branch] Add support for hyperv (VM_BUS) (#824880)
by Radek Vykydal
Related: rhbz#824880
---
loader2/hardware.c | 7 ++++++-
loader2/hardware.h | 2 ++
loader2/loader.c | 1 +
3 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/loader2/hardware.c b/loader2/hardware.c
index 4639ecd..cb83df9 100644
--- a/loader2/hardware.c
+++ b/loader2/hardware.c
@@ -105,7 +105,7 @@ static int detectHardware(moduleInfoSet modInfo, char *** modules) {
BUS_PCI | BUS_SBUS | BUS_VIO | BUS_MACIO |
/* Waiting on kudzu to define BUS_EBUS */
/* BUS_PCMCIA | BUS_XEN | BUS_VIRTIO | BUS_EBUS, */
- BUS_PCMCIA | BUS_XEN | BUS_VIRTIO,
+ BUS_PCMCIA | BUS_XEN | BUS_VIRTIO | BUS_VMBUS,
PROBE_ALL);
logMessage(DEBUGLVL, "finished bus probing");
@@ -308,6 +308,11 @@ void ipv6Setup(moduleList modLoaded, moduleDeps modDeps,
mlLoadModule("ipv6", modLoaded, modDeps, modInfo, NULL);
}
+void hypervBusSetup(moduleList modLoaded, moduleDeps modDeps,
+ moduleInfoSet modInfo)
+{
+ mlLoadModule("hv_vmbus", modLoaded, modDeps, modInfo, NULL);
+}
void scsiSetup(moduleList modLoaded, moduleDeps modDeps,
moduleInfoSet modInfo) {
diff --git a/loader2/hardware.h b/loader2/hardware.h
index 206d7b3..19fc3e6 100644
--- a/loader2/hardware.h
+++ b/loader2/hardware.h
@@ -21,6 +21,8 @@ void dasdSetup(moduleList modLoaded, moduleDeps modDeps,
moduleInfoSet modInfo);
void infinibandSetup(moduleList modLoaded, moduleDeps modDeps,
moduleInfoSet modInfo);
+void hypervBusSetup(moduleList modLoaded, moduleDeps modDeps,
+ moduleInfoSet modInfo);
void ipv6Setup(moduleList modLoaded, moduleDeps modDeps,
moduleInfoSet modInfo);
void spufsSetup(moduleList modLoaded, moduleDeps modDeps,
diff --git a/loader2/loader.c b/loader2/loader.c
index 53a2201..23bfe09 100644
--- a/loader2/loader.c
+++ b/loader2/loader.c
@@ -1617,6 +1617,7 @@ int main(int argc, char ** argv) {
dasdSetup(modLoaded, modDeps, modInfo);
spufsSetup(modLoaded, modDeps, modInfo);
infinibandSetup(modLoaded, modDeps, modInfo);
+ hypervBusSetup(modLoaded, modDeps, modInfo);
/* Note we *always* do this. If you could avoid this you could get
a system w/o USB keyboard support, which would be bad. */
--
1.7.5.1
11 years, 9 months
[python-meh] Patches for F18 TC issues
by Vratislav Podzimek
PATCH 1/3 fixes a bug in the spec file that was probably never hit.
PATCH 2/3 fixes the exception appearing instead of the anaconda object dump in
anaconda-tb files.
PATCH 3/3 adds a property needed in Anaconda (patch follows)
Vratislav Podzimek (3):
Change require from rpm to rpm-python
Don't try to dump objects without __dict__
Add main_window property to the MainExceptionWindow
meh/dump.py | 3 ++-
meh/ui/gui.py | 4 ++++
python-meh.spec | 2 +-
3 files changed, 7 insertions(+), 2 deletions(-)
--
1.7.11.2
11 years, 9 months