Changed the path where we copy modules and firmware

This commit is contained in:
Martin Gracik 2010-03-31 13:19:55 +02:00
parent 8db94b4bc3
commit dfbedd6f0e
2 changed files with 17 additions and 13 deletions

View File

@ -1,7 +1,3 @@
## create modules and firmware symlinks
symlink "lib/modules" "modules"
symlink "lib/firmware" "firmware"
## create required directories ## create required directories
makedirs "sbin" makedirs "sbin"
symlink "sbin" "bin" symlink "sbin" "bin"

View File

@ -123,7 +123,10 @@ export PS1 PATH
def get_kernel_modules(self, kernel, modset): def get_kernel_modules(self, kernel, modset):
moddir = os.path.join(self.const.MODDIR, kernel.version) moddir = os.path.join(self.const.MODDIR, kernel.version)
src_moddir = os.path.join(self.srctree, moddir) src_moddir = os.path.join(self.srctree, moddir)
dst_moddir = os.path.join(self.dsttree, moddir) 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))
# copy all modules to the initrd tree # copy all modules to the initrd tree
os.makedirs(os.path.dirname(dst_moddir)) os.makedirs(os.path.dirname(dst_moddir))
@ -192,19 +195,22 @@ export PS1 PATH
continue continue
for fw in stdout.split(): for fw in stdout.split():
fw = os.path.join(self.const.FWDIR, fw) src = os.path.join(self.srctree,
src = os.path.join(self.srctree, fw) self.const.FWDIR, fw)
if not os.path.exists(src): if not os.path.exists(src):
msg = "missing firmware {0}".format(fw) msg = "missing firmware {0}".format(fw)
self.pwarning(msg) self.pwarning(msg)
continue continue
# copy the firmware # copy the firmware
dst = os.path.join(self.dsttree, fw) dst = os.path.join(self.dsttree, "firmware", fw)
dir = os.path.dirname(dst) dir = os.path.dirname(dst)
makedirs_(dir) makedirs_(dir)
shutil.copy2(src, dst) shutil.copy2(src, dst)
# create the lib/firmware symlink
os.symlink("/firmware", os.path.join(self.dsttree, self.const.FWDIR))
# copy additional firmware # copy additional firmware
fw = [("ipw2100", "ipw2100*"), fw = [("ipw2100", "ipw2100*"),
("ipw2200", "ipw2200*"), ("ipw2200", "ipw2200*"),
@ -219,7 +225,7 @@ export PS1 PATH
scopy_(src_root=self.srctree, scopy_(src_root=self.srctree,
src_path=os.path.join(self.const.FWDIR, fname), src_path=os.path.join(self.const.FWDIR, fname),
dst_root=self.dsttree, dst_root=self.dsttree,
dst_path=self.const.FWDIR) dst_path="firmware")
# XXX # XXX
# remove empty directories # remove empty directories
@ -705,10 +711,12 @@ class Install(BaseImageClass):
shutil.move(f, dstdir) shutil.move(f, dstdir)
def create_modules_symlinks(self): def create_modules_symlinks(self):
remove_(os.path.join(self.srctree, self.const.MODDIR, "*")) mkdir_(os.path.join(self.srctree, "modules"))
remove_(os.path.join(self.srctree, self.const.FWDIR, "*")) mkdir_(os.path.join(self.srctree, "firmware"))
os.symlink(os.path.join(self.srctree, self.const.MODDIR), "/modules") remove_(os.path.join(self.srctree, self.const.MODDIR))
os.symlink(os.path.join(self.srctree, self.const.FWDIR), "/firmware") remove_(os.path.join(self.srctree, self.const.FWDIR))
os.symlink("/modules", os.path.join(self.srctree, self.const.MODDIR))
os.symlink("/firmware", os.path.join(self.srctree, self.const.FWDIR))
def fix_man_pages(self): def fix_man_pages(self):
# fix up some links for man page related stuff # fix up some links for man page related stuff