[oe] Cleaning up the "linux" directory

Ulf Samuelsson ulf.samuelsson at atmel.com
Sat Aug 22 09:38:41 UTC 2009


As everyone knows, the kernel directory is a mess:
I have been thinking about what to do about this,
and with the ability to include files in subdirectories,
I think I have found a nice solution.

New variables

CPU_FAMILY
KERNEL_MAJOR
KERNEL_MINOR

For future kernels,

Did not try this, yet but this looks promising...

-----------------------------------------------------------------------------
# linux-2.6.30.bb (replacing the old one)
# New style recipe for kernel builds
# Hopefully no need to have custom recipies in the top directory
# Mark archs/machines that this kernel supports
DEFAULT_PREFERENCE = "-1"
require linux-v2.inc
PR = "r0"
# Yes, that's all!

-----------------------------------------------------------------------------
# "linux-v2.inc" Contains
require linux.inc

CPU_FAMILY ?= "dummy-arch"
KERNEL_MAJOR  = "${PV}"
KERNEL_DIR = "${FILE_DIRNAME}/linux-${KERNEL_MAJOR}"
require ${KERNEL_DIR}/version.inc

KERNEL_MINOR_DIR = ${KERNEL_DIR}/${KERNEL_VERSION}
KERNEL_CPU_FAMILY_DIR=${KERNEL_DIR}/${CPU_FAMILY}

S = "${WORKDIR}/linux-${KERNEL_MAJOR}"

KERNEL_SOURCE_DIR="${KERNELORG_MIRROR}/pub/linux/kernel/v2.6"
SRC_URI = "${KERNEL_SOURCE_DIR}/linux-${KERNEL_MAJOR}.tar.bz2 "
MINOR_PATCH=${KERNEL_SOURCE_DIR}/patch-${KERNEL_MAJOR}.${KERNEL_MINOR}.bz2

# Include ${MINOR_PATCH}
# Include any other common patches for this minor version
require	${KERNEL_MINOR_DIR}/patches/SRC_URI_append.inc
# Any customizations for this minor version
require	${KERNEL_MINOR_DIR}/linux-${KERNEL_VERSION}.inc

# Customize for the CPU_FAMILY
# Note that this can contain further includes for minor versions
require	${KERNEL_CPU_FAMILY_DIR}/patches/SRC_URI_append.inc
require	${KERNEL_CPU_FAMILY_DIR}/common/linux-${KERNEL_VERSION}.inc
include
${KERNEL_CPU_FAMILY_DIR}/boards/${MACHINE}/linux-${KERNEL_VERSION}.inc
#
-----------------------------------------------------------------------------
# "${KERNEL_DIR}/version.inc" contains
KERNEL_LATEST_MINOR = "5"
KERNEL_MINOR ?= "${KERNEL_LATEST_MINOR}"
KERNEL_VERSION = "${KERNEL_MAJOR}.${KERNEL_MINOR}"



-----------------------------------------------------------------------------
# Possible contents of ${KERNEL_CPU_FAMILY_DIR}/patches/SRC_URI_append.inc
require {KERNEL_CPU_FAMILY_DIR}/patches/${KERNEL_VERSION}/SRC_URI_append.inc

#
-- 
Best Regards
Ulf Samuelsson





More information about the Openembedded-devel mailing list