Skip to contentSkip to conversation

meta-rt: create a real-time (PREEMPT_RT) layer

PATCH In review Darren Hart 3 participants 9 messages Jan 18, 2011 – Jan 21, 2011

lore
Share & tools
lore
#0 lore raw

cover meta-rt: create a real-time (PREEMPT_RT) layer

Add a real-time layer to build the linux-yocto preempt_rt kernel type for specific machines. It also adds the rt-tests test suite. This series adds qemux86-64 support as well as atom-pc. Both have been boot tested.

There has been much discussion surrounding where real-time support should be in the repositories. Most recently we discussed including it as part of the main poky repository. I think this makes the most sense as the rt kernels are built from the same kernel repositories as the other linux-yocto kernels.

Pull URL: git://git.pokylinux.org/poky-contrib.git
Branch: dvhart/meta-rt
Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=dvhart/meta-rt

Thanks,
Darren Hart <[email protected]>
---

Darren Hart (5):
meta-rt: Initial PREEMPT_RT layer and kernel recipes meta-rt/rt-tests: add the PREEMPT_RT rt-tests testsuite and
recipes-tests directory
meta-rt/poky-image-*rt: Add initial PREEMPT_RT image recipes machine/qemu: Allow for users to override the preferred kernel
version
meta-rt: atom-pc support

 meta-rt/conf/layer.conf                            |   23 +++++++++++
 meta-rt/images/poky-image-minimal-rt-directdisk.bb |   15 +++++++
 meta-rt/images/poky-image-minimal-rt-live.bb       |   15 +++++++
 meta-rt/images/poky-image-minimal-rt.bb            |   12 ++++++
 meta-rt/recipes-kernel/linux-yocto-rt_stablegit.bb |   40 ++++++++++++++++++++
 meta-rt/recipes-tests/rt-tests_git.bb              |   22 +++++++++++
 meta/conf/machine/include/qemu.inc                 |    2 +-
 7 files changed, 128 insertions(+), 1 deletions(-)
 create mode 100644 meta-rt/conf/layer.conf
 create mode 100644 meta-rt/images/poky-image-minimal-rt-directdisk.bb
 create mode 100644 meta-rt/images/poky-image-minimal-rt-live.bb
 create mode 100644 meta-rt/images/poky-image-minimal-rt.bb
 create mode 100644 meta-rt/recipes-kernel/linux-yocto-rt_stablegit.bb
 create mode 100644 meta-rt/recipes-tests/rt-tests_git.bb
#1 lore raw

PATCH 1/5 meta-rt: Initial PREEMPT_RT layer and kernel recipes

The meta-rt layer provides a preempt_rt kernel recipe using the linux-yocto-stable git tree. It overrides the virtual/kernel provider and defines the compatible machines and per-machine SRCREVs. The initial layer supports only qemux86-64.

Cc Tom Zanussi <[email protected]>
Cc Bruce Ashfield <[email protected]>
---
 meta-rt/conf/layer.conf                            |   22 +++++++++++
 meta-rt/recipes-kernel/linux-yocto-rt_stablegit.bb |   39 ++++++++++++++++++++
 2 files changed, 61 insertions(+), 0 deletions(-)
 create mode 100644 meta-rt/conf/layer.conf
 create mode 100644 meta-rt/recipes-kernel/linux-yocto-rt_stablegit.bb
