From 744f4afe07f6cc7dcb8d6a467ac4ac7b9585a4e9 Mon Sep 17 00:00:00 2001 From: Andrei Kholodnyi Date: Sat, 18 Jun 2022 17:21:32 +0200 Subject: [PATCH 1/6] Update Dockerfile instructions for Ubuntu 22.04 add instructions to build the 5.15 `raspi` kernel for Ubuntu 22.04 --- Dockerfile | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4371f4f..ef108a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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=] [--build-arg 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=] [--build-arg KERNEL_VERSION=] +# [--build-arg UNAME_R=] [--build-arg RT_PATCH=] +# [--build-arg LTTNG_VERSION=] -t rtwg-image . # -# where is in a form of 5.4.0-1058-raspi, +# where +# is jammy or focal, default is focal +# is 5.4.0 or 5.15.0, default is 5.4.0 +# 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 is in a form of 5.4.177-rt69, +# is in a form of 5.4.177-rt69, if not defined the closest to the defined is taken # see http://cdn.kernel.org/pub/linux/kernel/projects/rt/5.4/older +# 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 From 65c33b3768f359be50a311ff51765999310360ad Mon Sep 17 00:00:00 2001 From: Andrei Kholodnyi Date: Sat, 18 Jun 2022 17:39:14 +0200 Subject: [PATCH 2/6] Add a description to build the 22.04 kernel in README add extra Dockefile build parameters in the README for the 22.04 kernel build --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2afd89e..4bc6861 100644 --- a/README.md +++ b/README.md @@ -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 @@ -61,13 +61,16 @@ cd linux-real-time-kernel-builder ``` ```bash -docker build [--no-cache] [--build-arg UNAME_R=] [--build-arg RT_PATCH=] -t rtwg-image . +docker build [--no-cache] [--build-arg UBUNTU_VERSION=] [--build-arg KERNEL_VERSION=] [--build-arg UNAME_R=] [--build-arg RT_PATCH=] [--build-arg LTTNG_VERSION=] -t rtwg-image . ``` where: +* `````` is `jammy` or `focal`, default is `focal` +* `````` is `5.4.0` or `5.15.0`, default is `5.4.0` * `````` is in a form of ```5.4.0-1058-raspi```, see [Ubuntu raspi Linux kernels](http://ports.ubuntu.com/pool/main/l/linux-raspi) * `````` is in a form of ```5.4.177-rt69```, see [RT patches](http://cdn.kernel.org/pub/linux/kernel/projects/rt/5.4/older) +* `````` is `2.12` or `2.13`, default is `2.12` ```bash docker run -t -i rtwg-image bash From 4dab960be1d955b58ca26f0a3204d38bc2bbf7a7 Mon Sep 17 00:00:00 2001 From: Andrei Kholodnyi Date: Sat, 18 Jun 2022 18:36:11 +0200 Subject: [PATCH 3/6] add extra parameters to the build-latest --- .github/workflows/build-latest.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/build-latest.yml b/.github/workflows/build-latest.yml index 00e857d..a88805f 100644 --- a/.github/workflows/build-latest.yml +++ b/.github/workflows/build-latest.yml @@ -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 }} From 716f5e7370095f5498f58ef41bdf85810d305b16 Mon Sep 17 00:00:00 2001 From: Andrei Kholodnyi Date: Sun, 19 Jun 2022 10:51:06 +0200 Subject: [PATCH 4/6] add extra parameters to the build-stable --- .github/workflows/build-stable.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-stable.yaml b/.github/workflows/build-stable.yaml index 73b5381..fad9c9d 100644 --- a/.github/workflows/build-stable.yaml +++ b/.github/workflows/build-stable.yaml @@ -3,13 +3,21 @@ 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: @@ -17,4 +25,6 @@ jobs: 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 }} From f6ee5e04aa808a7d7c9884f4d744a52c673e926a Mon Sep 17 00:00:00 2001 From: Andrei Kholodnyi Date: Sun, 19 Jun 2022 13:30:22 +0200 Subject: [PATCH 5/6] disable VIRTUALIZATION, it is not supported in 5.15 RT --- .config-fragment | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.config-fragment b/.config-fragment index 2aa1acf..4f71a8a 100644 --- a/.config-fragment +++ b/.config-fragment @@ -1,3 +1,4 @@ +CONFIG_VIRTUALIZATION=n CONFIG_PREEMPT_RT=y CONFIG_LOCKUP_DETECTOR=n CONFIG_DETECT_HUNG_TASK=n @@ -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 From 4516fdada0029e127f29cfead6b32b5214b1cc38 Mon Sep 17 00:00:00 2001 From: Andrei Kholodnyi Date: Sun, 19 Jun 2022 13:35:07 +0200 Subject: [PATCH 6/6] add a real-time check in README --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4bc6861..5467546 100644 --- a/README.md +++ b/README.md @@ -159,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