From: Jan Kiszka <jan.kiszka@...>
We only needs to add the related wks file and configure the EBG watchdog
timeout to 0, and then also this target can gain support for A/B rootfs
SWUpdate with EFI Boot Guard as switcher.
Note that some extra kernel parameters are needed so that the omap_wdt
is properly taken over by the kernel from U-Boot but without petting it
too early during boot. This must only be done once userspace open the
device and signals real system readiness.
Signed-off-by: Jan Kiszka <jan.kiszka@...>
---
Kconfig | 2 +-
conf/machine/bbb.conf | 3 +++
wic/bbb-efibootguard.wks.in | 21 +++++++++++++++++++++
3 files changed, 25 insertions(+), 1 deletion(-)
create mode 100644 wic/bbb-efibootguard.wks.in
diff --git a/Kconfig b/Kconfig
index c63000b..d87e0a6 100644
--- a/Kconfig
+++ b/Kconfig
@@ -132,7 +132,7 @@ if IMAGE_FLASH && !KERNEL_4_4 && !KERNEL_4_19
config IMAGE_SWUPDATE
bool "SWUpdate support for root partition"
- depends on TARGET_QEMU_AMD64 || TARGET_SIMATIC_IPC227E || TARGET_QEMU_ARM64 || TARGET_QEMU_ARM
+ depends on TARGET_QEMU_AMD64 || TARGET_SIMATIC_IPC227E || TARGET_QEMU_ARM64 || TARGET_QEMU_ARM || TARGET_BBB
config IMAGE_SECURE_BOOT
bool "Secure boot support"
diff --git a/conf/machine/bbb.conf b/conf/machine/bbb.conf
index eaec5a3..c8b4aaa 100644
--- a/conf/machine/bbb.conf
+++ b/conf/machine/bbb.conf
@@ -18,4 +18,7 @@ IMAGE_INSTALL += "u-boot-script"
USE_CIP_KERNEL_CONFIG = "1"
KERNEL_DEFCONFIG = "cip-kernel-config/${KERNEL_DEFCONFIG_VERSION}/arm/cip_bbb_defconfig"
+# for SWUpdate setups: watchdog is configured in U-Boot
+WDOG_TIMEOUT = "0"
+
PREFERRED_PROVIDER_u-boot-${MACHINE} = "u-boot-bbb"
diff --git a/wic/bbb-efibootguard.wks.in b/wic/bbb-efibootguard.wks.in
new file mode 100644
index 0000000..e48cc7f
--- /dev/null
+++ b/wic/bbb-efibootguard.wks.in
@@ -0,0 +1,21 @@
+#
+# CIP Core, generic profile
+#
+# Copyright (c) Siemens AG, 2019-2022
+#
+# SPDX-License-Identifier: MIT
+#
+
+part --source rawcopy --sourceparams "file=/usr/lib/u-boot/bbb/MLO" --no-table --align 128
+part --source rawcopy --sourceparams "file=/usr/lib/u-boot/bbb/u-boot.img" --no-table --align 384
+
+include ebg-sysparts.inc
+
+part --source rawcopy --sourceparams "file=${IMAGE_FULLNAME}.squashfs" --align 1024 --fixed-size 1G --uuid "fedcba98-7654-3210-cafe-5e0710000001"
+part --source rawcopy --sourceparams "file=${IMAGE_FULLNAME}.squashfs" --align 1024 --fixed-size 1G --uuid "fedcba98-7654-3210-cafe-5e0710000002"
+
+# home and var are extra partitions
+part /home --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/home --fstype=ext4 --label home --align 1024 --size 1G
+part /var --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/var --fstype=ext4 --label var --align 1024 --size 2G
+
+bootloader --ptable gpt --append="rootwait console=ttyO0,115200 omap_wdt.early_enable=1 omap_wdt.nowayout=1 watchdog.handle_boot_enabled=0"
--
2.35.3