From 36104bc1437886afc78e86b070fcfc3ef2da9173 Mon Sep 17 00:00:00 2001 From: Martin Gracik Date: Wed, 31 Mar 2010 17:28:29 +0200 Subject: [PATCH] Fix the modules and firmware symlinks On architectures which have libdir other than lib, we have to create the lib directory in the initrd prior to copying modules and firmware --- src/pylorax/images.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/pylorax/images.py b/src/pylorax/images.py index 209af1e6..e80a8221 100644 --- a/src/pylorax/images.py +++ b/src/pylorax/images.py @@ -126,7 +126,11 @@ export PS1 PATH dst_moddir = os.path.join(self.dsttree, "modules", kernel.version) # create the lib/modules symlink - os.symlink("/modules", os.path.join(self.dsttree, self.const.MODDIR)) + libmod = os.path.join(self.dsttree, self.const.MODDIR) + libmoddir = os.path.dirname(libmod) + if not os.path.isdir(libmoddir): + os.makedirs(libmoddir) + os.symlink("/modules", libmod) # copy all modules to the initrd tree os.makedirs(os.path.dirname(dst_moddir)) @@ -209,7 +213,11 @@ export PS1 PATH shutil.copy2(src, dst) # create the lib/firmware symlink - os.symlink("/firmware", os.path.join(self.dsttree, self.const.FWDIR)) + libfw = os.path.join(self.dsttree, self.const.FWDIR) + libfwdir = os.path.dirname(libfw) + if not os.path.isdir(libfwdir): + os.makedirs(libfwdir) + os.symlink("/firmware", libfw) # copy additional firmware fw = [("ipw2100", "ipw2100*"),