meta-rt/conf/layer.conf new file +22 -0
new file mode 100644
index 0000000..dbf4a32
@@ -0,0 +1,22 @@
+# Default to first disk/first partition
+RSP_ROOT ?= "sda1"
+
+# We have a conf and classes directory, add to BBPATH
+BBPATH := "${BBPATH}:${LAYERDIR}"
+
+# We have an images and various recipe-* directories, add to BBFILES
+BBFILES := "${BBFILES} ${LAYERDIR}/images/*.bb ${LAYERDIR}/images/*.bbappend ${LAYERDIR}/recipes-*/*.bb ${LAYERDIR}/recipes-*/*.bbappend"
+	
+BBFILE_COLLECTIONS += "rt"
+BBFILE_PATTERN_rt := "^${LAYERDIR}/"
+BBFILE_PRIORITY_rt = "8"
+
+# This layer builds images using a PREEMPT_RT kernel. Override any machine
+# specified kernel providers and leave it up to the kernel recipe to 
+# determine COMPATIBLE_MACHINE.
+PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-rt"
+
+# preempt_rt SRCREVs, one for meta, one per machine
+SRCREV_meta_pn-linux-yocto-rt ?= "50ccd2b3213b6a1bacb3f898c035119802dac420"
+SRCREV_machine_pn-linux-yocto-rt_qemux86-64 ?= "f49444f06875894389e640bcda6c3f6ceb1f0c3e"
+
meta-rt/recipes-kernel/linux-yocto-rt_stablegit.bb new file +39 -0
new file mode 100644
index 0000000..361b680
@@ -0,0 +1,39 @@
+inherit kernel
+require recipes-kernel/linux/linux-yocto.inc
+
+KMACHINE_qemux86-64  = "common_pc_64"
+
+LINUX_VERSION ?= "2.6.34"
+LINUX_KERNEL_TYPE = "preempt_rt"
+LINUX_VERSION_EXTENSION ?= "-yocto-${LINUX_KERNEL_TYPE_EXTENSION}"
+
+PR = "r0"
+PV = "${LINUX_VERSION}+git${SRCPV}"
+SRCREV_FORMAT = "meta_machine"
+
+COMPATIBLE_MACHINE = "(qemux86-64)"
+
+# this performs a fixup on the SRCREV for new/undefined BSPs
+python __anonymous () {
+    import bb, re, string
+
+    rev = bb.data.getVar("SRCREV_machine", d, 1)
+    if rev == "standard":
+        bb.data.setVar("SRCREV_machine", "${SRCREV_meta}", d)
+
+    kerntype = string.replace(bb.data.expand("${LINUX_KERNEL_TYPE}", d), "_", "-")
+    bb.data.setVar("LINUX_KERNEL_TYPE_EXTENSION", kerntype, d)
+}
+
+SRC_URI = "git://git.pokylinux.org/linux-2.6-windriver.git;protocol=git;fullclone=1;branch=${KBRANCH};name=machine \
+           git://git.pokylinux.org/linux-2.6-windriver.git;protocol=git;noclone=1;branch=wrs_meta;name=meta"
+
+# Functionality flags
+KERNEL_REVISION_CHECKING ?= "t"
+KERNEL_FEATURES=features/netfilter
+
+# extra tasks
+addtask kernel_link_vmlinux after do_compile before do_install
+addtask validate_branches before do_patch after do_kernel_checkout
+
+require recipes-kernel/linux/linux-tools.inc
Signature · 1 line
1.7.1
#2 lore raw

Re: [PATCH 1/5] meta-rt: Initial PREEMPT_RT layer and kernel recipes

Quoted 33 lines · Darren Hart

The meta-rt layer provides a preempt_rt kernel recipe using the linux-yocto-stable git tree. It overrides the virtual/kernel provider and defines the compatible machines and per-machine SRCREVs. The initial layer supports only qemux86-64.

Cc Tom Zanussi <[email protected]>
Cc Bruce Ashfield <[email protected]>

---
 meta-rt/conf/layer.conf                            |   22 +++++++++++ meta-rt/recipes-kernel/linux-yocto-rt_stablegit.bb |   39 ++++++++++++++++++++

 2 files changed, 61 insertions(+), 0 deletions(-)

 create mode 100644 meta-rt/conf/layer.conf
 create mode 100644 meta-rt/recipes-kernel/linux-yocto-rt_stablegit.bb

