Bering-uClibc 7.x - Developer Guide - Adding a Kernel Architecture Variant
|Adding a Kernel Architecture Variant|
|Prev||Bering-uClibc 7.x - Developer Guide||Next|
Bering-uClibc 3.x was built for a single "lowest common denominator" platform - a generic i486 CPU. This offered maximum flexibility but meant that it was not possible to include optimisations for more recent CPU models, which is becoming more of a problem as the i486 gets older and less common.
For Bering-uClibc 4.x and later this approach has changed and a small number of different CPU platform variants are supported as standard. Specific kernels and kernel Modules are built for all of the supported variants and distributed via disk Image variants for each platform.
This page outlines the procedure for adding a new CPU variant to the standard list.
Add the Kernel Architecture Name
Most of the build tools automatically process each of the entries in the kernel architecture list which is defined in one place.
make/toolchain/i486-unknown-linux-uclibc.mk edit the definition of variable "KARCHS" to add a new name to the space-separated list.
Search for lines like:
# available kernel archs export KARCHS:=i686 i486 geode
The new name should be short (ideally 4 characters) and should clearly refer to the new CPU architecture.
The new name will be referred to as "karch" in the remainder of this page.
Version 7.x and later
The previous approach using config diff files and release tagged config files has shown to be tedious and not well corresponding to modern release management tools. Therefore we have reintroduced the old naming convention for the config files which used to be created from the basic configuration files plus a .diff file. To easier maintain these Files in git the kernel release numbers are now omitted from the file names. Thus the config files now follow the convention Bering.config-<karch>.
ToDo: define the process maintaining these files in detail
Add the kmodules Configuration
Since the kernel Modules vary from one kernel architecture variant to another each variant needs its own
moddb-karch.lrp which is generated from the kmodules source.
repo/kmodules/buildtool.cfg and add a new block of lines for "<moddb-karch>".
Add the Image Configuration
Each kernel architecture variant needs its own disk Image variant(s).
Create a new directory under
image/ and create file
buildimage.cfg within that (best to copy and edit an existing file).
Refer to the Building an Image page for details of the directory naming convention.
Repeat if multiple types (e.g. ISOLINUX versus SYSLINUX) of image are relevant for this kernel variant, but only create the minimum set likely to be required.
Add the Documentation
Usually, a new kernel architecture variant will be added because it is required for a specific hardware device which is particularly suitable for running Bering-uClibc 5.x.
Please therefore add some content to the Hardware-Specific Guides page of this Wiki to detail the hardware device and to specify which Image should be used for it.