Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 838536 Details for
Bug 1043372
Could not copy firmware file /tmp/DD/lib/firmware/updates: Is a directory
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch
0001-Copy-firmware-updates-to-rootPath-1043372.patch (text/plain), 7.21 KB, created by
Brian Lane
on 2013-12-18 19:04:48 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Brian Lane
Created:
2013-12-18 19:04:48 UTC
Size:
7.21 KB
patch
obsolete
>From fde32723f62ecbfbcf1f49688b3ef196d34ee5d9 Mon Sep 17 00:00:00 2001 >From: "Brian C. Lane" <bcl@redhat.com> >Date: Tue, 17 Dec 2013 12:16:34 -0800 >Subject: [PATCH] Copy firmware updates to rootPath (#1043372) > >This moves copytree from livecd to iutil so that copyFirmware can use it >to copy the whole DD_FIRMWARE tree over to /lib/firmware/ > >Resolves: rhbz#1043372 >--- > backend.py | 16 +++++++++------- > iutil.py | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > livecd.py | 64 +------------------------------------------------------------- > 3 files changed, 72 insertions(+), 70 deletions(-) > >diff --git a/backend.py b/backend.py >index 55ebff4..7b73c71 100644 >--- a/backend.py >+++ b/backend.py >@@ -72,13 +72,15 @@ class AnacondaBackend: > self.initLog(anaconda.id, anaconda.rootPath) > > def copyFirmware(self, anaconda): >- # Multiple driver disks may be loaded, so we need to glob for all >- # the firmware files in the common DD firmware directory >- for f in glob.glob(DD_FIRMWARE+"/*"): >- try: >- shutil.copyfile(f, "%s/lib/firmware/" % anaconda.rootPath) >- except IOError, e: >- log.error("Could not copy firmware file %s: %s" % (f, e.strerror)) >+ if not os.path.isdir(DD_FIRMWARE): >+ return >+ >+ # Multiple driver disks may be loaded, and there may also be >+ # firmware updates, so recursively copy the firmware directory over >+ try: >+ iutil.copytree(DD_FIRMWARE, anaconda.rootPath+"/lib/firmware/") >+ except iutil.Error, e: >+ log.errors("Error copying %s: %s" % (DD_FIRMWARE, e.strerror)) > > def doPostInstall(self, anaconda): > >diff --git a/iutil.py b/iutil.py >index f837f7a..53473df 100644 >--- a/iutil.py >+++ b/iutil.py >@@ -32,6 +32,7 @@ from flags import flags > from constants import * > import re > import threading >+import selinux > > import gettext > _ = lambda x: gettext.ldgettext("anaconda", x) >@@ -991,3 +992,64 @@ def lsmod(): > with open("/proc/modules") as f: > lines = f.readlines() > return [l.split()[0] for l in lines] >+ >+class Error(EnvironmentError): >+ pass >+ >+def copytree(src, dst, symlinks=False, preserveOwner=False, >+ preserveSelinux=False): >+ def tryChown(src, dest): >+ try: >+ os.chown(dest, os.stat(src)[stat.ST_UID], os.stat(src)[stat.ST_GID]) >+ except OverflowError: >+ log.error("Could not set owner and group on file %s" % dest) >+ >+ def trySetfilecon(src, dest): >+ try: >+ selinux.lsetfilecon(dest, selinux.lgetfilecon(src)[1]) >+ except: >+ log.error("Could not set selinux context on file %s" % dest) >+ >+ # copy of shutil.copytree which doesn't require dst to not exist >+ # and which also has options to preserve the owner and selinux contexts >+ names = os.listdir(src) >+ if not os.path.isdir(dst): >+ os.makedirs(dst) >+ errors = [] >+ for name in names: >+ srcname = os.path.join(src, name) >+ dstname = os.path.join(dst, name) >+ try: >+ if symlinks and os.path.islink(srcname): >+ linkto = os.readlink(srcname) >+ os.symlink(linkto, dstname) >+ if preserveSelinux: >+ trySetfilecon(srcname, dstname) >+ elif os.path.isdir(srcname): >+ copytree(srcname, dstname, symlinks, preserveOwner, preserveSelinux) >+ else: >+ shutil.copyfile(srcname, dstname) >+ if preserveOwner: >+ tryChown(srcname, dstname) >+ >+ if preserveSelinux: >+ trySetfilecon(srcname, dstname) >+ >+ shutil.copystat(srcname, dstname) >+ except (IOError, os.error), why: >+ errors.append((srcname, dstname, str(why))) >+ # catch the Error from the recursive copytree so that we can >+ # continue with other files >+ except Error, err: >+ errors.extend(err.args[0]) >+ try: >+ if preserveOwner: >+ tryChown(src, dst) >+ if preserveSelinux: >+ trySetfilecon(src, dst) >+ >+ shutil.copystat(src, dst) >+ except OSError as e: >+ errors.extend((src, dst, e.strerror)) >+ if errors: >+ raise Error, errors >diff --git a/livecd.py b/livecd.py >index fd1ff48..340bcce 100644 >--- a/livecd.py >+++ b/livecd.py >@@ -31,8 +31,6 @@ import time > import subprocess > import storage > >-import selinux >- > from flags import flags > from constants import * > >@@ -48,66 +46,6 @@ import packages > import logging > log = logging.getLogger("anaconda") > >-class Error(EnvironmentError): >- pass >-def copytree(src, dst, symlinks=False, preserveOwner=False, >- preserveSelinux=False): >- def tryChown(src, dest): >- try: >- os.chown(dest, os.stat(src)[stat.ST_UID], os.stat(src)[stat.ST_GID]) >- except OverflowError: >- log.error("Could not set owner and group on file %s" % dest) >- >- def trySetfilecon(src, dest): >- try: >- selinux.lsetfilecon(dest, selinux.lgetfilecon(src)[1]) >- except: >- log.error("Could not set selinux context on file %s" % dest) >- >- # copy of shutil.copytree which doesn't require dst to not exist >- # and which also has options to preserve the owner and selinux contexts >- names = os.listdir(src) >- if not os.path.isdir(dst): >- os.makedirs(dst) >- errors = [] >- for name in names: >- srcname = os.path.join(src, name) >- dstname = os.path.join(dst, name) >- try: >- if symlinks and os.path.islink(srcname): >- linkto = os.readlink(srcname) >- os.symlink(linkto, dstname) >- if preserveSelinux: >- trySetfilecon(srcname, dstname) >- elif os.path.isdir(srcname): >- copytree(srcname, dstname, symlinks, preserveOwner, preserveSelinux) >- else: >- shutil.copyfile(srcname, dstname) >- if preserveOwner: >- tryChown(srcname, dstname) >- >- if preserveSelinux: >- trySetfilecon(srcname, dstname) >- >- shutil.copystat(srcname, dstname) >- except (IOError, os.error), why: >- errors.append((srcname, dstname, str(why))) >- # catch the Error from the recursive copytree so that we can >- # continue with other files >- except Error, err: >- errors.extend(err.args[0]) >- try: >- if preserveOwner: >- tryChown(src, dst) >- if preserveSelinux: >- trySetfilecon(src, dst) >- >- shutil.copystat(src, dst) >- except OSError as e: >- errors.extend((src, dst, e.strerror)) >- if errors: >- raise Error, errors >- > class LiveCDCopyBackend(backend.AnacondaBackend): > def __init__(self, anaconda): > backend.AnacondaBackend.__init__(self, anaconda) >@@ -304,7 +242,7 @@ class LiveCDCopyBackend(backend.AnacondaBackend): > # nothing to move > continue > >- copytree("%s/%s" % (anaconda.rootPath, tocopy), >+ iutil.copytree("%s/%s" % (anaconda.rootPath, tocopy), > "%s/mnt/%s" % (anaconda.rootPath, tocopy), > True, True, flags.selinux) > wait.refresh() >-- >1.8.3.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1043372
:
837117
|
837118
|
837119
| 838536