meta-rt/conf/layer.conf new file +11 -0
new file mode 100644
index 0000000..dbf4a32
@@ -0,0 +1,22 @@
+# Default to first disk/first partition
+RSP_ROOT ?= "sda1"
+
+# We have a conf and classes directory, add to BBPATH
+BBPATH := "${BBPATH}:${LAYERDIR}"
+
+# We have an images and various recipe-* directories, add to BBFILES
+BBFILES := "${BBFILES} ${LAYERDIR}/images/*.bb ${LAYERDIR}/images/*.bbappend ${LAYERDIR}/recipes-*/*.bb ${LAYERDIR}/recipes-*/*.bbappend"
+
+BBFILE_COLLECTIONS += "rt"
+BBFILE_PATTERN_rt := "^${LAYERDIR}/"

meta-rt/conf/layer.conf line 21

Quoted 10 lines
meta-rt/conf/layer.conf new file +10 -0
+BBFILE_PRIORITY_rt = "8"
+
+# This layer builds images using a PREEMPT_RT kernel. Override any machine
+# specified kernel providers and leave it up to the kernel recipe to
+# determine COMPATIBLE_MACHINE.
+PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-rt"
+
+# preempt_rt SRCREVs, one for meta, one per machine
+SRCREV_meta_pn-linux-yocto-rt ?= "50ccd2b3213b6a1bacb3f898c035119802dac420"
+SRCREV_machine_pn-linux-yocto-rt_qemux86-64 ?= "f49444f06875894389e640bcda6c3f6ceb1f0c3e"

This reminds me of the discussion we were having about the emenlow BSPs, and that we never resolved.

I suggested that we need some interim overrides options for these variables so I can update a master set of SRCREVs and have the BSPs updated, and a flag/variable that would allow a BSP to also opt-out of getting a more global SRCREV assigned.

If we don't do solve this, none of these BSPs will pickup CVEs/bug fixes or global config changes .. and we'll have a problem.

Comments ?

Quoted 35 lines
meta-rt/conf/layer.conf new file +1 -0
+
meta-rt/recipes-kernel/linux-yocto-rt_stablegit.bb new file +28 -0
new file mode 100644
index 0000000..361b680
@@ -0,0 +1,39 @@
+inherit kernel
+require recipes-kernel/linux/linux-yocto.inc
+
+KMACHINE_qemux86-64  = "common_pc_64"
+
+LINUX_VERSION ?= "2.6.34"
+LINUX_KERNEL_TYPE = "preempt_rt"
+LINUX_VERSION_EXTENSION ?= "-yocto-${LINUX_KERNEL_TYPE_EXTENSION}"
+
+PR = "r0"
+PV = "${LINUX_VERSION}+git${SRCPV}"
+SRCREV_FORMAT = "meta_machine"
+
+COMPATIBLE_MACHINE = "(qemux86-64)"
+
+# this performs a fixup on the SRCREV for new/undefined BSPs
+python __anonymous () {
+    import bb, re, string
+
+    rev = bb.data.getVar("SRCREV_machine", d, 1)
+    if rev == "standard":
+        bb.data.setVar("SRCREV_machine", "${SRCREV_meta}", d)
+
+    kerntype = string.replace(bb.data.expand("${LINUX_KERNEL_TYPE}", d), "_", "-")
+    bb.data.setVar("LINUX_KERNEL_TYPE_EXTENSION", kerntype, d)
+}
+
+SRC_URI = "git://git.pokylinux.org/linux-2.6-windriver.git;protocol=git;fullclone=1;branch=${KBRANCH};name=machine \

meta-rt/recipes-kernel/linux-yocto-rt_stablegit.bb line 38

Quoted 10 lines
meta-rt/recipes-kernel/linux-yocto-rt_stablegit.bb new file +10 -0
+           git://git.pokylinux.org/linux-2.6-windriver.git;protocol=git;noclone=1;branch=wrs_meta;name=meta"
+
+# Functionality flags
+KERNEL_REVISION_CHECKING ?= "t"
+KERNEL_FEATURES=features/netfilter
+
+# extra tasks
+addtask kernel_link_vmlinux after do_compile before do_install
+addtask validate_branches before do_patch after do_kernel_checkout
+

