Add more stuff

This commit is contained in:
Ozan Çağlayan
2009-04-09 08:03:09 +00:00
parent 8d3a63d716
commit 92578778e1
+55 -19
View File
@@ -27,6 +27,9 @@ import pisi.actionsapi.autotools as autotools
import pisi.actionsapi.pisitools as pisitools import pisi.actionsapi.pisitools as pisitools
import pisi.actionsapi.shelltools as shelltools import pisi.actionsapi.shelltools as shelltools
# Internal helpers for versioning stuff
def __getFlavour(): def __getFlavour():
flavour = "" flavour = ""
try: try:
@@ -36,6 +39,12 @@ def __getFlavour():
return flavour return flavour
def __getSuffix():
# Set suffix, e.g. "2.6.29_rc8-default"
suffix = "%s-%s" % (get.srcVERSION(), get.srcRELEASE())
if __getFlavour():
suffix += "-%s" % __getFlavour()
def __getExtraVersion(): def __getExtraVersion():
extraversion = "" extraversion = ""
try: try:
@@ -55,6 +64,12 @@ def __getExtraVersion():
return extraversion return extraversion
def __getHeadersDirectoryName():
return "usr/src/linux-headers-%s" % __getSuffix()
# Public callables
def configure(): def configure():
# Set EXTRAVERSION # Set EXTRAVERSION
extraversion = __getExtraVersion() extraversion = __getExtraVersion()
@@ -76,34 +91,42 @@ def build():
autotools.make() autotools.make()
def install(): def install():
# Set suffix, e.g. "2.6.29_rc8-default" suffix = __getSuffix()
suffix = "%s-%s" % (get.srcVERSION(), get.srcRELEASE())
if __getFlavour():
suffix += "-%s" % __getFlavour()
# Install the modules into /lib/modules # Check if loadable module support is available or not before doing module specific tasks
autotools.rawInstall("INSTALL_MOD_PATH=%s/" % get.installDIR(), if re.search("CONFIG_MODULES=y", open(".config", "r").read().strip()):
"modules_install")
# Install bzImage, symvers and System.map # Install the modules into /lib/modules
pisitools.insinto("/lib/modules/%s/" % suffix, "System.map") autotools.rawInstall("INSTALL_MOD_PATH=%s/" % get.installDIR(),
pisitools.insinto("/lib/modules/%s/" % suffix, "Module.symvers") "modules_install")
# Install Module.symvers and System.map
pisitools.insinto("/lib/modules/%s/" % suffix, "System.map")
pisitools.insinto("/lib/modules/%s/" % suffix, "Module.symvers")
# Remove wrong symlinks
pisitools.remove("/lib/modules/%s/source" % suffix)
pisitools.remove("/lib/modules/%s/build" % suffix)
# Remove modules.* files, they will autogenerated on next boot
# TODO: Ubuntu doesn't remove modules.order, reinvestigate.
pisitools.remove("/lib/modules/%s/modules.*" % suffix)
# Install kernel image
# TODO: For supporting more architectures in the future, we'll need a more
# flexible method here instead of hardcoding x86.
pisitools.insinto("/boot/", "arch/x86/boot/bzImage", "kernel-%s" % suffix) pisitools.insinto("/boot/", "arch/x86/boot/bzImage", "kernel-%s" % suffix)
# Remove wrong symlinks
pisitools.remove("/lib/modules/%s/source" % suffix)
pisitools.remove("/lib/modules/%s/build" % suffix)
# Remove modules.* files, they will autogenerated on next boot
# TODO: Ubuntu doesn't remove modules.order, reinvestigate.
pisitools.remove("/lib/modules/%s/modules.*" % suffix)
def installHeaders(extra=[]): def installHeaders(extra=[]):
""" Install the files needed to build out-of-tree kernel modules. """ """ Install the files needed to build out-of-tree kernel modules. """
pruned = ["include", "scripts"] pruned = ["include", "scripts"]
wanted = ["Makefile*", "Kconfig*", "Kbuild*", "*.sh", "*.pl", "*.lds"] wanted = ["Makefile*", "Kconfig*", "Kbuild*", "*.sh", "*.pl", "*.lds"]
destination = "%s/usr/src/linux-headers-%s" % (get.installDIR(), suffix) # Get the destination directory for header installation
destination = os.path.join(get.installDIR(), __getHeadersDirectoryName())
shelltools.makedirs(destination) shelltools.makedirs(destination)
# First create the skel # First create the skel
@@ -127,8 +150,21 @@ def installHeaders(extra=[]):
xargs -n1 -i: find : -type f) | \ xargs -n1 -i: find : -type f) | \
cpio -pd --preserve-modification-time %s" % destination) cpio -pd --preserve-modification-time %s" % destination)
# Settle the correct build symlink to this headers
pisitools.dosym("/%s" % __getHeadersDirectoryName(),
"/lib/modules/%s/build" % suffix)
def installSource(): def installSource():
pass destination = "usr/src/linux-source-%s" % __getSuffix()
pisitools.dodir("/usr/src")
shelltools.copytree("../%s/" % WorkDir, 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")
def installDocumentation(): def installDocumentation():
pass pass