[isar-cip-core][RFC][PATCH 09/10] swupdate: Activate abvar initramfs hook when VAR_FS_TYPE is set to btrfs

Jan Kiszka
2025-01-30T09:39:29Z

This enables to control whether an swupdate target image uses A/B
snapshots for /var by setting VAR_FS_TYPE to btrfs. While we will switch
many of our own targets soon, not all are compatible or tested yet and
some downstream users may want to continue without snapshots.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
kas/opt/ebg-swu.yml | 6 +++++-
recipes-initramfs/cip-core-initramfs/cip-core-initramfs.bb | 3 ++-
2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/kas/opt/ebg-swu.yml b/kas/opt/ebg-swu.yml
index 61a8eeef..9084cea1 100644
--- a/kas/opt/ebg-swu.yml
+++ b/kas/opt/ebg-swu.yml
@@ -1,7 +1,7 @@
#
# CIP Core, generic profile
#
-# Copyright (c) Siemens AG, 2021-2022
+# Copyright (c) Siemens AG, 2021-2025
#
# Authors:
# Quirin Gylstorff <quirin.gylstorff@siemens.com>
@@ -33,3 +33,7 @@ local_conf_header:
IMAGER_BUILD_DEPS:append:qemu-arm64 = " u-boot-qemu-arm64"
IMAGER_BUILD_DEPS:append:qemu-arm = " u-boot-qemu-arm"
IMAGER_BUILD_DEPS:append:qemu-riscv64 = " opensbi-qemu-riscv64"
+ ab-persistency: |
+ OVERRIDES .= "${@':abvar' if d.getVar('VAR_FS_TYPE') == 'btrfs' else ''}"
+ CRYPT_BTRFS_SUPPORT:abvar = "1"
+ IMAGE_PREINSTALL:append:abvar = " btrfs-progs"
diff --git a/recipes-initramfs/cip-core-initramfs/cip-core-initramfs.bb b/recipes-initramfs/cip-core-initramfs/cip-core-initramfs.bb
index 0e4cf743..e6eb34c6 100644
--- a/recipes-initramfs/cip-core-initramfs/cip-core-initramfs.bb
+++ b/recipes-initramfs/cip-core-initramfs/cip-core-initramfs.bb
@@ -1,7 +1,7 @@
#
# CIP Core, generic profile
#
-# Copyright (c) Siemens AG, 2021 - 2023
+# Copyright (c) Siemens AG, 2021 - 2025
#
# Authors:
# Quirin Gylstorff <quirin.gylstorff@siemens.com>
@@ -15,4 +15,5 @@ INITRAMFS_INSTALL += " \
initramfs-overlay-hook \
"

+INITRAMFS_INSTALL:append:abvar = " initramfs-abvar-hook"
INITRAMFS_INSTALL:append:encrypt-partitions = " initramfs-crypt-hook"
--
2.43.0