And as we discussed, I'll help clean this up when I get the recipe refactoring done. I'm just trying to decide if I can get away with including a .bb file instead of creation more .inc files :)

Cheers,

Bruce

Quoted 9 lines
meta-rt/recipes-kernel/linux-yocto-rt_stablegit.bb new file +1 -1
+require recipes-kernel/linux/linux-tools.inc
--

1.7.1

_______________________________________________
poky mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/poky

Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"
#3 lore raw

PATCH 2/5 meta-rt/rt-tests: add the PREEMPT_RT rt-tests testsuite and recipes-tests directory

In reply to Darren Hart

The rt-tests test-suite is a collection of tests meant to measure the latency and determinism of the Linux PREEMPT_RT kernel.

Cc Tom Zanussi <[email protected]>
Cc Bruce Ashfield <[email protected]>
---
 meta-rt/recipes-tests/rt-tests_git.bb |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)
 create mode 100644 meta-rt/recipes-tests/rt-tests_git.bb
meta-rt/recipes-tests/rt-tests_git.bb new file +22 -0
new file mode 100644
index 0000000..35af022
@@ -0,0 +1,22 @@
+DESCRIPTION = "Real-Time preemption testcases"
+HOMEPAGE = "https://rt.wiki.kernel.org/index.php/Cyclictest"
+SECTION = "tests"
+DEPENDS = "linux-libc-headers eglibc"
+LICENSE = "GPLv2 & GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
+                    file://src/cyclictest/cyclictest.c;beginline=7;endline=9;md5=ce162fe491d19d2ec67dff6dbc938d50 \
+                    file://src/pi_tests/pi_stress.c;beginline=6;endline=19;md5=bd426a634a43ec612e9fbf125dfcc949"
+SRCREV = ${AUTOREV}
+PV = "git${SRCPV}"
+PR = "r0"
+
+SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/clrkwllms/rt-tests.git;protocol=git"
+
+S = "${WORKDIR}/git"
+
+CFLAGS += "-I${S}/src/include -D_GNU_SOURCE -Wall -Wno-nonnull"
+
+do_install() {
+        oe_runmake install DESTDIR=${D} SBINDIR=${sbindir} MANDIR=${mandir} \
+                           INCLUDEDIR=${includedir}
+}
Signature · 1 line
1.7.1
#4 lore raw

PATCH 3/5 meta-rt/poky-image-*rt: Add initial PREEMPT_RT image recipes

In reply to Darren Hart

Add poky-image-minimal-rt* image recipes. They are based on the minimal recipe and add rt-tests for basic evaluation of a board with a PREEMPT_RT kernel.

Cc Tom Zanussi <[email protected]>
Cc Bruce Ashfield <[email protected]>
---
 meta-rt/images/poky-image-minimal-rt-directdisk.bb |   15 +++++++++++++++
 meta-rt/images/poky-image-minimal-rt-live.bb       |   15 +++++++++++++++
 meta-rt/images/poky-image-minimal-rt.bb            |   12 ++++++++++++
 3 files changed, 42 insertions(+), 0 deletions(-)
 create mode 100644 meta-rt/images/poky-image-minimal-rt-directdisk.bb
 create mode 100644 meta-rt/images/poky-image-minimal-rt-live.bb
 create mode 100644 meta-rt/images/poky-image-minimal-rt.bb
meta-rt/images/poky-image-minimal-rt-directdisk.bb new file +15 -0
new file mode 100644
index 0000000..b68fe56
@@ -0,0 +1,15 @@
+#
+# Copyright (C) 2010 Intel Corporation.
+#
+
+require recipes-core/images/poky-image-directdisk.inc
+
+DESCRIPTION = "Bootable Minimal Real-Time Direct Disk Image"
+
+ROOTFS = "${DEPLOY_DIR_IMAGE}/poky-image-minimal-rt-${MACHINE}.ext3"
+
+LICENSE = "MIT"
+
+do_bootdirectdisk[depends] += "poky-image-minimal-rt:do_rootfs"
+
+
meta-rt/images/poky-image-minimal-rt-live.bb new file +15 -0
new file mode 100644
index 0000000..01628dc
@@ -0,0 +1,15 @@
+#
+# Copyright (C) 2010 Intel Corporation.
+#
+
+DESCRIPTION = "Bootable Live Minimal Real-Time Linux Image"
+
+require recipes-core/images/poky-image-live.inc
+
+LABELS += "boot install"
+
+ROOTFS = "${DEPLOY_DIR_IMAGE}/poky-image-minimal-rt-${MACHINE}.ext3"
+
+LICENSE = "MIT"
+
+do_bootimg[depends] += "poky-image-minimal-rt:do_rootfs"
meta-rt/images/poky-image-minimal-rt.bb new file +12 -0
new file mode 100644
index 0000000..6f5700c
@@ -0,0 +1,12 @@
+#
+# Copyright (C) 2010 Intel Corporation.
+#
+
+DESCRIPTION = "Minimal Real-Time Linux Image"
+DEPENDS = "linux-yocto-rt"
+
+require recipes-core/images/poky-image-minimal.bb
+
+IMAGE_INSTALL += "rt-tests"
+
+LICENSE = "MIT"
Signature · 1 line
1.7.1
#5 lore raw

PATCH 4/5 machine/qemu: Allow for users to override the preferred kernel version

In reply to Darren Hart

The linux-yocto-rt kernel has been boot tested on qemux86-64. Unlock the preferred provider for virtual/kernel so it can be selected and used.

---
 meta/conf/machine/include/qemu.inc |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
meta/conf/machine/include/qemu.inc +1 -1
index d762d01..225906b 100644
@@ -15,7 +15,7 @@ IMAGE_ROOTFS_SIZE_ext3 ?= "280000"
 RDEPENDS_kernel-base = ""
 
 # Use a common kernel recipe for all QEMU machines
-PREFERRED_PROVIDER_virtual/kernel = "linux-yocto"
+PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
 PREFERRED_PROVIDER_linux-libc-headers ?= "linux-libc-headers-yocto"
 
 EXTRA_IMAGEDEPENDS += "qemu-native qemu-helper-native"
Signature · 1 line
1.7.1
Acked-by on v1 4/5
#6 lore raw

Re: [PATCH 4/5] machine/qemu: Allow for users to override the preferred kernel version

Quoted 3 lines · Darren Hart

The linux-yocto-rt kernel has been boot tested on qemux86-64. Unlock the preferred provider for virtual/kernel so it can be selected and used.

Quoted 27 lines

---
 meta/conf/machine/include/qemu.inc |    2 +-

 1 files changed, 1 insertions(+), 1 deletions(-)
meta/conf/machine/include/qemu.inc +0 -0
index d762d01..225906b 100644
@@ -15,7 +15,7 @@ IMAGE_ROOTFS_SIZE_ext3 ?= "280000"

 RDEPENDS_kernel-base = ""

 # Use a common kernel recipe for all QEMU machines

meta/conf/machine/include/qemu.inc +1 -1
-PREFERRED_PROVIDER_virtual/kernel = "linux-yocto"
+PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"

 PREFERRED_PROVIDER_linux-libc-headers ?= "linux-libc-headers-yocto"

 EXTRA_IMAGEDEPENDS += "qemu-native qemu-helper-native" --
1.7.1

_______________________________________________
poky mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/poky

Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"
#7 lore raw

PATCH 5/5 meta-rt: atom-pc support

In reply to Darren Hart

Add support for the atom-pc machine to the meta-rt layer. This has been boot tested on the Intel n450 development board (Black Sand).

CC Tom Zanussi <[email protected]>
CC Bruce Ashfield <[email protected]>
---
 meta-rt/conf/layer.conf                            |    3 ++-
 meta-rt/recipes-kernel/linux-yocto-rt_stablegit.bb |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
meta-rt/conf/layer.conf +2 -1
index dbf4a32..94ebc02 100644
@@ -17,6 +17,7 @@ BBFILE_PRIORITY_rt = "8"
 PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-rt"
 
 # preempt_rt SRCREVs, one for meta, one per machine
-SRCREV_meta_pn-linux-yocto-rt ?= "50ccd2b3213b6a1bacb3f898c035119802dac420"
+SRCREV_meta_pn-linux-yocto-rt ?= "b0615811ce38836d1ade230e3bdb1efaaa68471f"
 SRCREV_machine_pn-linux-yocto-rt_qemux86-64 ?= "f49444f06875894389e640bcda6c3f6ceb1f0c3e"
+SRCREV_machine_pn-linux-yocto-rt_atom-pc ?= "78dacaf8222c9492ba17f652989ef3466423bdc2"
 
meta-rt/recipes-kernel/linux-yocto-rt_stablegit.bb +2 -1
index 361b680..547f8fe 100644
@@ -2,6 +2,7 @@ inherit kernel
 require recipes-kernel/linux/linux-yocto.inc
 
 KMACHINE_qemux86-64  = "common_pc_64"
+KMACHINE_atom-pc  = "atom-pc"
 
 LINUX_VERSION ?= "2.6.34"
 LINUX_KERNEL_TYPE = "preempt_rt"
@@ -11,7 +12,7 @@ PR = "r0"
 PV = "${LINUX_VERSION}+git${SRCPV}"
 SRCREV_FORMAT = "meta_machine"
 
-COMPATIBLE_MACHINE = "(qemux86-64)"
+COMPATIBLE_MACHINE = "(qemux86-64|atom-pc)"
 
 # this performs a fixup on the SRCREV for new/undefined BSPs
 python __anonymous () {
Signature · 1 line
1.7.1
#8 lore raw
In reply to Darren Hart
Quoted 42 lines · Darren Hart

Add a real-time layer to build the linux-yocto preempt_rt kernel type for specific machines. It also adds the rt-tests test suite. This series adds qemux86-64 support as well as atom-pc. Both have been boot tested.

There has been much discussion surrounding where real-time support should be in the repositories. Most recently we discussed including it as part of the main poky repository. I think this makes the most sense as the rt kernels are built from the same kernel repositories as the other linux-yocto kernels.

Pull URL: git://git.pokylinux.org/poky-contrib.git
Branch: dvhart/meta-rt
Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=dvhart/meta-rt

Thanks,
Darren Hart<[email protected]>
---

Darren Hart (5):
meta-rt: Initial PREEMPT_RT layer and kernel recipes meta-rt/rt-tests: add the PREEMPT_RT rt-tests testsuite and
recipes-tests directory
meta-rt/poky-image-*rt: Add initial PREEMPT_RT image recipes machine/qemu: Allow for users to override the preferred kernel
version
meta-rt: atom-pc support

  meta-rt/conf/layer.conf                            |   23 +++++++++++
  meta-rt/images/poky-image-minimal-rt-directdisk.bb |   15 +++++++
  meta-rt/images/poky-image-minimal-rt-live.bb       |   15 +++++++
  meta-rt/images/poky-image-minimal-rt.bb            |   12 ++++++
  meta-rt/recipes-kernel/linux-yocto-rt_stablegit.bb |   40 ++++++++++++++++++++
  meta-rt/recipes-tests/rt-tests_git.bb              |   22 +++++++++++
  meta/conf/machine/include/qemu.inc                 |    2 +-
  7 files changed, 128 insertions(+), 1 deletions(-)

create mode 100644 meta-rt/conf/layer.conf
create mode 100644 meta-rt/images/poky-image-minimal-rt-directdisk.bb create mode 100644 meta-rt/images/poky-image-minimal-rt-live.bb create mode 100644 meta-rt/images/poky-image-minimal-rt.bb create mode 100644 meta-rt/recipes-kernel/linux-yocto-rt_stablegit.bb create mode 100644 meta-rt/recipes-tests/rt-tests_git.bb

Quoted 5 lines

_______________________________________________
poky mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/poky

Pulled into Master

Thanks
Sau!