[2/2] add EFI boot version of nanopi-neo target

Message ID 20230914074226.3018960-3-felix.moessbauer@siemens.com
State Superseded, archived
Headers show
Series add bookworm versions of nanopi-neo | expand

Commit Message

MOESSBAUER, Felix Sept. 14, 2023, 7:42 a.m. UTC
This patch adds the nanopi-neo-efi machine that implements the EFI boot
chain on the nanopi-neo board. This is only supported from debian
bookworm on, as a more recent u-boot version is required (2021.01 which
is shipped in bullseye does not work).

The EFI boot pattern later can be used to support mechanisms like
swupdate.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 meta-isar/conf/machine/nanopi-neo-efi.conf        | 13 +++++++++++++
 .../conf/multiconfig/nanopi-neo-efi-bookworm.conf |  5 +++++
 .../lib/wic/canned-wks/nanopi-neo-efi.wks.in      | 15 +++++++++++++++
 testsuite/citest.py                               |  1 +
 4 files changed, 34 insertions(+)
 create mode 100644 meta-isar/conf/machine/nanopi-neo-efi.conf
 create mode 100644 meta-isar/conf/multiconfig/nanopi-neo-efi-bookworm.conf
 create mode 100644 meta-isar/scripts/lib/wic/canned-wks/nanopi-neo-efi.wks.in

Patch

diff --git a/meta-isar/conf/machine/nanopi-neo-efi.conf b/meta-isar/conf/machine/nanopi-neo-efi.conf
new file mode 100644
index 00000000..1878c3cc
--- /dev/null
+++ b/meta-isar/conf/machine/nanopi-neo-efi.conf
@@ -0,0 +1,13 @@ 
+# This software is a part of ISAR.
+# Copyright (c) Siemens AG, 2023
+#
+# SPDX-License-Identifier: MIT
+
+DISTRO_ARCH ?= "armhf"
+
+KERNEL_NAME ?= "armmp"
+
+IMAGE_FSTYPES ?= "wic"
+WKS_FILE ?= "nanopi-neo-efi.wks.in"
+
+IMAGER_INSTALL += "u-boot-sunxi ${SYSTEMD_BOOTLOADER_INSTALL}"
diff --git a/meta-isar/conf/multiconfig/nanopi-neo-efi-bookworm.conf b/meta-isar/conf/multiconfig/nanopi-neo-efi-bookworm.conf
new file mode 100644
index 00000000..02daf94f
--- /dev/null
+++ b/meta-isar/conf/multiconfig/nanopi-neo-efi-bookworm.conf
@@ -0,0 +1,5 @@ 
+# This software is a part of ISAR.
+# Copyright (C) 2023 Siemens AG
+
+MACHINE ?= "nanopi-neo-efi"
+DISTRO ?= "debian-bookworm"
diff --git a/meta-isar/scripts/lib/wic/canned-wks/nanopi-neo-efi.wks.in b/meta-isar/scripts/lib/wic/canned-wks/nanopi-neo-efi.wks.in
new file mode 100644
index 00000000..7171a23e
--- /dev/null
+++ b/meta-isar/scripts/lib/wic/canned-wks/nanopi-neo-efi.wks.in
@@ -0,0 +1,15 @@ 
+#
+# Copyright (c) Siemens AG, 2023
+#
+# SPDX-License-Identifier: MIT
+
+# Newer SoCs (tested on H2+, A64, H5, H6) can also load the SPL from sector 256 (128KB)
+# of an SD card or eMMC, if no valid eGON/TOC0 signature is found at 8KB. This is required
+# to not overlap with the GPT header.
+# https://linux-sunxi.org/Bootable_SD_card#SD_Card_Layout
+part u-boot --source rawcopy --sourceparams "file=/usr/lib/u-boot/nanopi_neo/u-boot-sunxi-with-spl.bin" --no-table --align 128
+
+part /boot --use-uuid --source bootimg-efi-isar --sourceparams="loader=systemd-boot" --label efi --part-type EF00 --align 1024
+part /     --use-uuid --source rootfs --fstype=ext4 --mkfs-extraopts "-T default" --label platform --active --align 1024 --exclude-path boot
+
+bootloader --ptable gpt --timeout 0 --append "rootwait"
diff --git a/testsuite/citest.py b/testsuite/citest.py
index 73dddaf3..5e8299d6 100755
--- a/testsuite/citest.py
+++ b/testsuite/citest.py
@@ -134,6 +134,7 @@  class CrossTest(CIBaseTest):
             'mc:qemuarm-bookworm:isar-image-ci',
             'mc:qemuarm64-bookworm:isar-image-ci',
             'mc:qemuarm64-focal:isar-image-base',
+            'mc:nanopi-neo-efi-bookworm:isar-image-base',
                   ]
 
         self.init()