From fb49a5e153e5ea71e2f7cf538a39a5b7a0f3ce5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ozan=20=C3=87a=C4=9Flayan?= Date: Tue, 21 Dec 2010 18:44:03 +0000 Subject: [PATCH] actionsapi/kerneltools: Don't install kernel sources, it's useless --- pisi/actionsapi/kerneltools.py | 49 ++++++++++++---------------------- 1 file changed, 17 insertions(+), 32 deletions(-) diff --git a/pisi/actionsapi/kerneltools.py b/pisi/actionsapi/kerneltools.py index 03731a35..2beda419 100644 --- a/pisi/actionsapi/kerneltools.py +++ b/pisi/actionsapi/kerneltools.py @@ -169,21 +169,23 @@ def install(): # Install kernel image pisitools.insinto("/boot/", "arch/x86/boot/bzImage", "kernel-%s" % suffix) - # Check if loadable module support is available or not before doing module specific tasks - if re.search("CONFIG_MODULES=y", open(".config", "r").read().strip()): + # Install the modules + # mod-fw= avoids firmwares from installing + autotools.rawInstall("INSTALL_MOD_PATH=%s/" % get.installDIR(), + "modules_install mod-fw=") - # Install the modules - # mod-fw= avoids firmwares from installing - autotools.rawInstall("INSTALL_MOD_PATH=%s/" % get.installDIR(), - "modules_install mod-fw=") + # Remove symlinks first + pisitools.remove("/lib/modules/%s/source" % suffix) + pisitools.remove("/lib/modules/%s/build" % suffix) - # Install Module.symvers and System.map - pisitools.insinto("/lib/modules/%s/" % suffix, "System.map") - pisitools.insinto("/lib/modules/%s/" % suffix, "Module.symvers") + # Create correct ones + pisitools.dodir("/lib/modules/%s/build" % suffix) + pisitools.dosym("/lib/modules/%s/build" % suffix, + "/lib/modules/%s/source" % suffix) - # Remove wrong symlinks - pisitools.remove("/lib/modules/%s/source" % suffix) - pisitools.remove("/lib/modules/%s/build" % suffix) + # Create extra/ and updates/ subdirectories + for _dir in ("extra", "updates"): + pisitools.dodir("/lib/modules/%s/%s" % (suffix, _dir)) def installHeaders(extra=[]): @@ -220,14 +222,15 @@ def installHeaders(extra=[]): xargs -n1 -i: find : -type f) | \ cpio -pd --preserve-modification-time %s" % destination) - # Copy Modules.symvers + # Copy Modules.symvers and System.map shutil.copy("Module.symvers", "%s/" % destination) + shutil.copy("System.map", "%s/" % destination) # Copy .config file which will be needed by some external modules shutil.copy(".config", "%s/" % destination) # Unset CONFIG_DEBUG_INFO if it's set in the kernel configuration - pisitools.dosed(".config", ".*CONFIG_DEBUG_INFO=.*", "# CONFIG_DEBUG_INFO is not set") + # pisitools.dosed(".config", ".*CONFIG_DEBUG_INFO=.*", "# CONFIG_DEBUG_INFO is not set") # Settle the correct build symlink to this headers pisitools.dosym("/%s" % headersDirectoryName, "/lib/modules/%s/build" % suffix) @@ -269,24 +272,6 @@ def installLibcHeaders(excludes=[]): shelltools.system("rm -rf %s" % headers_tmp) -def installSource(onlySymlink=False): - destination = "usr/src/linux-source-%s" % __getSuffix() - - # Create the symlink - pisitools.dosym("/%s" % destination, "/lib/modules/%s/source" % __getSuffix()) - - if not onlySymlink: - # Copy the whole source directory - pisitools.dodir("/usr/src") - shelltools.copytree("../%s/" % os.path.basename(get.curDIR()), os.path.join(get.installDIR(), destination)) - - # Cleanup the installed source - shelltools.cd(os.path.join(get.installDIR(), destination)) - autotools.make("clean") - autotools.make("modules_prepare") - shelltools.system("find . -path './.*' | xargs rm -rf") - - def cleanModuleFiles(): """ Cleans module.* files generated by depmod """ # Remove modules.* files, they will be autogenerated during pakhandler.