Personal tools
     DOCUMENTATION

Conary:Custom Kernel Packages

From rPath Wiki

Jump to: navigation, search
Conary --> Packaging --> Recipe --> Recipe Templates --> Custom Kernel Packages

Conary packagers can shadow the kernel:source from rPath Linux and modify the kernel.recipe file to create a custom kernel for systems based on rPath Linux. Packagers can modify the package as follows:

  • If kernel.recipe does not have an unpack() definition containing the customizations, create the unpack() definition for the recipe
  • If kernel.recipe does have an existing unpack() definition, modify it to incorporate the customizations

The following example shows how a custom patch should appear in unpack():

 
loadSuperClass('kernelpackage=conary.rpath.com@rpl:devel')
class Kernel(KernelPackageRecipe):
 
    name = 'kernel'
    version = '2.6.15.2'
 
    def unpack(r):
        r.addPatch('my-custom-feature.patch')
Image:Bulbgraph.png   This is not the same as other recipe templates for packages; the recipe "template" is the kernel.recipe file from the shadow of kernel:source.

To use drastically different options, packagers can extensively modify the config.base file in the shadow. However, for a more convenient solution, or to build a kernel specific to a single hardware platform, packagers can choose to construct a new .config file, perhaps based on Conary. To construct this file, use the following process:

  1. Shadow kernel:source=conary.rpath.com@rpl:1, check out the package, and cook it with the --prep option.
  2. Change to the builddir directory and run make menuconfig (or xconfig or gconfig as appropriate) and configure the kernel.
  3. Copy the custom .config file to the kernel source directory as dotconfig and run cvc add dotconfig.
  4. Replace the recipe currently in the directory with the one below, then commit and cook as needed to build the custom kernel package:
 
loadSuperClass('kernelpackage=conary.rpath.com@rpl:devel')
class Kernel(KernelPackageRecipe):
 
    name = 'kernel'
    version = '2.6.15.3'
 
# uncomment the following definition to provide your own
# kernel archive instead of using the upstream archive
#   def unpackBase(r):
#       r.addArchive('localkernelarchive.tar.bz2')
 
    def unpack(r):
        # Add all your patches here.
        #r.addPatch('')
 
        # This is for our special build. Specify dotconfig to
        # be our config, made with menuconfig and the arch we
        # build for (either x86.i686 or x86_64.x86_64).
        r.addSource('dotconfig')
        r.macros.cfgver = 'x86.i686'
 
    def configure(r):
        # We don't want to use any of the rPath Linux
        # configuration settings even though this kernel
        # is roughly based on them.  This config file
        # could be generated by running "make menuconfig"
        # in the unpacked source tree.
        r.Copy('dotconfig', '.config')

Remember to recook any groups as necessary to incorporate the use of a custom kernel package.



From here you may wish to:

Participate in the rPath Community | Contribute to rPath Wiki | Report an issue to rPath