public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Uladzimir Bely <ubely@ilbers.de>
To: isar-users@googlegroups.com
Subject: [PATCH v3 3/6] rpi: Added raspios-bullseye configs
Date: Wed, 19 Jan 2022 07:58:59 +0100	[thread overview]
Message-ID: <20220119065902.13514-4-ubely@ilbers.de> (raw)
In-Reply-To: <20220119065902.13514-1-ubely@ilbers.de>

At some point Raspbian distro was renamed to Raspberry Pi OS. That's why
a new RPi configs are added for bullseye with different naming.

Starting from RaspiOS buster, 'linux-image-rpiX' and 'linux-headers-rpiX'
packages for actual kernels were removed from the distro and now they are
provided in 'raspberrypi-kernel' and 'raspberrypi-kernel-headers' packages.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 .../conf/distro/raspios-bullseye-64.list      |  9 ++++++
 meta-isar/conf/distro/raspios-bullseye.conf   | 24 +++++++++++++++
 meta-isar/conf/distro/raspios-bullseye.list   |  5 ++++
 meta-isar/conf/distro/raspios-configscript.sh | 29 +++++++++++++++++++
 meta-isar/conf/local.conf.sample              |  4 +++
 meta-isar/conf/machine/rpi-arm-v7.conf        |  7 +++++
 meta-isar/conf/machine/rpi-arm-v7l.conf       |  7 +++++
 meta-isar/conf/machine/rpi-arm.conf           |  7 +++++
 meta-isar/conf/machine/rpi-arm64-v8.conf      |  7 +++++
 meta-isar/conf/machine/rpi-common.conf        | 22 ++++++++++++++
 .../conf/multiconfig/rpi-arm-bullseye.conf    |  5 ++++
 .../conf/multiconfig/rpi-arm-v7-bullseye.conf |  5 ++++
 .../multiconfig/rpi-arm-v7l-bullseye.conf     |  5 ++++
 .../multiconfig/rpi-arm64-v8-bullseye.conf    |  5 ++++
 .../example-module/example-module.bb          |  4 +++
 meta/recipes-kernel/linux-module/module.inc   | 21 ++++++++++++--
 16 files changed, 163 insertions(+), 3 deletions(-)
 create mode 100644 meta-isar/conf/distro/raspios-bullseye-64.list
 create mode 100644 meta-isar/conf/distro/raspios-bullseye.conf
 create mode 100644 meta-isar/conf/distro/raspios-bullseye.list
 create mode 100644 meta-isar/conf/distro/raspios-configscript.sh
 create mode 100644 meta-isar/conf/machine/rpi-arm-v7.conf
 create mode 100644 meta-isar/conf/machine/rpi-arm-v7l.conf
 create mode 100644 meta-isar/conf/machine/rpi-arm.conf
 create mode 100644 meta-isar/conf/machine/rpi-arm64-v8.conf
 create mode 100644 meta-isar/conf/machine/rpi-common.conf
 create mode 100644 meta-isar/conf/multiconfig/rpi-arm-bullseye.conf
 create mode 100644 meta-isar/conf/multiconfig/rpi-arm-v7-bullseye.conf
 create mode 100644 meta-isar/conf/multiconfig/rpi-arm-v7l-bullseye.conf
 create mode 100644 meta-isar/conf/multiconfig/rpi-arm64-v8-bullseye.conf

diff --git a/meta-isar/conf/distro/raspios-bullseye-64.list b/meta-isar/conf/distro/raspios-bullseye-64.list
new file mode 100644
index 00000000..74efa76d
--- /dev/null
+++ b/meta-isar/conf/distro/raspios-bullseye-64.list
@@ -0,0 +1,9 @@
+deb	http://deb.debian.org/debian bullseye main contrib non-free
+deb-src	http://deb.debian.org/debian bullseye main contrib non-free
+deb	http://deb.debian.org/debian-security/ bullseye-security/updates main contrib non-free
+deb-src	http://deb.debian.org/debian-security/ bullseye-security/updates main contrib non-free
+deb	http://deb.debian.org/debian bullseye-updates main contrib non-free
+deb-src	http://deb.debian.org/debian bullseye-updates main contrib non-free
+
+deb http://archive.raspberrypi.org/debian/ bullseye main
+deb-src http://archive.raspberrypi.org/debian/ bullseye main
diff --git a/meta-isar/conf/distro/raspios-bullseye.conf b/meta-isar/conf/distro/raspios-bullseye.conf
new file mode 100644
index 00000000..cf8cb899
--- /dev/null
+++ b/meta-isar/conf/distro/raspios-bullseye.conf
@@ -0,0 +1,24 @@
+# Raspbi OS stable distribution configuration
+#
+# This software is a part of ISAR.
+# Copyright (C) 2022 ilbers GmbH
+
+BASE_DISTRO = "raspios"
+BASE_DISTRO_arm64 = "debian"
+
+BASE_DISTRO_CODENAME = "bullseye"
+HOST_DISTRO ?= "debian-bullseye"
+HOST_DISTRO_APT_SOURCES ?= "conf/distro/${HOST_DISTRO}.list"
+
+DISTRO_APT_SOURCES ?= "conf/distro/raspios-bullseye.list"
+DISTRO_APT_SOURCES_arm64 ?= "conf/distro/raspios-bullseye-64.list"
+
+DISTRO_BOOTSTRAP_KEYS = "http://raspbian.raspberrypi.org/raspbian.public.key;sha256sum=ca59cd4f2bcbc3a1d41ba6815a02a8dc5c175467a59bd87edeac458f4a5345de"
+DISTRO_BOOTSTRAP_KEYS_arm64 = ""
+
+DISTRO_CONFIG_SCRIPT ?= "${LAYERDIR_isar}/conf/distro/raspios-configscript.sh"
+DISTRO_KERNELS ?= "kernel kernel7 kernel7l kernel8"
+
+THIRD_PARTY_APT_KEYS += "http://archive.raspberrypi.org/debian/raspberrypi.gpg.key;sha256sum=76603890d82a492175caf17aba68dc73acb1189c9fd58ec0c19145dfa3866d56"
+
+COMPAT_DISTRO_ARCH_arm64 = "armhf"
diff --git a/meta-isar/conf/distro/raspios-bullseye.list b/meta-isar/conf/distro/raspios-bullseye.list
new file mode 100644
index 00000000..b6c8fd91
--- /dev/null
+++ b/meta-isar/conf/distro/raspios-bullseye.list
@@ -0,0 +1,5 @@
+deb http://raspbian.raspberrypi.org/raspbian/ bullseye main contrib non-free rpi
+deb-src http://raspbian.raspberrypi.org/raspbian/ bullseye main contrib non-free rpi
+
+deb http://archive.raspberrypi.org/debian/ bullseye main
+deb-src http://archive.raspberrypi.org/debian/ bullseye main
diff --git a/meta-isar/conf/distro/raspios-configscript.sh b/meta-isar/conf/distro/raspios-configscript.sh
new file mode 100644
index 00000000..6120a379
--- /dev/null
+++ b/meta-isar/conf/distro/raspios-configscript.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+#
+# This software is a part of ISAR.
+# Copyright (C) 2022 ilbers GmbH
+
+set -e
+
+readonly MACHINE_SERIAL="$1"
+readonly BAUDRATE_TTY="$2"
+
+cat > /boot/config.txt << EOF
+[pi3]
+# Restore UART0/ttyAMA0 over GPIOs 14 & 15
+dtoverlay=miniuart-bt
+
+[all]
+EOF
+
+cat > /boot/cmdline.txt << EOF
+console=${MACHINE_SERIAL},${BAUDRATE_TTY} console=tty1 \
+root=/dev/mmcblk0p2 rootfstype=ext4 fsck.repair=yes \
+rootwait quiet
+EOF
+
+cat > /etc/fstab << EOF
+proc            /proc           proc    defaults          0       0
+/dev/mmcblk0p1  /boot           vfat    defaults          0       2
+/dev/mmcblk0p2  /               ext4    defaults,noatime  0       1
+EOF
diff --git a/meta-isar/conf/local.conf.sample b/meta-isar/conf/local.conf.sample
index cdd67eb3..71ee8579 100644
--- a/meta-isar/conf/local.conf.sample
+++ b/meta-isar/conf/local.conf.sample
@@ -82,6 +82,10 @@ BBMULTICONFIG = " \
     stm32mp15x-bullseye \
     virtualbox-bullseye \
     rpi-stretch \
+    rpi-arm-bullseye \
+    rpi-arm-v7-bullseye \
+    rpi-arm-v7l-bullseye \
+    rpi-arm64-v8-bullseye \
     sifive-fu540-sid-ports \
     qemuarm64-focal \
     qemuamd64-focal \
diff --git a/meta-isar/conf/machine/rpi-arm-v7.conf b/meta-isar/conf/machine/rpi-arm-v7.conf
new file mode 100644
index 00000000..6089c522
--- /dev/null
+++ b/meta-isar/conf/machine/rpi-arm-v7.conf
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2022 ilbers GmbH
+
+DISTRO_ARCH ?= "armhf"
+KERNEL_NAME = "kernel7"
+
+include conf/machine/rpi-common.conf
diff --git a/meta-isar/conf/machine/rpi-arm-v7l.conf b/meta-isar/conf/machine/rpi-arm-v7l.conf
new file mode 100644
index 00000000..ac842fad
--- /dev/null
+++ b/meta-isar/conf/machine/rpi-arm-v7l.conf
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2022 ilbers GmbH
+
+DISTRO_ARCH ?= "armhf"
+KERNEL_NAME = "kernel7l"
+
+include conf/machine/rpi-common.conf
diff --git a/meta-isar/conf/machine/rpi-arm.conf b/meta-isar/conf/machine/rpi-arm.conf
new file mode 100644
index 00000000..a6abec77
--- /dev/null
+++ b/meta-isar/conf/machine/rpi-arm.conf
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2022 ilbers GmbH
+
+DISTRO_ARCH ?= "armhf"
+KERNEL_NAME = "kernel"
+
+include conf/machine/rpi-common.conf
diff --git a/meta-isar/conf/machine/rpi-arm64-v8.conf b/meta-isar/conf/machine/rpi-arm64-v8.conf
new file mode 100644
index 00000000..f41b04dd
--- /dev/null
+++ b/meta-isar/conf/machine/rpi-arm64-v8.conf
@@ -0,0 +1,7 @@
+# This software is a part of ISAR.
+# Copyright (C) 2022 ilbers GmbH
+
+DISTRO_ARCH ?= "arm64"
+KERNEL_NAME = "kernel8"
+
+include conf/machine/rpi-common.conf
diff --git a/meta-isar/conf/machine/rpi-common.conf b/meta-isar/conf/machine/rpi-common.conf
new file mode 100644
index 00000000..bb0b939c
--- /dev/null
+++ b/meta-isar/conf/machine/rpi-common.conf
@@ -0,0 +1,22 @@
+# This software is a part of ISAR.
+# Copyright (C) 2022 ilbers GmbH
+
+BOOT_SPACE ?= "81920"
+MACHINE_SERIAL ?= "serial0"
+BAUDRATE_TTY ?= "115200"
+
+IMAGE_FSTYPES ?= "rpi-sdimg"
+
+KERNEL_TYPE = "raspios"
+KERNEL_IMAGE_PKG ?= "raspberrypi-kernel"
+KERNEL_HEADERS_PKG ?= "raspberrypi-kernel-headers"
+
+IMAGE_PREINSTALL += " \
+    fdisk \
+    iproute2 \
+    iputils-ping \
+    isc-dhcp-client \
+    raspberrypi-bootloader \
+    raspi-config \
+    systemd-sysv \
+    "
diff --git a/meta-isar/conf/multiconfig/rpi-arm-bullseye.conf b/meta-isar/conf/multiconfig/rpi-arm-bullseye.conf
new file mode 100644
index 00000000..9bc0191c
--- /dev/null
+++ b/meta-isar/conf/multiconfig/rpi-arm-bullseye.conf
@@ -0,0 +1,5 @@
+# This software is a part of ISAR.
+# Copyright (C) 2022 ilbers GmbH
+
+MACHINE ?= "rpi-arm"
+DISTRO ?= "raspios-bullseye"
diff --git a/meta-isar/conf/multiconfig/rpi-arm-v7-bullseye.conf b/meta-isar/conf/multiconfig/rpi-arm-v7-bullseye.conf
new file mode 100644
index 00000000..c7c0fb80
--- /dev/null
+++ b/meta-isar/conf/multiconfig/rpi-arm-v7-bullseye.conf
@@ -0,0 +1,5 @@
+# This software is a part of ISAR.
+# Copyright (C) 2022 ilbers GmbH
+
+MACHINE ?= "rpi-arm-v7"
+DISTRO ?= "raspios-bullseye"
diff --git a/meta-isar/conf/multiconfig/rpi-arm-v7l-bullseye.conf b/meta-isar/conf/multiconfig/rpi-arm-v7l-bullseye.conf
new file mode 100644
index 00000000..6299d6cd
--- /dev/null
+++ b/meta-isar/conf/multiconfig/rpi-arm-v7l-bullseye.conf
@@ -0,0 +1,5 @@
+# This software is a part of ISAR.
+# Copyright (C) 2022 ilbers GmbH
+
+MACHINE ?= "rpi-arm-v7l"
+DISTRO ?= "raspios-bullseye"
diff --git a/meta-isar/conf/multiconfig/rpi-arm64-v8-bullseye.conf b/meta-isar/conf/multiconfig/rpi-arm64-v8-bullseye.conf
new file mode 100644
index 00000000..d79e6394
--- /dev/null
+++ b/meta-isar/conf/multiconfig/rpi-arm64-v8-bullseye.conf
@@ -0,0 +1,5 @@
+# This software is a part of ISAR.
+# Copyright (C) 2022 ilbers GmbH
+
+MACHINE ?= "rpi-arm64-v8"
+DISTRO ?= "raspios-bullseye"
diff --git a/meta-isar/recipes-kernel/example-module/example-module.bb b/meta-isar/recipes-kernel/example-module/example-module.bb
index a72dd1b6..5ebed102 100644
--- a/meta-isar/recipes-kernel/example-module/example-module.bb
+++ b/meta-isar/recipes-kernel/example-module/example-module.bb
@@ -19,6 +19,10 @@ python() {
         '686-pae',
         '4kc-malta',
         'riscv64',
+        'kernel',
+        'kernel7',
+        'kernel7l',
+        'kernel8',
     ]:
         d.setVar('ISAR_CROSS_COMPILE', '0')
 }
diff --git a/meta/recipes-kernel/linux-module/module.inc b/meta/recipes-kernel/linux-module/module.inc
index fecc5b3c..968ac4c7 100644
--- a/meta/recipes-kernel/linux-module/module.inc
+++ b/meta/recipes-kernel/linux-module/module.inc
@@ -36,9 +36,24 @@ do_prepare_build() {
 }
 
 dpkg_runbuild_prepend() {
-    # Custom kernels contain the build folder directly.
-    export KDIR=$(dpkg -L --root=${BUILDCHROOT_DIR} ${KERNEL_HEADERS_PKG} | \
-                  grep "/lib/modules/.*/build")
+    if [ "${KERNEL_TYPE}" = "raspios" ]; then
+        # In RaspiOS one package provides several headers
+        KERNEL_SUFFIX="+"
+        if [ "${KERNEL_NAME}" = "kernel8" ]; then
+            KERNEL_SUFFIX="-v8+"
+        elif [ "${KERNEL_NAME}" = "kernel7l" ]; then
+            KERNEL_SUFFIX="-v7l+"
+        elif [ "${KERNEL_NAME}" = "kernel7" ]; then
+            KERNEL_SUFFIX="-v7+"
+        fi
+        export KDIR=$(dpkg -L --root=${BUILDCHROOT_DIR} ${KERNEL_HEADERS_PKG} | \
+                      grep "/lib/modules/.*${KERNEL_SUFFIX}/build" | head -n1)
+    fi
+    if [ -z "$KDIR" ]; then
+        # Custom kernels contain the build folder directly.
+        export KDIR=$(dpkg -L --root=${BUILDCHROOT_DIR} ${KERNEL_HEADERS_PKG} | \
+                      grep "/lib/modules/.*/build")
+    fi
     if [ -z "$KDIR" ]; then
         # Debian kernels install that folder indirectly via a dependency.
         KERNEL_DEP=$(dpkg-query -W -f '${Depends}' --admindir=${BUILDCHROOT_DIR}/var/lib/dpkg \
-- 
2.20.1


  parent reply	other threads:[~2022-01-19  6:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-19  6:58 [PATCH v3 0/6] Update rpi targets to bullseye Uladzimir Bely
2022-01-19  6:58 ` [PATCH v3 1/6] linux: Allow to use custom packages for linux headers and image Uladzimir Bely
2022-01-19  6:58 ` [PATCH v3 2/6] rpi-sdimage: Change deployed image name Uladzimir Bely
2022-01-19  6:58 ` Uladzimir Bely [this message]
2022-01-19  6:59 ` [PATCH v3 4/6] raspios: resize rootfs on first boot Uladzimir Bely
2022-01-28 21:13   ` Henning Schild
2022-01-29  5:57     ` Uladzimir Bely
2022-01-31  7:43       ` Henning Schild
2022-01-19  6:59 ` [PATCH v3 5/6] CI: Switch rpi targets to bullseye Uladzimir Bely
2022-01-19  6:59 ` [PATCH v3 6/6] doc: Add notes about raspios-bullseye Uladzimir Bely
2022-01-27 15:01 ` [PATCH v3 0/6] Update rpi targets to bullseye Anton Mikanovich

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=20220119065902.13514-4-ubely@ilbers.de \
    --to=ubely@ilbers.de \
    --cc=isar-users@googlegroups.com \
    /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