public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH v3 0/6] Update rpi targets to bullseye
@ 2022-01-19  6:58 Uladzimir Bely
  2022-01-19  6:58 ` [PATCH v3 1/6] linux: Allow to use custom packages for linux headers and image Uladzimir Bely
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: Uladzimir Bely @ 2022-01-19  6:58 UTC (permalink / raw)
  To: isar-users

This patchset adds Bullseye targets for Raspbian (Raspberry Pi OS).

Since Raspbian Stretch supported by Isar, many things happend
in Raspberry world:
- linux-image-rpi* and linux-headers-rpi* packages are now outdated.
They are still provided in Raspbian Buster, but only for older kernels.
Currently, kernel images and modules are provided by the package
`raspberrypi-kernel` and kernel headers for all kernels come with
the package `raspberrypi-kernel-headers`
- new Raspberry boards were released, based on three different SoCs.
- new 64bit version or RaspiOS for Raspberry Pi 4 became available.
It uses Debian mirrors for bootstrap and package delivery, contrary
to 32bit version that continues using own RaspiOs mirrors, with
packages compiled to support old (armv6) hardware.

This patchset adds RaspiOS Bullseye configs to build Isar for
all three possible hardware options:
- for Raspberry Pi 1, Pi Zero, Pi Zero W, and Compute Module;
- for Raspberry Pi 2, Pi 3, Pi 3+, and Compute Module 3;
- for Raspberry Pi 4 (32 bit);
- for Raspberry Pi 4 (64 bit).

Changes since v1:
- Rebased on top of testsuite/iMX6 patchsets;
- Small corrections in commit messages.

Changes since v2:
- Add armhf as compat arch for arm64 in raspios-bullseye distro config.

Uladzimir Bely (6):
  linux: Allow to use custom packages for linux headers and image
  rpi-sdimage: Change deployed image name.
  rpi: Added raspios-bullseye configs
  raspios: resize rootfs on first boot
  CI: Switch rpi targets to bullseye
  doc: Add notes about raspios-bullseye

 RECIPE-API-CHANGELOG.md                       |  9 ++++
 doc/user_manual.md                            |  8 +++
 meta-isar/classes/rpi-sdimg.bbclass           |  2 +-
 .../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 | 50 +++++++++++++++++++
 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/classes/image.bbclass                    |  3 +-
 .../linux-module/files/debian/control.tmpl    |  4 +-
 meta/recipes-kernel/linux-module/module.inc   | 29 ++++++++---
 meta/recipes-kernel/linux/linux-distro.bb     |  4 ++
 testsuite/build_test/build_test.py            |  7 ++-
 23 files changed, 220 insertions(+), 12 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

-- 
2.20.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v3 1/6] linux: Allow to use custom packages for linux headers and image
  2022-01-19  6:58 [PATCH v3 0/6] Update rpi targets to bullseye Uladzimir Bely
@ 2022-01-19  6:58 ` Uladzimir Bely
  2022-01-19  6:58 ` [PATCH v3 2/6] rpi-sdimage: Change deployed image name Uladzimir Bely
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Uladzimir Bely @ 2022-01-19  6:58 UTC (permalink / raw)
  To: isar-users

Some distros like recent Raspbian may not provide packages named
'linux-image-${KERNEL_NAME}' and 'linux-image-${KERNEL_NAME}' and
use some custom namings.

This patch adds support of such distro-provided package name for packages
containing linux image and linux headers.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 RECIPE-API-CHANGELOG.md                                |  9 +++++++++
 meta/classes/image.bbclass                             |  3 ++-
 .../linux-module/files/debian/control.tmpl             |  4 ++--
 meta/recipes-kernel/linux-module/module.inc            | 10 ++++++----
 meta/recipes-kernel/linux/linux-distro.bb              |  4 ++++
 5 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
index b8f1d2ba..34b43985 100644
--- a/RECIPE-API-CHANGELOG.md
+++ b/RECIPE-API-CHANGELOG.md
@@ -322,3 +322,12 @@ share the same location for image *.manifest and *.dpkg_status files, so they
 are not owerwritten by last build ones anymore.
 
 Output file names now include distro name and architecture/machine name parts.
+
+### Using custom package name for linux kernel and headers
+
+Isar assumes that linux kernel is provided by linux-image-${KERNEL_NAME}
+package, while headers are provided by linux-image-${KERNEL_NAME} package.
+This naming may be different in other distributions like Raspberry Pi OS.
+
+KERNEL_IMAGE_PKG and KERNEL_HEADERS_PKG variables allow to use custom package
+names for kernel/headers.
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 30e92555..6d77243c 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -15,7 +15,8 @@ IMAGE_INSTALL ?= ""
 IMAGE_FSTYPES ?= "${@ d.getVar("IMAGE_TYPE", True) if d.getVar("IMAGE_TYPE", True) else "ext4-img"}"
 IMAGE_ROOTFS ?= "${WORKDIR}/rootfs"
 
-IMAGE_INSTALL += "${@ ("linux-image-" + d.getVar("KERNEL_NAME", True)) if d.getVar("KERNEL_NAME", True) else ""}"
+KERNEL_IMAGE_PKG ??= "${@ ("linux-image-" + d.getVar("KERNEL_NAME", True)) if d.getVar("KERNEL_NAME", True) else ""}"
+IMAGE_INSTALL += "${KERNEL_IMAGE_PKG}"
 
 # Name of the image including distro&machine names
 IMAGE_FULLNAME = "${PN}-${DISTRO}-${MACHINE}"
diff --git a/meta/recipes-kernel/linux-module/files/debian/control.tmpl b/meta/recipes-kernel/linux-module/files/debian/control.tmpl
index 3b3292d9..d3f4dfe9 100644
--- a/meta/recipes-kernel/linux-module/files/debian/control.tmpl
+++ b/meta/recipes-kernel/linux-module/files/debian/control.tmpl
@@ -2,10 +2,10 @@ Source: ${PN}
 Section: kernel
 Priority: optional
 Standards-Version: 3.9.6
-Build-Depends: linux-headers-${KERNEL_NAME}
+Build-Depends: ${KERNEL_HEADERS_PKG}
 Maintainer: ISAR project <isar-users@googlegroups.com>
 
 Package: ${PN}
 Architecture: any
-Depends: linux-image-${KERNEL_NAME}, kmod
+Depends: ${KERNEL_IMAGE_PKG}, kmod
 Description: ${DESCRIPTION}
diff --git a/meta/recipes-kernel/linux-module/module.inc b/meta/recipes-kernel/linux-module/module.inc
index 0515621a..fecc5b3c 100644
--- a/meta/recipes-kernel/linux-module/module.inc
+++ b/meta/recipes-kernel/linux-module/module.inc
@@ -13,7 +13,9 @@ KERNEL_NAME ?= ""
 
 PN .= "-${KERNEL_NAME}"
 
-DEPENDS += "linux-headers-${KERNEL_NAME}"
+KERNEL_IMAGE_PKG ??= "linux-image-${KERNEL_NAME}"
+KERNEL_HEADERS_PKG ??= "linux-headers-${KERNEL_NAME}"
+DEPENDS += "${KERNEL_HEADERS_PKG}"
 
 SRC_URI += "file://debian/"
 
@@ -23,7 +25,7 @@ inherit dpkg
 
 TEMPLATE_FILES = "debian/control.tmpl \
                   debian/changelog.tmpl"
-TEMPLATE_VARS += "KERNEL_NAME"
+TEMPLATE_VARS += "KERNEL_IMAGE_PKG KERNEL_HEADERS_PKG"
 
 do_prepare_build() {
     cp -r ${WORKDIR}/debian ${S}/
@@ -35,12 +37,12 @@ do_prepare_build() {
 
 dpkg_runbuild_prepend() {
     # Custom kernels contain the build folder directly.
-    export KDIR=$(dpkg -L --root=${BUILDCHROOT_DIR} linux-headers-${KERNEL_NAME} | \
+    export KDIR=$(dpkg -L --root=${BUILDCHROOT_DIR} ${KERNEL_HEADERS_PKG} | \
                   grep "/lib/modules/.*/build")
     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 \
-                     linux-headers-${KERNEL_NAME} | sed 's/.*\(linux-headers-[[:graph:]]*\).*/\1/')
+                     ${KERNEL_HEADERS_PKG} | sed 's/.*\(linux-headers-[[:graph:]]*\).*/\1/')
         export KDIR=$(dpkg -L --root=${BUILDCHROOT_DIR} ${KERNEL_DEP} | \
                       grep "/lib/modules/.*/build")
     fi
diff --git a/meta/recipes-kernel/linux/linux-distro.bb b/meta/recipes-kernel/linux/linux-distro.bb
index 2a248f80..bfc8be9f 100644
--- a/meta/recipes-kernel/linux/linux-distro.bb
+++ b/meta/recipes-kernel/linux/linux-distro.bb
@@ -10,4 +10,8 @@ python() {
     for kernel in distro_kernels.split():
         d.appendVar('PROVIDES', ' linux-image-' + kernel)
         d.appendVar('PROVIDES', ' linux-headers-' + kernel)
+    if d.getVar('KERNEL_IMAGE_PKG', True):
+        d.appendVar('PROVIDES', ' ' + d.getVar('KERNEL_IMAGE_PKG', True))
+    if d.getVar('KERNEL_HEADERS_PKG', True):
+        d.appendVar('PROVIDES', ' ' + d.getVar('KERNEL_HEADERS_PKG', True))
 }
-- 
2.20.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v3 2/6] rpi-sdimage: Change deployed image name.
  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 ` Uladzimir Bely
  2022-01-19  6:58 ` [PATCH v3 3/6] rpi: Added raspios-bullseye configs Uladzimir Bely
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Uladzimir Bely @ 2022-01-19  6:58 UTC (permalink / raw)
  To: isar-users

This allows to avoid conflicts in deploy directory if multiconfigs for
different distro versions are run in parallel with one bitbake.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 meta-isar/classes/rpi-sdimg.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta-isar/classes/rpi-sdimg.bbclass b/meta-isar/classes/rpi-sdimg.bbclass
index 4e5d170d..1efc1c40 100644
--- a/meta-isar/classes/rpi-sdimg.bbclass
+++ b/meta-isar/classes/rpi-sdimg.bbclass
@@ -14,7 +14,7 @@ BOOT_SPACE ?= "40960"
 # Set alignment to 4MB [in KiB]
 IMAGE_ROOTFS_ALIGNMENT = "4096"
 
-SDIMG = "${DEPLOY_DIR_IMAGE}/${PN}.rpi-sdimg"
+SDIMG = "${DEPLOY_DIR_IMAGE}/${IMAGE_FULLNAME}.sdimg"
 SDIMG_ROOTFS = "${DEPLOY_DIR_IMAGE}/${EXT4_IMAGE_FILE}"
 
 do_rpi_sdimg () {
-- 
2.20.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v3 3/6] rpi: Added raspios-bullseye configs
  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
  2022-01-19  6:59 ` [PATCH v3 4/6] raspios: resize rootfs on first boot Uladzimir Bely
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Uladzimir Bely @ 2022-01-19  6:58 UTC (permalink / raw)
  To: isar-users

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v3 4/6] raspios: resize rootfs on first boot
  2022-01-19  6:58 [PATCH v3 0/6] Update rpi targets to bullseye Uladzimir Bely
                   ` (2 preceding siblings ...)
  2022-01-19  6:58 ` [PATCH v3 3/6] rpi: Added raspios-bullseye configs Uladzimir Bely
@ 2022-01-19  6:59 ` Uladzimir Bely
  2022-01-28 21:13   ` Henning Schild
  2022-01-19  6:59 ` [PATCH v3 5/6] CI: Switch rpi targets to bullseye Uladzimir Bely
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 11+ messages in thread
From: Uladzimir Bely @ 2022-01-19  6:59 UTC (permalink / raw)
  To: isar-users

Initially, after rpi-sdimg is created, a quite small rootfs partition
is created. After boot, there is almost no free space.

This patch uses scripts (idea is taken from official raspbian distro)
that make rootfs partition expanded at first boot.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 meta-isar/conf/distro/raspios-configscript.sh | 23 ++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/meta-isar/conf/distro/raspios-configscript.sh b/meta-isar/conf/distro/raspios-configscript.sh
index 6120a379..9a7c43e6 100644
--- a/meta-isar/conf/distro/raspios-configscript.sh
+++ b/meta-isar/conf/distro/raspios-configscript.sh
@@ -19,7 +19,7 @@ EOF
 cat > /boot/cmdline.txt << EOF
 console=${MACHINE_SERIAL},${BAUDRATE_TTY} console=tty1 \
 root=/dev/mmcblk0p2 rootfstype=ext4 fsck.repair=yes \
-rootwait quiet
+rootwait quiet init=/usr/lib/raspi-config/init_resize.sh
 EOF
 
 cat > /etc/fstab << EOF
@@ -27,3 +27,24 @@ proc            /proc           proc    defaults          0       0
 /dev/mmcblk0p1  /boot           vfat    defaults          0       2
 /dev/mmcblk0p2  /               ext4    defaults,noatime  0       1
 EOF
+
+cat > /etc/init.d/resize2fs_once << EOF
+#!/bin/sh
+. /lib/lsb/init-functions
+case "\$1" in
+  start)
+    log_daemon_msg "Starting resize2fs_once"
+    ROOT_DEV=\$(findmnt / -o source -n) &&
+    resize2fs \$ROOT_DEV &&
+    update-rc.d resize2fs_once remove &&
+    rm /etc/init.d/resize2fs_once &&
+    log_end_msg \$?
+    ;;
+  *)
+    echo "Usage: \$0 start" >&2
+    exit 3
+    ;;
+esac
+EOF
+chmod +x /etc/init.d/resize2fs_once
+ln -s ../init.d/resize2fs_once /etc/rc3.d/S01resize2fs_once
-- 
2.20.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v3 5/6] CI: Switch rpi targets to bullseye
  2022-01-19  6:58 [PATCH v3 0/6] Update rpi targets to bullseye Uladzimir Bely
                   ` (3 preceding siblings ...)
  2022-01-19  6:59 ` [PATCH v3 4/6] raspios: resize rootfs on first boot Uladzimir Bely
@ 2022-01-19  6:59 ` 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
  6 siblings, 0 replies; 11+ messages in thread
From: Uladzimir Bely @ 2022-01-19  6:59 UTC (permalink / raw)
  To: isar-users

Update rpi-stretch targets from raspbian-stretch to current
rpi-bullseye.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 testsuite/build_test/build_test.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/testsuite/build_test/build_test.py b/testsuite/build_test/build_test.py
index 77324ddf..683aa55d 100644
--- a/testsuite/build_test/build_test.py
+++ b/testsuite/build_test/build_test.py
@@ -65,7 +65,7 @@ class CrossTest(CIBaseTest):
             'mc:qemuarm64-bullseye:isar-image-base',
             'mc:de0-nano-soc-bullseye:isar-image-base',
             'mc:stm32mp15x-buster:isar-image-base',
-            'mc:rpi-stretch:isar-image-base'
+            'mc:rpi-arm-v7-bullseye:isar-image-base'
                   ]
 
         self.perform_build_test(targets, 1, None)
@@ -128,7 +128,10 @@ class NoCrossTest(CIBaseTest):
             'mc:sifive-fu540-sid-ports:isar-image-base',
             'mc:imx6-sabrelite-bullseye:isar-image-ubi',
             'mc:phyboard-mira-bullseye:isar-image-ubi',
-            'mc:rpi-stretch:isar-image-base',
+            'mc:rpi-arm-bullseye:isar-image-base',
+            'mc:rpi-arm-v7-bullseye:isar-image-base',
+            'mc:rpi-arm-v7l-bullseye:isar-image-base',
+            'mc:rpi-arm64-v8-bullseye:isar-image-base',
             'mc:hikey-bullseye:isar-image-base',
             'mc:virtualbox-bullseye:isar-image-base',
             'mc:bananapi-bullseye:isar-image-base',
-- 
2.20.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v3 6/6] doc: Add notes about raspios-bullseye
  2022-01-19  6:58 [PATCH v3 0/6] Update rpi targets to bullseye Uladzimir Bely
                   ` (4 preceding siblings ...)
  2022-01-19  6:59 ` [PATCH v3 5/6] CI: Switch rpi targets to bullseye Uladzimir Bely
@ 2022-01-19  6:59 ` Uladzimir Bely
  2022-01-27 15:01 ` [PATCH v3 0/6] Update rpi targets to bullseye Anton Mikanovich
  6 siblings, 0 replies; 11+ messages in thread
From: Uladzimir Bely @ 2022-01-19  6:59 UTC (permalink / raw)
  To: isar-users

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 doc/user_manual.md | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/doc/user_manual.md b/doc/user_manual.md
index caaab8cc..4d4fa763 100644
--- a/doc/user_manual.md
+++ b/doc/user_manual.md
@@ -53,6 +53,7 @@ configurations:
  - QEMU amd64 with Debian Stretch
  - QEMU amd64 with Debian Buster
  - Raspberry Pi 1 Model B with Raspbian Stretch
+ - Raspberry Pi various models with Raspberry OS Bullseye
  - Banana Pi BPI-M1
  - LeMaker HiKey
  - Terasic DE0-Nano-SoC
@@ -432,6 +433,7 @@ In Isar, each machine can use its specific Linux distro to generate `buildchroot
  - debian-stretch
  - debian-buster
  - raspbian-stretch
+ - raspios-bullseye
 
 User can select appropriate distro for specific machine by setting the following variable in machine configuration file:
 ```
@@ -492,6 +494,12 @@ DISTRO_CONFIG_SCRIPT?= "raspbian-configscript.sh"
 DISTRO_KERNELS ?= "rpi rpi2 rpi-rpfv rpi2-rpfv"
 ```
 
+For RaspiOS a different DISTRO_KERNELS list is used:
+ - `kernel` - for Raspberry Pi 1, Pi Zero, Pi Zero W, and Compute Module
+ - `kernel7` - for Raspberry Pi 2, Pi 3, Pi 3+, and Compute Module 3
+ - `kernel7l` - for Raspberry Pi 4 (32 bit OS)
+ - `kernel8` - for Raspberry Pi 4 (64 bit OS)
+
 To add new distro, user should perform the following steps:
 
  - Create `distro` folder in your layer:
-- 
2.20.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 0/6] Update rpi targets to bullseye
  2022-01-19  6:58 [PATCH v3 0/6] Update rpi targets to bullseye Uladzimir Bely
                   ` (5 preceding siblings ...)
  2022-01-19  6:59 ` [PATCH v3 6/6] doc: Add notes about raspios-bullseye Uladzimir Bely
@ 2022-01-27 15:01 ` Anton Mikanovich
  6 siblings, 0 replies; 11+ messages in thread
From: Anton Mikanovich @ 2022-01-27 15:01 UTC (permalink / raw)
  To: Uladzimir Bely, isar-users

19.01.2022 09:58, Uladzimir Bely wrote:
> This patchset adds Bullseye targets for Raspbian (Raspberry Pi OS).
>
> Since Raspbian Stretch supported by Isar, many things happend
> in Raspberry world:
> - linux-image-rpi* and linux-headers-rpi* packages are now outdated.
> They are still provided in Raspbian Buster, but only for older kernels.
> Currently, kernel images and modules are provided by the package
> `raspberrypi-kernel` and kernel headers for all kernels come with
> the package `raspberrypi-kernel-headers`
> - new Raspberry boards were released, based on three different SoCs.
> - new 64bit version or RaspiOS for Raspberry Pi 4 became available.
> It uses Debian mirrors for bootstrap and package delivery, contrary
> to 32bit version that continues using own RaspiOs mirrors, with
> packages compiled to support old (armv6) hardware.
>
> This patchset adds RaspiOS Bullseye configs to build Isar for
> all three possible hardware options:
> - for Raspberry Pi 1, Pi Zero, Pi Zero W, and Compute Module;
> - for Raspberry Pi 2, Pi 3, Pi 3+, and Compute Module 3;
> - for Raspberry Pi 4 (32 bit);
> - for Raspberry Pi 4 (64 bit).
>
> Changes since v1:
> - Rebased on top of testsuite/iMX6 patchsets;
> - Small corrections in commit messages.
>
> Changes since v2:
> - Add armhf as compat arch for arm64 in raspios-bullseye distro config.
>
> Uladzimir Bely (6):
>    linux: Allow to use custom packages for linux headers and image
>    rpi-sdimage: Change deployed image name.
>    rpi: Added raspios-bullseye configs
>    raspios: resize rootfs on first boot
>    CI: Switch rpi targets to bullseye
>    doc: Add notes about raspios-bullseye
>
>   RECIPE-API-CHANGELOG.md                       |  9 ++++
>   doc/user_manual.md                            |  8 +++
>   meta-isar/classes/rpi-sdimg.bbclass           |  2 +-
>   .../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 | 50 +++++++++++++++++++
>   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/classes/image.bbclass                    |  3 +-
>   .../linux-module/files/debian/control.tmpl    |  4 +-
>   meta/recipes-kernel/linux-module/module.inc   | 29 ++++++++---
>   meta/recipes-kernel/linux/linux-distro.bb     |  4 ++
>   testsuite/build_test/build_test.py            |  7 ++-
>   23 files changed, 220 insertions(+), 12 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
>
Applied to next, thanks.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 4/6] raspios: resize rootfs on first boot
  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
  0 siblings, 1 reply; 11+ messages in thread
From: Henning Schild @ 2022-01-28 21:13 UTC (permalink / raw)
  To: Uladzimir Bely; +Cc: isar-users

Hi,

why did you not use or extend recipes-support/expand-on-first-boot ?

Henning

Am Wed, 19 Jan 2022 07:59:00 +0100
schrieb Uladzimir Bely <ubely@ilbers.de>:

> Initially, after rpi-sdimg is created, a quite small rootfs partition
> is created. After boot, there is almost no free space.
> 
> This patch uses scripts (idea is taken from official raspbian distro)
> that make rootfs partition expanded at first boot.
> 
> Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
> ---
>  meta-isar/conf/distro/raspios-configscript.sh | 23
> ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-)
> 
> diff --git a/meta-isar/conf/distro/raspios-configscript.sh
> b/meta-isar/conf/distro/raspios-configscript.sh index
> 6120a379..9a7c43e6 100644 ---
> a/meta-isar/conf/distro/raspios-configscript.sh +++
> b/meta-isar/conf/distro/raspios-configscript.sh @@ -19,7 +19,7 @@ EOF
>  cat > /boot/cmdline.txt << EOF
>  console=${MACHINE_SERIAL},${BAUDRATE_TTY} console=tty1 \
>  root=/dev/mmcblk0p2 rootfstype=ext4 fsck.repair=yes \
> -rootwait quiet
> +rootwait quiet init=/usr/lib/raspi-config/init_resize.sh
>  EOF
>  
>  cat > /etc/fstab << EOF
> @@ -27,3 +27,24 @@ proc            /proc           proc    defaults
>        0       0 /dev/mmcblk0p1  /boot           vfat    defaults
>      0       2 /dev/mmcblk0p2  /               ext4
> defaults,noatime  0       1 EOF
> +
> +cat > /etc/init.d/resize2fs_once << EOF
> +#!/bin/sh
> +. /lib/lsb/init-functions
> +case "\$1" in
> +  start)
> +    log_daemon_msg "Starting resize2fs_once"
> +    ROOT_DEV=\$(findmnt / -o source -n) &&
> +    resize2fs \$ROOT_DEV &&
> +    update-rc.d resize2fs_once remove &&
> +    rm /etc/init.d/resize2fs_once &&
> +    log_end_msg \$?
> +    ;;
> +  *)
> +    echo "Usage: \$0 start" >&2
> +    exit 3
> +    ;;
> +esac
> +EOF
> +chmod +x /etc/init.d/resize2fs_once
> +ln -s ../init.d/resize2fs_once /etc/rc3.d/S01resize2fs_once


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 4/6] raspios: resize rootfs on first boot
  2022-01-28 21:13   ` Henning Schild
@ 2022-01-29  5:57     ` Uladzimir Bely
  2022-01-31  7:43       ` Henning Schild
  0 siblings, 1 reply; 11+ messages in thread
From: Uladzimir Bely @ 2022-01-29  5:57 UTC (permalink / raw)
  To: Henning Schild; +Cc: isar-users

In the email from суббота, 29 января 2022 г. 00:13:43 +03 user Henning Schild 
wrote:
> Hi,
> 
> why did you not use or extend recipes-support/expand-on-first-boot ?
> 
> Henning
> 
Hello.

I tried to follow the approach raspios uses. First boot expansion is done this 
way in official distribution, so I just ported this part.

But you are right, while we have our own implementation (I just forgot about 
it), it is worth using it.

I've just tried to revert this commit and enable `expand-on-first-boot` recipe 
in local.conf - and it seems to be working. After first boot `df` shows that 
2nd partition is expanded ant all free space is available.

Also, 'raspi-config' utility (that allows to expand partition manually) 
remains working. So, even if user doesn't enable this recipe, they still can 
do it via this utility.

So, it seems, we can remove this commit in favour of the existing recipe and 
it doesn't bring any problems.

By the way, `expand-on-first-boot` recipe looks like something that is not 
tested at all. None of machine uses it by default, and it's not included to 
local.conf. Probably, that's why I didn't recall it while porting RPi.

Why not enable it at least for RPi targets?

> Am Wed, 19 Jan 2022 07:59:00 +0100
> 
> schrieb Uladzimir Bely <ubely@ilbers.de>:
> > Initially, after rpi-sdimg is created, a quite small rootfs partition
> > is created. After boot, there is almost no free space.
> > 
> > This patch uses scripts (idea is taken from official raspbian distro)
> > that make rootfs partition expanded at first boot.
> > 
> > Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
> > ---
> > 
> >  meta-isar/conf/distro/raspios-configscript.sh | 23
> > 
> > ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-)
> > 
> > diff --git a/meta-isar/conf/distro/raspios-configscript.sh
> > b/meta-isar/conf/distro/raspios-configscript.sh index
> > 6120a379..9a7c43e6 100644 ---
> > a/meta-isar/conf/distro/raspios-configscript.sh +++
> > b/meta-isar/conf/distro/raspios-configscript.sh @@ -19,7 +19,7 @@ EOF
> > 
> >  cat > /boot/cmdline.txt << EOF
> >  console=${MACHINE_SERIAL},${BAUDRATE_TTY} console=tty1 \
> >  root=/dev/mmcblk0p2 rootfstype=ext4 fsck.repair=yes \
> > 
> > -rootwait quiet
> > +rootwait quiet init=/usr/lib/raspi-config/init_resize.sh
> > 
> >  EOF
> >  
> >  cat > /etc/fstab << EOF
> > 
> > @@ -27,3 +27,24 @@ proc            /proc           proc    defaults
> > 
> >        0       0 /dev/mmcblk0p1  /boot           vfat    defaults
> >      
> >      0       2 /dev/mmcblk0p2  /               ext4
> > 
> > defaults,noatime  0       1 EOF
> > +
> > +cat > /etc/init.d/resize2fs_once << EOF
> > +#!/bin/sh
> > +. /lib/lsb/init-functions
> > +case "\$1" in
> > +  start)
> > +    log_daemon_msg "Starting resize2fs_once"
> > +    ROOT_DEV=\$(findmnt / -o source -n) &&
> > +    resize2fs \$ROOT_DEV &&
> > +    update-rc.d resize2fs_once remove &&
> > +    rm /etc/init.d/resize2fs_once &&
> > +    log_end_msg \$?
> > +    ;;
> > +  *)
> > +    echo "Usage: \$0 start" >&2
> > +    exit 3
> > +    ;;
> > +esac
> > +EOF
> > +chmod +x /etc/init.d/resize2fs_once
> > +ln -s ../init.d/resize2fs_once /etc/rc3.d/S01resize2fs_once





^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 4/6] raspios: resize rootfs on first boot
  2022-01-29  5:57     ` Uladzimir Bely
@ 2022-01-31  7:43       ` Henning Schild
  0 siblings, 0 replies; 11+ messages in thread
From: Henning Schild @ 2022-01-31  7:43 UTC (permalink / raw)
  To: Uladzimir Bely; +Cc: isar-users

Am Sat, 29 Jan 2022 08:57:22 +0300
schrieb Uladzimir Bely <ubely@ilbers.de>:

> In the email from суббота, 29 января 2022 г. 00:13:43 +03 user
> Henning Schild wrote:
> > Hi,
> > 
> > why did you not use or extend recipes-support/expand-on-first-boot ?
> > 
> > Henning
> >   
> Hello.
> 
> I tried to follow the approach raspios uses. First boot expansion is
> done this way in official distribution, so I just ported this part.

In fact the recipe is heavily inspired by raspi, IIRC.

> But you are right, while we have our own implementation (I just
> forgot about it), it is worth using it.
> 
> I've just tried to revert this commit and enable
> `expand-on-first-boot` recipe in local.conf - and it seems to be
> working. After first boot `df` shows that 2nd partition is expanded
> ant all free space is available.
> 
> Also, 'raspi-config' utility (that allows to expand partition
> manually) remains working. So, even if user doesn't enable this
> recipe, they still can do it via this utility.
> 
> So, it seems, we can remove this commit in favour of the existing
> recipe and it doesn't bring any problems.

I guess that would be the way to go. Unless we can find the original in
any real package. But smuggling things in not using a package is not
the best style ... might also be the style that raspi uses to build
their images.

> By the way, `expand-on-first-boot` recipe looks like something that
> is not tested at all. None of machine uses it by default, and it's
> not included to local.conf. Probably, that's why I didn't recall it
> while porting RPi.

It is tested/used in many layers, some i know even extend it for other
filesystems. But yes it should be tested in isar, given it has been
upstreamed into isar by someone.

> Why not enable it at least for RPi targets?

Sounds like a very good idea. Maybe even with a testcase to check "df"
and that "raspi-config" remains working.

regards,
Henning

> > Am Wed, 19 Jan 2022 07:59:00 +0100
> > 
> > schrieb Uladzimir Bely <ubely@ilbers.de>:  
> > > Initially, after rpi-sdimg is created, a quite small rootfs
> > > partition is created. After boot, there is almost no free space.
> > > 
> > > This patch uses scripts (idea is taken from official raspbian
> > > distro) that make rootfs partition expanded at first boot.
> > > 
> > > Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
> > > ---
> > > 
> > >  meta-isar/conf/distro/raspios-configscript.sh | 23
> > > 
> > > ++++++++++++++++++- 1 file changed, 22 insertions(+), 1
> > > deletion(-)
> > > 
> > > diff --git a/meta-isar/conf/distro/raspios-configscript.sh
> > > b/meta-isar/conf/distro/raspios-configscript.sh index
> > > 6120a379..9a7c43e6 100644 ---
> > > a/meta-isar/conf/distro/raspios-configscript.sh +++
> > > b/meta-isar/conf/distro/raspios-configscript.sh @@ -19,7 +19,7 @@
> > > EOF
> > > 
> > >  cat > /boot/cmdline.txt << EOF
> > >  console=${MACHINE_SERIAL},${BAUDRATE_TTY} console=tty1 \
> > >  root=/dev/mmcblk0p2 rootfstype=ext4 fsck.repair=yes \
> > > 
> > > -rootwait quiet
> > > +rootwait quiet init=/usr/lib/raspi-config/init_resize.sh
> > > 
> > >  EOF
> > >  
> > >  cat > /etc/fstab << EOF
> > > 
> > > @@ -27,3 +27,24 @@ proc            /proc           proc
> > > defaults
> > > 
> > >        0       0 /dev/mmcblk0p1  /boot           vfat    defaults
> > >      
> > >      0       2 /dev/mmcblk0p2  /               ext4
> > > 
> > > defaults,noatime  0       1 EOF
> > > +
> > > +cat > /etc/init.d/resize2fs_once << EOF
> > > +#!/bin/sh
> > > +. /lib/lsb/init-functions
> > > +case "\$1" in
> > > +  start)
> > > +    log_daemon_msg "Starting resize2fs_once"
> > > +    ROOT_DEV=\$(findmnt / -o source -n) &&
> > > +    resize2fs \$ROOT_DEV &&
> > > +    update-rc.d resize2fs_once remove &&
> > > +    rm /etc/init.d/resize2fs_once &&
> > > +    log_end_msg \$?
> > > +    ;;
> > > +  *)
> > > +    echo "Usage: \$0 start" >&2
> > > +    exit 3
> > > +    ;;
> > > +esac
> > > +EOF
> > > +chmod +x /etc/init.d/resize2fs_once
> > > +ln -s ../init.d/resize2fs_once /etc/rc3.d/S01resize2fs_once  
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-01-31  7:43 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH v3 3/6] rpi: Added raspios-bullseye configs Uladzimir Bely
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox