Openembedded Devel Discussions
 help / color / mirror / Atom feed
From: Ulf Samuelsson <ulf.samuelsson@atmel.com>
To: openembedded-devel@lists.openembedded.org
Subject: Re: Cleaning up the "linux" directory
Date: Sat, 22 Aug 2009 15:59:39 +0200	[thread overview]
Message-ID: <4A8FF9CB.6020607@atmel.com> (raw)
In-Reply-To: <4A8FBCA1.9050601@atmel.com>

Ulf Samuelsson skrev:
> 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...
> 
I have tested a recipe which configures itself based on CPU_FAMILY.
The recipe is totally CPU/Architecure independent!


----------------------------------------------------------------------------
linux-2.6.30.2.bb contains:

SECTION = "kernel"
DESCRIPTION = "Linux kernel 2.6.30.2"
LICENSE = "GPL"

KERNEL_MAJOR = "2.6.30"
KERNEL_MINOR = "2"
PR = "r0"

DEFAULT_PREFERENCE = "-1"

require all-linux-v2.inc

----------------------------------------------------------------------------
As you can see, there is only ONE require/include,
and that is to a totally generic file,
which configures the build based on

CPU_FAMILY
KERNEL_MAJOR
KERNEL_MINOR

The directory structure used to support the at91 for 2.6.30.2:

2.6.30
	2.6.30.2		# common , currently does nothing...
		linux.inc
		patches
			network_files
			SRC_URI_append.inc
	at91			# at91 specific
		at91.inc
		logo_linux_clut224.ppm
		2.6.30.2
			patch-sets	# Not called "patches" by design
				network_files
				SRC_URI_append.inc
				<patches>
			boards
				at91sam9g45ek
					defconfig
					logo_linux_clut224.ppm
	The "2.6.30/2.6.30.2" directory can normally be copied to
	"2.6.30/2.6.30.3" and renamed if the next kernel version is
	needed. No need to edit, if this is pristine.


It supports adding yet another level of directory in the "patch-sets"
directory, so that you can have one directory per patch-set.




----------------------------------------------------------------------------
all-linux-v2.inc contains:

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

KERNEL_VERSION_DIR = ${KERNEL_MAJOR_DIR}/${KERNEL_VERSION}
KERNEL_CPU_FAMILY_DIR=${KERNEL_MAJOR_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} and any other common patches for this minor version
require	${KERNEL_VERSION_DIR}/patches/SRC_URI_append.inc
# Any customizations for this minor version
require	${KERNEL_VERSION_DIR}/linux.inc

# Customize for the CPU_FAMILY
# Note that this can contain further includes for minor versions
require	${KERNEL_CPU_FAMILY_DIR}/${CPU_FAMILY}.inc
require	${KERNEL_CPU_FAMILY_DIR}/${KERNEL_VERSION}/${KERNEL_VERSION}.inc
require
${KERNEL_CPU_FAMILY_DIR}/${KERNEL_VERSION}/patch-sets/SRC_URI_append.inc


----------------------------------------------------------------------------
I ran into one problem:
SRC_URI_append_at91sam9g45ek =         "
file://linux-2.6.30/at91/2.6.30.2/boards/at91sam9g45ek/defconfig "

moves the file to ${S} and not to ${WORKDIR}


I took the easy way out with a workaround:

	mv ${S}/defconfig ${WORKDIR}/defconfig

What do I do wrong?

-- 
Best Regards
Ulf Samuelsson




  reply	other threads:[~2009-08-22 14:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-22  9:38 Cleaning up the "linux" directory Ulf Samuelsson
2009-08-22 13:59 ` Ulf Samuelsson [this message]
2009-08-22 14:59   ` Cleaning up the "linux" directory - Available in origin/ulf/linux-2.6.30.2 Ulf Samuelsson
2009-08-23 10:35 ` Cleaning up the "linux" directory Marcin Juszkiewicz
2009-08-23 12:33   ` Ulf Samuelsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A8FF9CB.6020607@atmel.com \
    --to=ulf.samuelsson@atmel.com \
    --cc=openembedded-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox