Skip to content

Commit

Permalink
Merge pull request #42 from razr/Ubuntu-22.04
Browse files Browse the repository at this point in the history
add Ubuntu 22.04 build support
  • Loading branch information
LanderU authored Jul 14, 2022
2 parents f6ae7d6 + 4516fda commit d38efa4
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .config-fragment
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
CONFIG_VIRTUALIZATION=n
CONFIG_PREEMPT_RT=y
CONFIG_LOCKUP_DETECTOR=n
CONFIG_DETECT_HUNG_TASK=n
Expand All @@ -23,3 +24,5 @@ CONFIG_PERF_EVENTS=y
# CONFIG_KRETPROBES is not set
# CONFIG_KALLSYMS_ALL is not set
CONFIG_DEBUG_INFO=n
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
17 changes: 17 additions & 0 deletions .github/workflows/build-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,24 @@ name: 'Build latest'

on:
workflow_dispatch:
inputs:
kernel_version:
description: 'Raspi kernel version, 5.4.0|5.15.0'
required: false
type: string
ubuntu_version:
description: 'Ubuntu version, focal|jammy'
required: false
type: string
lttng_version:
description: 'LTTNG version, 2.12|2.13'
required: false
type: string

jobs:
call-rpi4-kernel-build:
uses: ./.github/workflows/rpi4-kernel-build.yml
with:
kernel_version: ${{ github.event.inputs.kernel_version }}
ubuntu_version: ${{ github.event.inputs.ubuntu_version }}
lttng_version: ${{ github.event.inputs.lttng_version }}
12 changes: 11 additions & 1 deletion .github/workflows/build-stable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,28 @@ name: 'Build stable'
on:
workflow_dispatch:
inputs:
kernel_version:
description: 'Raspi kernel version, 5.4.0|5.15.0'
required: false
type: string
ubuntu_version:
description: 'Ubuntu version, focal|jammy'
required: false
type: string
uname_r:
description: 'raspi release in a form of <5.4.0-1058-raspi>'
required: true
default: '5.4.0-1058-raspi'
type: string
lttng_version:
description: 'LTTNG version e.g. 2.12'
description: 'LTTNG version 2.12|2.13'
required: false
type: string
jobs:
call-rpi4-kernel-build:
uses: ./.github/workflows/rpi4-kernel-build.yml
with:
uname_r: ${{ github.event.inputs.uname_r }}
kernel_version: ${{ github.event.inputs.kernel_version }}
ubuntu_version: ${{ github.event.inputs.ubuntu_version }}
lttng_version: ${{ github.event.inputs.lttng_version }}
25 changes: 19 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
# docker image to build an RT kernel for the RPI4 based on Ubuntu 20.04 RPI4 image
# A Dockerfile to build an RT kernel for the RPI4 based on Ubuntu 20.04 or 22.04 RPI4 kernel
#
# By default it finds and takes the latest raspi image and the RT_PREEMPT patch closest to it
# if the build arguments defined it will build the corresponding version instead
# $ docker build [--build-arg UNAME_R=<raspi release>] [--build-arg RT_PATCH=<RT patch>] -t rtwg-image .
# If run without parameters the Docker image is created to built RT_PREEMPT patched version of the latest 5.4 raspi kernel
# The Docker build command accepts the following build arguments:
# $ docker build [--build-arg UBUNTU_VERSION=<ubuntu name>] [--build-arg KERNEL_VERSION=<kernel version>]
# [--build-arg UNAME_R=<raspi release>] [--build-arg RT_PATCH=<RT patch>]
# [--build-arg LTTNG_VERSION=<LTTNG version>] -t rtwg-image .
#
# where <raspi release> is in a form of 5.4.0-1058-raspi,
# where
# <ubuntu name> is jammy or focal, default is focal
# <kernel version> is 5.4.0 or 5.15.0, default is 5.4.0
# <raspi release> is in a form of 5.4.0-1058-raspi, if not defined the lastest version is taken
# see http://ports.ubuntu.com/pool/main/l/linux-raspi/
# and <RT patch> is in a form of 5.4.177-rt69,
# <RT patch> is in a form of 5.4.177-rt69, if not defined the closest to the defined <raspi release> is taken
# see http://cdn.kernel.org/pub/linux/kernel/projects/rt/5.4/older
# <LTTNG version> is 2.12 or 2.13, default is 2.12
#
# To build a Docker image for the latest 5.4 raspi kernel run
# $ docker build -t rtwg-image .
#
# To build a Docker image for the latest 5.15 raspi kernel run
# $ docker build --build-arg UBUNTU_VERSION=jammy --build-arg KERNEL_VERSION=5.15.0 --build-arg LTTNG_VERSION=2.13 -t rtwg-image .
#
# After that the Docker image is prepared and ready to run
# $ docker run -it rtwg-image bash
#
# and then inside the docker
Expand Down
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This README describes necessary steps to build and install ```RT_PREEMPT``` Linu

## Raspberry Pi 4 RT Linux kernel

Ubuntu ```raspi``` kernel is modified to produce an RT Linux kernel. Ubuntu is a ROS 2 Tier 1 platform and Ubuntu kernel was selected to align to it.
Ubuntu ```raspi``` kernel is modified to produce an RT Linux kernel. Ubuntu is a ROS 2 Tier 1 platform and Ubuntu kernel was selected to align to it. It is possible to build the raspi kernel for both Ubuntu LTS releases 20.04 and 22.04.

## Download ready-to-use RT Kernel ```deb``` packages

Expand Down Expand Up @@ -61,13 +61,16 @@ cd linux-real-time-kernel-builder
```

```bash
docker build [--no-cache] [--build-arg UNAME_R=<raspi release>] [--build-arg RT_PATCH=<RT patch>] -t rtwg-image .
docker build [--no-cache] [--build-arg UBUNTU_VERSION=<ubuntu name>] [--build-arg KERNEL_VERSION=<kernel version>] [--build-arg UNAME_R=<raspi release>] [--build-arg RT_PATCH=<RT patch>] [--build-arg LTTNG_VERSION=<LTTNG version>] -t rtwg-image .
```

where:

* ```<ubuntu name>``` is `jammy` or `focal`, default is `focal`
* ```<kernel version>``` is `5.4.0` or `5.15.0`, default is `5.4.0`
* ```<raspi release>``` is in a form of ```5.4.0-1058-raspi```, see [Ubuntu raspi Linux kernels](http://ports.ubuntu.com/pool/main/l/linux-raspi)
* ```<RT patch>``` is in a form of ```5.4.177-rt69```, see [RT patches](http://cdn.kernel.org/pub/linux/kernel/projects/rt/5.4/older)
* ```<LTTNG version>``` is `2.12` or `2.13`, default is `2.12`

```bash
docker run -t -i rtwg-image bash
Expand Down Expand Up @@ -156,11 +159,14 @@ sudo dpkg -i linux-image-*.deb
sudo reboot
```

After reboot you should see a new RT kernel installed
After reboot you should see a new RT kernel installed and real-time enabled

```bash
ubuntu@ubuntu:~$ uname -a
Linux ubuntu 5.4.174-rt69-raspi #1 SMP PREEMPT_RT Mon Apr 8 14:10:16 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux

ubuntu@ubuntu:~$ cat /sys/kernel/realtime
1
```

## Intel UP2 board RT kernel build
Expand Down

0 comments on commit d38efa4

Please sign in to comment.