[master/rhel7] driverdisk: Create a repo for network drivers (#1016004)
by Brian C. Lane
Network downloaded drivers (individual rpms) do not have a repo
associated with them. This copies them over to the target system and
creates a repository for them so that they will be installed.
Resolves: rhbz#1016004
---
dracut/driver-updates | 6 ++----
pyanaconda/packaging/yumpayload.py | 33 +++++++++++++++++++++++++++------
2 files changed, 29 insertions(+), 10 deletions(-)
diff --git a/dracut/driver-updates b/dracut/driver-updates
index ea73981..d6fe92e 100755
--- a/dracut/driver-updates
+++ b/dracut/driver-updates
@@ -542,15 +542,13 @@ def process_dd(dd_path):
map(lambda d: setattr(d, "selected", True), drivers)
# Copy the repository for Anaconda to use during install
- if os.path.isdir(dd_path+"/repodata"):
- copy_repo(dd_path, "/updates/run/install/DD-")
+ copy_repo(dd_path, "/updates/run/install/DD-")
for driver in filter(lambda d: d.selected, drivers):
dd_extract(driver, "/updates/")
# Write the package names for all modules and firmware for Anaconda
- if os.path.isdir(dd_path+"/repodata") \
- and ("modules" in driver.flags or "firmwares" in driver.flags):
+ if "modules" in driver.flags or "firmwares" in driver.flags:
with open("/run/install/dd_packages", "a") as f:
f.write("%s\n" % driver.name)
diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py
index 0d8fad2..d930c02 100644
--- a/pyanaconda/packaging/yumpayload.py
+++ b/pyanaconda/packaging/yumpayload.py
@@ -41,6 +41,7 @@ import os
import shutil
import sys
import time
+from glob import glob
from pyanaconda.iutil import execReadlines
from . import *
@@ -1428,24 +1429,44 @@ reposdir=%s
# packages that were selected is in /run/install/dd_packages
# Add repositories
- dir_num = 1
- repo_template="/run/install/DD-%d/%s/"
+ dir_num = 0
while True:
- repo = repo_template % (dir_num, blivet.arch.getArch())
- if not os.path.isdir(repo+"repodata"):
+ dir_num += 1
+ repo = "/run/install/DD-%d/" % dir_num
+ if not os.path.isdir(repo):
break
+
+ # Drivers are under /<arch>/ or /DD-net/
+ if os.path.isdir(repo+"DD-net"):
+ repo += "DD-net"
+ elif os.path.isdir(repo+blivet.arch.getArch()):
+ repo += blivet.arch.getArch()
+ else:
+ log.debug("No driver repo in %s". repo)
+ continue
+
+ # Run createrepo if there are rpms and no repodata
+ if not os.path.isdir(repo+"/repodata"):
+ rpms = glob(repo+"/*rpm")
+ if not rpms:
+ continue
+ log.info("Running createrepo on %s", repo)
+ iutil.execWithRedirect("createrepo", [repo])
+
ks_repo = self.data.RepoData(name="DD-%d" % dir_num,
baseurl="file://"+repo,
enabled=True)
self.addRepo(ks_repo)
- dir_num += 1
# Add packages
if not os.path.exists("/run/install/dd_packages"):
return
with open("/run/install/dd_packages", "r") as f:
for line in f:
- self._requiredPackages.append(line.strip())
+ package = line.strip()
+ if package not in self._requiredPackages:
+ self._requiredPackages.append(package)
+ log.debug("required packages = %s", self._requiredPackages)
def checkSoftwareSelection(self):
log.info("checking software selection")
--
1.8.5.3
10 years, 2 months
[rhel7] We can't trust rhcrashkernel-param to give us newline-free text.
by Peter Jones
Related: rhbz#814813
Signed-off-by: Peter Jones <pjones(a)redhat.com>
---
pyanaconda/bootloader.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index 24837ae..02ef667 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -943,7 +943,7 @@ class BootLoader(object):
stdin=pread,
root=ROOT_PATH)
os.close(pread)
- self.boot_args.add(buf)
+ self.boot_args.add(buf.replace('\n', ' ')
def write_config(self):
""" Write the bootloader configuration. """
--
1.8.5.3
10 years, 2 months
[blivet:rhel7/master 0/2] Fix problems with what accordion displays (v5)
by Anne Mulhern
Find more used...is just like before.
Lots of work...is a good deal altered from previous version.
David Lehman (1):
Find more used devices when calculating unused devices (#1043763)
mulhern (1):
Lots of work on DeviceTree.hide (#1043763)
blivet/__init__.py | 6 ++--
blivet/devicetree.py | 87 ++++++++++++++++++++++++++++++++--------------------
2 files changed, 58 insertions(+), 35 deletions(-)
--
1.8.3.1
10 years, 2 months
[PATCH rhel7-branch] network: detect also fcoe vlan device names exceeding IFNAMESIZ (#1051268)
by Radek Vykydal
Related: rhbz#1051268
---
pyanaconda/ui/gui/spokes/network.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py
index c7c6ce1..cb0c2d9 100644
--- a/pyanaconda/ui/gui/spokes/network.py
+++ b/pyanaconda/ui/gui/spokes/network.py
@@ -656,7 +656,8 @@ class NetworkControlBox(GObject.GObject):
if device.get_device_type() not in self.supported_device_types:
return
# ignore fcoe vlan devices
- if device.get_iface().endswith('fcoe'):
+ # (can be chopped off to IFNAMSIZ kernel limit)
+ if device.get_iface().endswith(('-fcoe', '-fco', '-fc', '-f', '-')):
return
try:
--
1.7.11.7
10 years, 2 months
[PATCH rhel7-branch] Add support for kickstart --interfacename for vlans (#1061646)
by Radek Vykydal
Resolves: rhbz#1061646
Default iface name in the form of <PARENT>.<VLANID> can hit kernel limit
on lenghth of interface name (15 chars), so offer an option to choose
another vlan name.
---
dracut/parse-kickstart | 4 ++--
pyanaconda/kickstart.py | 2 +-
pyanaconda/network.py | 12 ++++++++----
pyanaconda/ui/gui/spokes/network.py | 1 +
4 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/dracut/parse-kickstart b/dracut/parse-kickstart
index 044dce9..2c70078 100755
--- a/dracut/parse-kickstart
+++ b/dracut/parse-kickstart
@@ -109,7 +109,7 @@ class DriverDisk(commands.driverdisk.F14_DriverDisk):
# are processed later.
return "\n".join(dd_net)
-class Network(commands.network.F20_Network):
+class Network(commands.network.RHEL7_Network):
def dracut_args(self, args, lineno, net):
'''
NOTE: The first 'network' line get special treatment:
@@ -440,7 +440,7 @@ def ksnet_to_ifcfg(net, filename=None):
write_ifcfg(slave_filename, slave_ifcfg)
if net.vlanid:
- interface_name = "%s.%s" % (dev, net.vlanid)
+ interface_name = net.interfacename or "%s.%s" % (dev, net.vlanid)
ifcfg.pop('HWADDR')
ifcfg['TYPE'] = "Vlan"
ifcfg['VLAN'] = "yes"
diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index 4adf22e..bfaa276 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -891,7 +891,7 @@ class Logging(commands.logging.FC6_Logging):
remote_server = "%s:%s" %(self.host, self.port)
logger.updateRemote(remote_server)
-class Network(commands.network.F20_Network):
+class Network(commands.network.RHEL7_Network):
def execute(self, storage, ksdata, instClass):
network.write_network_config(storage, ksdata, instClass, ROOT_PATH)
diff --git a/pyanaconda/network.py b/pyanaconda/network.py
index 5db32ab..1b74fb3 100644
--- a/pyanaconda/network.py
+++ b/pyanaconda/network.py
@@ -524,8 +524,7 @@ def add_connection_for_ksdata(networkdata, devname):
dev_spec = None
# type "vlan"
elif networkdata.vlanid:
- parent, _sep, _vlanid = devname.partition(".")
- values.append(['vlan', 'parent', parent, 's'])
+ values.append(['vlan', 'parent', networkdata.parent, 's'])
values.append(['connection', 'type', 'vlan', 's'])
values.append(['connection', 'id', devname, 's'])
values.append(['vlan', 'interface-name', devname, 's'])
@@ -582,7 +581,8 @@ def ksdata_from_ifcfg(devname, uuid=None):
elif nm.nm_device_type_is_team(devname):
nd.device = devname
elif nm.nm_device_type_is_vlan(devname):
- nd.device = devname.split(".")[0]
+ if devname != default_ks_vlan_interface_name(nd.device, nd.vlanid):
+ nd.interfacename = devname
return nd
@@ -1097,7 +1097,8 @@ def get_device_name(network_data):
if not any((network_data.vlanid, network_data.bondslaves, network_data.teamslaves)):
return ""
if network_data.vlanid:
- dev_name = "%s.%s" % (dev_name, network_data.vlanid)
+ network_data.parent = dev_name
+ dev_name = network_data.interfacename or default_ks_vlan_interface_name(network_data.parent, network_data.vlanid)
return dev_name
@@ -1281,3 +1282,6 @@ def status_message():
msg = _("No network devices available")
return msg
+
+def default_ks_vlan_interface_name(parent, vlanid):
+ return "%s.%s" % (parent, vlanid)
diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py
index c7c6ce1..8e582a1 100644
--- a/pyanaconda/ui/gui/spokes/network.py
+++ b/pyanaconda/ui/gui/spokes/network.py
@@ -858,6 +858,7 @@ class NetworkControlBox(GObject.GObject):
vlanid = dev_cfg.setting_value("vlan", "id")
parent = dev_cfg.setting_value("vlan", "parent")
self._set_device_info_value("wired", "vlanid", str(vlanid))
+ self._set_device_info_value("wired", "parent", parent)
def _refresh_speed_hwaddr(self, dev_cfg, state=None):
dev_type = dev_cfg.device_type
--
1.7.11.7
10 years, 2 months
[PATCH rhel7-branch] Don't require network in standalone spoke for media installs (#1066807)
by Radek Vykydal
Resolves: rhbz#1066807
---
pyanaconda/ui/gui/spokes/network.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py
index 96a1bc5..d4f4faa 100644
--- a/pyanaconda/ui/gui/spokes/network.py
+++ b/pyanaconda/ui/gui/spokes/network.py
@@ -1431,7 +1431,8 @@ class NetworkStandaloneSpoke(StandaloneSpoke):
@property
def completed(self):
return (not flags.can_touch_runtime_system("require network connection")
- or nm.nm_activated_devices())
+ or nm.nm_activated_devices()
+ or self.data.method.method not in ("url", "nfs"))
def initialize(self):
register_secret_agent(self)
--
1.7.11.7
10 years, 2 months
[blivet/rhel7-branch] fix RAID+LVM metadata extents inconsistencies
by Vratislav Podzimek
The following patch tries to fix the inconsistencies with reserved extents for
metadata when creating LVM on top of RAID. The code deserves some more drastic
changes, but we are not in a development phase for such changes now so this
tries to add minimal risk while fixing the issue.
Vratislav Podzimek (1):
Count with the extra metadata extents for RAID consistently (#1065737)
blivet/devicefactory.py | 9 ++++++++-
blivet/devices.py | 10 ++++++++++
2 files changed, 18 insertions(+), 1 deletion(-)
--
1.8.5.3
10 years, 2 months
[PATCH] DNFPayload: display the download progress on the hub.
by Ales Kozumplik
From: Ales Kozumplik <ales(a)redhat.com>
---
anaconda.spec.in | 2 +-
pyanaconda/packaging/dnfpayload.py | 62 ++++++++++++++++++++++++++++++++++++--
2 files changed, 60 insertions(+), 4 deletions(-)
diff --git a/anaconda.spec.in b/anaconda.spec.in
index 7215e32..b648831 100755
--- a/anaconda.spec.in
+++ b/anaconda.spec.in
@@ -23,7 +23,7 @@ Source0: %{name}-%{version}.tar.bz2
%define intltoolver 0.31.2-3
%define pykickstartver 1.99.46
%define yumver 3.4.3-91
-%define dnfver 0.4.14
+%define dnfver 0.4.15
%define partedver 1.8.1
%define pypartedver 2.5-2
%define pythonpyblockver 0.45
diff --git a/pyanaconda/packaging/dnfpayload.py b/pyanaconda/packaging/dnfpayload.py
index ecf7bb1..b2382de 100644
--- a/pyanaconda/packaging/dnfpayload.py
+++ b/pyanaconda/packaging/dnfpayload.py
@@ -25,6 +25,7 @@ from pyanaconda.flags import flags
from pyanaconda.i18n import _
from pyanaconda.progress import progressQ
+import collections
import itertools
import logging
import multiprocessing
@@ -41,7 +42,7 @@ try:
import dnf
import dnf.exceptions
import dnf.repo
- import dnf.output
+ import dnf.callback
import rpm
except ImportError as e:
log.error("dnfpayload: component import failed: %s", e)
@@ -102,7 +103,7 @@ def _pick_mpoint(df, requested):
return sorted(sufficients.iteritems(), key=operator.itemgetter(1),
reverse=True)[0][0]
-class PayloadRPMDisplay(dnf.output.LoggingTransactionDisplay):
+class PayloadRPMDisplay(dnf.callback.LoggingTransactionDisplay):
def __init__(self, queue):
super(PayloadRPMDisplay, self).__init__()
self._queue = queue
@@ -123,6 +124,53 @@ class PayloadRPMDisplay(dnf.output.LoggingTransactionDisplay):
elif action == self.TRANS_POST:
self._queue.put(('post', None))
+class DownloadProgress(dnf.callback.DownloadProgress):
+ def __init__(self):
+ self.downloads = collections.defaultdict(int)
+ self.last_time = time.time()
+ self.total_files = 0
+ self.total_size = Size(0)
+
+ def _paced(fn):
+ """Execute `fn` no more often then every 2 seconds."""
+ def paced_fn(self, *args):
+ now = time.time()
+ if now - self.last_time < 2:
+ return
+ self.last_time = now
+ return fn(self, *args)
+ return paced_fn
+
+ @_paced
+ def _update(self):
+ msg = _('Downloading %(total_files)s RPMs, '
+ '%(downloaded)s / %(total_size)s (%(percent)d%%) done.')
+ downloaded = Size(sum(self.downloads.values()))
+ vals = {
+ 'downloaded' : downloaded,
+ 'percent' : int(100 * downloaded/self.total_size),
+ 'total_files' : self.total_files,
+ 'total_size' : self.total_size
+ }
+ progressQ.send_message(msg % vals)
+
+ def end(self, payload, status, err_msg):
+ nevra = str(payload)
+ if status is dnf.callback.STATUS_OK:
+ self.downloads[nevra] = payload.download_size
+ self._update()
+ return
+ log.critical("Failed to download '%s': %d - %s", nevra, status, err_msg)
+
+ def progress(self, payload, done):
+ nevra = str(payload)
+ self.downloads[nevra] = done
+ self._update()
+
+ def start(self, total_files, total_size):
+ self.total_files = total_files
+ self.total_size = Size(total_size)
+
def do_transaction(base, queue):
try:
display = PayloadRPMDisplay(queue)
@@ -419,7 +467,15 @@ class DNFPayload(packaging.PackagePayload):
pkgs_to_download = self._base.transaction.install_set
log.info('Downloading pacakges.')
progressQ.send_message(_('Downloading packages'))
- self._base.download_packages(pkgs_to_download)
+ progress = DownloadProgress()
+ try:
+ self._base.download_packages(pkgs_to_download, progress)
+ except dnf.exception.DownloadError as e:
+ msg = 'Failed to download the following packages: %s' % str(e)
+ exc = packaging.PayloadInstallError(msg)
+ if errors.errorHandler.cb(exc) == errors.ERROR_RAISE:
+ _failure_limbo()
+
log.info('Downloading packages finished.')
pre_msg = _("Preparing transaction from installation source")
--
1.8.5.3
10 years, 2 months
[master/rhel7] Ensure media being verified is always unmounted
by David Shea
Exceptions raised in verifyMedia could cause rmdir to be called on the
temporary mountpoint before the media is unmounted, causing another
error.
Resolves: rhbz#1050943
---
pyanaconda/image.py | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/pyanaconda/image.py b/pyanaconda/image.py
index 3c154d3..159583f 100644
--- a/pyanaconda/image.py
+++ b/pyanaconda/image.py
@@ -209,11 +209,14 @@ def opticalInstallMedia(devicetree):
except FSError:
continue
- if not verifyMedia(mountpoint):
- dev.format.unmount()
- continue
+ try:
+ if not verifyMedia(mountpoint):
+ dev.format.unmount()
+ continue
- dev.format.unmount()
+ dev.format.unmount()
+ finally:
+ dev.format.unmount()
finally:
os.rmdir(mountpoint)
--
1.8.5.3
10 years, 2 months