On Tue, 2013-12-17 at 14:58 -0800, Brian C. Lane wrote:
From: "Brian C. Lane" <bcl(a)redhat.com>
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))
I believe you don't have to use strerror, %s should take care of that.
Otherwise this looks good to me, but you'd have to hold off pushing it
to the rhel6-branch for now, I guess.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic