* [isar-cip-core][PATCH v2 0/6] Add support for EROFS
@ 2024-11-05 17:54 Jan Kiszka
2024-11-05 17:54 ` [isar-cip-core][PATCH v2 1/6] Make the read-only rootfs type configurable Jan Kiszka
` (5 more replies)
0 siblings, 6 replies; 11+ messages in thread
From: Jan Kiszka @ 2024-11-05 17:54 UTC (permalink / raw)
To: cip-dev
Changes in v2:
- update cip-kernel-config revision further to support non-x86 qemu targets
EROFS is a read-only file system that can act as alternative to squashfs
that we so far use for our A/B OTA update setups. It can perform faster
during runtime but may come with larger storage demand. See [1] for some
comparison.
We just enabled support for it in our 6.1 defconfigs, and this series now
enable CIP core to switch from squashfs to EROFS when requested.
Jan
[1] https://sigma-star.at/blog/2022/07/squashfs-erofs
Jan Kiszka (6):
Make the read-only rootfs type configurable
initramfs-crypt-hook: Prepare for EROFS as alternative
Add initramfs-erofs-hook
Introduce class for generating EROFS images
linux-cip: Update cip-kernel-config revision
kas: Add option for selecting read-only rootfs type
Kconfig | 16 +++++++++
classes/erofs.bbclass | 34 +++++++++++++++++++
classes/swupdate.bbclass | 3 +-
classes/verity.bbclass | 2 +-
conf/distro/cip-core-common.inc | 4 ++-
conf/layer.conf | 2 +-
kas/opt/erofs.yml | 16 +++++++++
kas/opt/swupdate.yml | 8 ++---
.../files/encrypt_partition.script | 2 +-
...ook_0.2.bb => initramfs-crypt-hook_0.3.bb} | 0
.../initramfs-erofs-hook/files/erofs.hook | 25 ++++++++++++++
.../initramfs-erofs-hook_0.1.bb | 24 +++++++++++++
recipes-kernel/linux/cip-kernel-config.inc | 2 +-
wic/bbb-efibootguard.wks.in | 2 +-
wic/hihope-rzg2m-efibootguard.wks.in | 2 +-
wic/qemu-arm64-efibootguard.wks.in | 2 +-
wic/qemu-riscv64-efibootguard.wks.in | 2 +-
wic/x86-uefi-efibootguard.wks.in | 2 +-
18 files changed, 133 insertions(+), 15 deletions(-)
create mode 100644 classes/erofs.bbclass
create mode 100644 kas/opt/erofs.yml
rename recipes-initramfs/initramfs-crypt-hook/{initramfs-crypt-hook_0.2.bb => initramfs-crypt-hook_0.3.bb} (100%)
create mode 100644 recipes-initramfs/initramfs-erofs-hook/files/erofs.hook
create mode 100644 recipes-initramfs/initramfs-erofs-hook/initramfs-erofs-hook_0.1.bb
--
2.43.0
^ permalink raw reply [flat|nested] 11+ messages in thread
* [isar-cip-core][PATCH v2 1/6] Make the read-only rootfs type configurable
2024-11-05 17:54 [isar-cip-core][PATCH v2 0/6] Add support for EROFS Jan Kiszka
@ 2024-11-05 17:54 ` Jan Kiszka
2024-11-05 17:54 ` [isar-cip-core][PATCH v2 2/6] initramfs-crypt-hook: Prepare for EROFS as alternative Jan Kiszka
` (4 subsequent siblings)
5 siblings, 0 replies; 11+ messages in thread
From: Jan Kiszka @ 2024-11-05 17:54 UTC (permalink / raw)
To: cip-dev
From: Jan Kiszka <jan.kiszka@siemens.com>
We so far use squashfs here and will keep that as default. But there
will be an option in the future to select EROFS as alternative. Prepare
for that.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
classes/swupdate.bbclass | 3 ++-
classes/verity.bbclass | 2 +-
conf/distro/cip-core-common.inc | 4 +++-
kas/opt/swupdate.yml | 8 ++++----
wic/bbb-efibootguard.wks.in | 2 +-
wic/hihope-rzg2m-efibootguard.wks.in | 2 +-
wic/qemu-arm64-efibootguard.wks.in | 2 +-
wic/qemu-riscv64-efibootguard.wks.in | 2 +-
wic/x86-uefi-efibootguard.wks.in | 2 +-
9 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/classes/swupdate.bbclass b/classes/swupdate.bbclass
index 642fd795..5bf021ad 100644
--- a/classes/swupdate.bbclass
+++ b/classes/swupdate.bbclass
@@ -12,7 +12,7 @@
inherit template
-SWU_ROOTFS_TYPE ?= "squashfs"
+SWU_ROOTFS_TYPE ?= "${RO_ROOTFS_TYPE}"
SWU_ROOTFS_NAME ?= "${IMAGE_FULLNAME}"
# compression type as defined by swupdate (zlib or zstd). Set to empty string to disable compression
SWU_COMPRESSION_TYPE ?= "zlib"
@@ -55,6 +55,7 @@ IMAGE_SRC_URI:swu += "file://${SWU_DESCRIPITION_FILE_BOOTLOADER}.tmpl"
IMAGE_TEMPLATE_FILES:swu = "${SWU_DESCRIPTION_FILE}.tmpl"
IMAGE_TEMPLATE_FILES:swu += "${SWU_DESCRIPITION_FILE_BOOTLOADER}.tmpl"
IMAGE_TEMPLATE_VARS:swu = " \
+ RO_ROOTFS_TYPE \
SWU_ROOTFS_ARTIFACT_NAME \
TARGET_IMAGE_UUID \
ABROOTFS_PART_UUID_A \
diff --git a/classes/verity.bbclass b/classes/verity.bbclass
index b3aa9732..231d1729 100644
--- a/classes/verity.bbclass
+++ b/classes/verity.bbclass
@@ -12,7 +12,7 @@
IMAGE_TYPEDEP:verity = "${VERITY_IMAGE_TYPE}"
IMAGER_INSTALL:verity += "cryptsetup"
-VERITY_IMAGE_TYPE ?= "squashfs"
+VERITY_IMAGE_TYPE ?= "${RO_ROOTFS_TYPE}"
VERITY_INPUT_IMAGE ?= "${IMAGE_FULLNAME}.${VERITY_IMAGE_TYPE}"
VERITY_OUTPUT_IMAGE ?= "${IMAGE_FULLNAME}.verity"
VERITY_IMAGE_METADATA = "${VERITY_OUTPUT_IMAGE}.metadata"
diff --git a/conf/distro/cip-core-common.inc b/conf/distro/cip-core-common.inc
index 4bd4b840..3323dd0b 100644
--- a/conf/distro/cip-core-common.inc
+++ b/conf/distro/cip-core-common.inc
@@ -1,7 +1,7 @@
#
# CIP Core, generic profile
#
-# Copyright (c) Siemens AG, 2019-2023
+# Copyright (c) Siemens AG, 2019-2024
#
# Authors:
# Jan Kiszka <jan.kiszka@siemens.com>
@@ -15,6 +15,8 @@ WKS_FILE ?= "${MACHINE}.wks"
CIP_IMAGE_OPTIONS ?= ""
+RO_ROOTFS_TYPE ?= "squashfs"
+
IMAGER_BUILD_DEPS:append = " dosfstools-native"
IMAGER_BUILD_DEPS:remove:buster = "dosfstools-native"
diff --git a/kas/opt/swupdate.yml b/kas/opt/swupdate.yml
index 73982000..837efa7d 100644
--- a/kas/opt/swupdate.yml
+++ b/kas/opt/swupdate.yml
@@ -1,7 +1,7 @@
#
# CIP Core, generic profile
#
-# Copyright (c) Siemens AG, 2020
+# Copyright (c) Siemens AG, 2020-2024
#
# Authors:
# Quirin Gylstorff <quirin.gylstorff@siemens.com>
@@ -20,12 +20,12 @@ local_conf_header:
OVERRIDES .= ":swupdate"
wic-swu: |
- IMAGE_TYPEDEP:wic += "squashfs"
+ IMAGE_TYPEDEP:wic += "${RO_ROOTFS_TYPE}"
IMAGE_FSTYPES:append = " swu"
- # squashfs is already compressed
+ # input is already compressed
SWU_COMPRESSION_TYPE = ""
WKS_FILE ?= "${MACHINE}-${SWUPDATE_BOOTLOADER}.wks.in"
- INITRAMFS_INSTALL:append = " initramfs-squashfs-hook"
+ INITRAMFS_INSTALL:append = " initramfs-${RO_ROOTFS_TYPE}-hook"
ABROOTFS_PART_UUID_A ?= "fedcba98-7654-3210-cafe-5e0710000001"
ABROOTFS_PART_UUID_B ?= "fedcba98-7654-3210-cafe-5e0710000002"
PREFERRED_PROVIDER_swupdate-certificates-key ??= "swupdate-certificates-key-snakeoil"
diff --git a/wic/bbb-efibootguard.wks.in b/wic/bbb-efibootguard.wks.in
index b5772c2d..e6c3e158 100644
--- a/wic/bbb-efibootguard.wks.in
+++ b/wic/bbb-efibootguard.wks.in
@@ -11,7 +11,7 @@ part --source rawcopy --sourceparams "file=/usr/lib/u-boot/bbb/u-boot.img" --no-
include ebg-sysparts.inc
-part --source rawcopy --sourceparams "file=${IMAGE_FULLNAME}.squashfs" --align 1024 --fixed-size 1G --uuid "${ABROOTFS_PART_UUID_A}" --part-type 0FC63DAF-8483-4772-8E79-3D69D8477DE4 --part-name systema
+part --source rawcopy --sourceparams "file=${IMAGE_FULLNAME}.${RO_ROOTFS_TYPE}" --align 1024 --fixed-size 1G --uuid "${ABROOTFS_PART_UUID_A}" --part-type 0FC63DAF-8483-4772-8E79-3D69D8477DE4 --part-name systema
part --source empty --align 1024 --fixed-size 1G --uuid "${ABROOTFS_PART_UUID_B}" --part-type 0FC63DAF-8483-4772-8E79-3D69D8477DE4 --part-name systemb
# home and var are extra partitions
diff --git a/wic/hihope-rzg2m-efibootguard.wks.in b/wic/hihope-rzg2m-efibootguard.wks.in
index 164e8a92..fb3f090a 100644
--- a/wic/hihope-rzg2m-efibootguard.wks.in
+++ b/wic/hihope-rzg2m-efibootguard.wks.in
@@ -3,7 +3,7 @@
include ebg-sysparts.inc
-part --source rawcopy --sourceparams "file=${IMAGE_FULLNAME}.squashfs" --align 1024 --fixed-size 1G --uuid "${ABROOTFS_PART_UUID_A}" --part-type 0FC63DAF-8483-4772-8E79-3D69D8477DE4 --part-name systema
+part --source rawcopy --sourceparams "file=${IMAGE_FULLNAME}.${RO_ROOTFS_TYPE}" --align 1024 --fixed-size 1G --uuid "${ABROOTFS_PART_UUID_A}" --part-type 0FC63DAF-8483-4772-8E79-3D69D8477DE4 --part-name systema
part --source empty --align 1024 --fixed-size 1G --uuid "${ABROOTFS_PART_UUID_B}" --part-type 0FC63DAF-8483-4772-8E79-3D69D8477DE4 --part-name systemb
# home and var are extra partitions
diff --git a/wic/qemu-arm64-efibootguard.wks.in b/wic/qemu-arm64-efibootguard.wks.in
index 6f034208..17434d15 100644
--- a/wic/qemu-arm64-efibootguard.wks.in
+++ b/wic/qemu-arm64-efibootguard.wks.in
@@ -3,7 +3,7 @@
include ebg-sysparts.inc
-part --source rawcopy --sourceparams "file=${IMAGE_FULLNAME}.squashfs" --align 1024 --fixed-size 1G --uuid "${ABROOTFS_PART_UUID_A}" --part-type 0FC63DAF-8483-4772-8E79-3D69D8477DE4 --part-name systema
+part --source rawcopy --sourceparams "file=${IMAGE_FULLNAME}.${RO_ROOTFS_TYPE}" --align 1024 --fixed-size 1G --uuid "${ABROOTFS_PART_UUID_A}" --part-type 0FC63DAF-8483-4772-8E79-3D69D8477DE4 --part-name systema
part --source empty --align 1024 --fixed-size 1G --uuid "${ABROOTFS_PART_UUID_B}" --part-type 0FC63DAF-8483-4772-8E79-3D69D8477DE4 --part-name systemb
# home and var are extra partitions
diff --git a/wic/qemu-riscv64-efibootguard.wks.in b/wic/qemu-riscv64-efibootguard.wks.in
index 1704dede..1a2291e3 100644
--- a/wic/qemu-riscv64-efibootguard.wks.in
+++ b/wic/qemu-riscv64-efibootguard.wks.in
@@ -3,7 +3,7 @@
include ebg-sysparts.inc
-part --source rawcopy --sourceparams "file=${IMAGE_FULLNAME}.squashfs" --align 1024 --fixed-size 1G --uuid "${ABROOTFS_PART_UUID_A}" --part-type 0FC63DAF-8483-4772-8E79-3D69D8477DE4 --part-name systema
+part --source rawcopy --sourceparams "file=${IMAGE_FULLNAME}.${RO_ROOTFS_TYPE}" --align 1024 --fixed-size 1G --uuid "${ABROOTFS_PART_UUID_A}" --part-type 0FC63DAF-8483-4772-8E79-3D69D8477DE4 --part-name systema
part --source empty --align 1024 --fixed-size 1G --uuid "${ABROOTFS_PART_UUID_B}" --part-type 0FC63DAF-8483-4772-8E79-3D69D8477DE4 --part-name systemb
# home and var are extra partitions
diff --git a/wic/x86-uefi-efibootguard.wks.in b/wic/x86-uefi-efibootguard.wks.in
index a1cebc1e..9d344f8a 100644
--- a/wic/x86-uefi-efibootguard.wks.in
+++ b/wic/x86-uefi-efibootguard.wks.in
@@ -3,7 +3,7 @@
include ebg-sysparts.inc
-part --source rawcopy --sourceparams "file=${IMAGE_FULLNAME}.squashfs" --align 1024 --fixed-size 1G --uuid "${ABROOTFS_PART_UUID_A}" --part-type 0FC63DAF-8483-4772-8E79-3D69D8477DE4 --part-name systema
+part --source rawcopy --sourceparams "file=${IMAGE_FULLNAME}.${RO_ROOTFS_TYPE}" --align 1024 --fixed-size 1G --uuid "${ABROOTFS_PART_UUID_A}" --part-type 0FC63DAF-8483-4772-8E79-3D69D8477DE4 --part-name systema
part --source empty --align 1024 --fixed-size 1G --uuid "${ABROOTFS_PART_UUID_B}" --part-type 0FC63DAF-8483-4772-8E79-3D69D8477DE4 --part-name systemb
# home and var are extra partitions
--
2.43.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [isar-cip-core][PATCH v2 2/6] initramfs-crypt-hook: Prepare for EROFS as alternative
2024-11-05 17:54 [isar-cip-core][PATCH v2 0/6] Add support for EROFS Jan Kiszka
2024-11-05 17:54 ` [isar-cip-core][PATCH v2 1/6] Make the read-only rootfs type configurable Jan Kiszka
@ 2024-11-05 17:54 ` Jan Kiszka
2024-11-05 17:54 ` [isar-cip-core][PATCH v2 3/6] Add initramfs-erofs-hook Jan Kiszka
` (3 subsequent siblings)
5 siblings, 0 replies; 11+ messages in thread
From: Jan Kiszka @ 2024-11-05 17:54 UTC (permalink / raw)
To: cip-dev
From: Jan Kiszka <jan.kiszka@siemens.com>
Naturally, expansion does not make sense for it as well.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
.../initramfs-crypt-hook/files/encrypt_partition.script | 2 +-
...{initramfs-crypt-hook_0.2.bb => initramfs-crypt-hook_0.3.bb} | 0
2 files changed, 1 insertion(+), 1 deletion(-)
rename recipes-initramfs/initramfs-crypt-hook/{initramfs-crypt-hook_0.2.bb => initramfs-crypt-hook_0.3.bb} (100%)
diff --git a/recipes-initramfs/initramfs-crypt-hook/files/encrypt_partition.script b/recipes-initramfs/initramfs-crypt-hook/files/encrypt_partition.script
index ff4c1353..2cd6798d 100644
--- a/recipes-initramfs/initramfs-crypt-hook/files/encrypt_partition.script
+++ b/recipes-initramfs/initramfs-crypt-hook/files/encrypt_partition.script
@@ -82,7 +82,7 @@ EOF
panic "reencryption of filesystem $1 cannot continue!"
fi
;;
- squashfs|swap|"")
+ squashfs|swap|erofs|"")
[ "$debug" = "y" ] && echo "skip disk resize as it is not supported or unnecessary for fstype: '$partition_fstype'"
;;
*)
diff --git a/recipes-initramfs/initramfs-crypt-hook/initramfs-crypt-hook_0.2.bb b/recipes-initramfs/initramfs-crypt-hook/initramfs-crypt-hook_0.3.bb
similarity index 100%
rename from recipes-initramfs/initramfs-crypt-hook/initramfs-crypt-hook_0.2.bb
rename to recipes-initramfs/initramfs-crypt-hook/initramfs-crypt-hook_0.3.bb
--
2.43.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [isar-cip-core][PATCH v2 3/6] Add initramfs-erofs-hook
2024-11-05 17:54 [isar-cip-core][PATCH v2 0/6] Add support for EROFS Jan Kiszka
2024-11-05 17:54 ` [isar-cip-core][PATCH v2 1/6] Make the read-only rootfs type configurable Jan Kiszka
2024-11-05 17:54 ` [isar-cip-core][PATCH v2 2/6] initramfs-crypt-hook: Prepare for EROFS as alternative Jan Kiszka
@ 2024-11-05 17:54 ` Jan Kiszka
2024-11-05 17:54 ` [isar-cip-core][PATCH v2 4/6] Introduce class for generating EROFS images Jan Kiszka
` (2 subsequent siblings)
5 siblings, 0 replies; 11+ messages in thread
From: Jan Kiszka @ 2024-11-05 17:54 UTC (permalink / raw)
To: cip-dev
From: Jan Kiszka <jan.kiszka@siemens.com>
This is basically just search&replace compared to
initramfs-squashfs-hook.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
.../initramfs-erofs-hook/files/erofs.hook | 25 +++++++++++++++++++
.../initramfs-erofs-hook_0.1.bb | 24 ++++++++++++++++++
2 files changed, 49 insertions(+)
create mode 100644 recipes-initramfs/initramfs-erofs-hook/files/erofs.hook
create mode 100644 recipes-initramfs/initramfs-erofs-hook/initramfs-erofs-hook_0.1.bb
diff --git a/recipes-initramfs/initramfs-erofs-hook/files/erofs.hook b/recipes-initramfs/initramfs-erofs-hook/files/erofs.hook
new file mode 100644
index 00000000..cf43bf10
--- /dev/null
+++ b/recipes-initramfs/initramfs-erofs-hook/files/erofs.hook
@@ -0,0 +1,25 @@
+#!/bin/sh
+#
+# CIP Core, generic profile
+#
+# Copyright (c) Siemens AG, 2024
+#
+# Authors:
+# Jan Kiszka <jan.kiszka@siemens.com>
+#
+
+PREREQ=""
+prereqs()
+{
+ echo "$PREREQ"
+}
+case $1 in
+prereqs)
+ prereqs
+ exit 0
+ ;;
+esac
+
+. /usr/share/initramfs-tools/hook-functions
+
+manual_add_modules erofs
diff --git a/recipes-initramfs/initramfs-erofs-hook/initramfs-erofs-hook_0.1.bb b/recipes-initramfs/initramfs-erofs-hook/initramfs-erofs-hook_0.1.bb
new file mode 100644
index 00000000..ab679c91
--- /dev/null
+++ b/recipes-initramfs/initramfs-erofs-hook/initramfs-erofs-hook_0.1.bb
@@ -0,0 +1,24 @@
+#
+# CIP Core, generic profile
+#
+# Copyright (c) Siemens AG, 2024
+#
+# Authors:
+# Jan Kiszka <jan.kiszka@siemens.com>
+#
+# SPDX-License-Identifier: MIT
+#
+
+inherit dpkg-raw
+
+SRC_URI += "file://erofs.hook"
+
+DEBIAN_DEPENDS = "erofs-utils"
+
+do_install[cleandirs] += " \
+ ${D}/usr/share/initramfs-tools/hooks"
+
+do_install() {
+ install -m 0755 "${WORKDIR}/erofs.hook" \
+ "${D}/usr/share/initramfs-tools/hooks/erofs"
+}
--
2.43.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [isar-cip-core][PATCH v2 4/6] Introduce class for generating EROFS images
2024-11-05 17:54 [isar-cip-core][PATCH v2 0/6] Add support for EROFS Jan Kiszka
` (2 preceding siblings ...)
2024-11-05 17:54 ` [isar-cip-core][PATCH v2 3/6] Add initramfs-erofs-hook Jan Kiszka
@ 2024-11-05 17:54 ` Jan Kiszka
2024-11-05 17:54 ` [isar-cip-core][PATCH v2 5/6] linux-cip: Update cip-kernel-config revision Jan Kiszka
2024-11-05 17:54 ` [isar-cip-core][PATCH v2 6/6] kas: Add option for selecting read-only rootfs type Jan Kiszka
5 siblings, 0 replies; 11+ messages in thread
From: Jan Kiszka @ 2024-11-05 17:54 UTC (permalink / raw)
To: cip-dev
From: Jan Kiszka <jan.kiszka@siemens.com>
This is analogous to the squashfs class.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
classes/erofs.bbclass | 34 ++++++++++++++++++++++++++++++++++
conf/layer.conf | 2 +-
2 files changed, 35 insertions(+), 1 deletion(-)
create mode 100644 classes/erofs.bbclass
diff --git a/classes/erofs.bbclass b/classes/erofs.bbclass
new file mode 100644
index 00000000..95e7be35
--- /dev/null
+++ b/classes/erofs.bbclass
@@ -0,0 +1,34 @@
+#
+# CIP Core, generic profile
+#
+# Copyright (c) Siemens AG, 2024
+#
+# Authors:
+# Jan Kiszka <jan.kiszka@siemens.com>
+#
+# SPDX-License-Identifier: MIT
+#
+
+IMAGER_INSTALL:erofs += "erofs-utils"
+
+EROFS_EXCLUDE_DIRS ?= ""
+EROFS_CONTENT ?= "${PP_ROOTFS}"
+EROFS_CREATION_ARGS ?= "-z lz4hc,12"
+
+python __anonymous() {
+ exclude_directories = d.getVar('EROFS_EXCLUDE_DIRS').split()
+ if len(exclude_directories) == 0:
+ return
+ # Use regex to exclude only content of the directory.
+ # This allows to use the directory as a mount point.
+ for dir in exclude_directories:
+ args += " --exclude-regex {dir}/.* ".format(dir=dir)
+ d.appendVar('EROFS_CREATION_ARGS', args)
+}
+
+IMAGE_CMD:erofs[depends] = "${PN}:do_transform_template"
+IMAGE_CMD:erofs() {
+ ${SUDO_CHROOT} /bin/mkfs.erofs \
+ '${IMAGE_FILE_CHROOT}' '${EROFS_CONTENT}' \
+ ${EROFS_CREATION_ARGS}
+}
diff --git a/conf/layer.conf b/conf/layer.conf
index c652a61c..316f4a81 100644
--- a/conf/layer.conf
+++ b/conf/layer.conf
@@ -23,5 +23,5 @@ LAYERSERIES_COMPAT_cip-core = "next"
LAYERDIR_cip-core = "${LAYERDIR}"
LAYERDIR_cip-core[vardepvalue] = "isar-cip-core"
-IMAGE_CLASSES += "squashfs verity swupdate delta-update"
+IMAGE_CLASSES += "squashfs erofs verity swupdate delta-update"
--
2.43.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [isar-cip-core][PATCH v2 5/6] linux-cip: Update cip-kernel-config revision
2024-11-05 17:54 [isar-cip-core][PATCH v2 0/6] Add support for EROFS Jan Kiszka
` (3 preceding siblings ...)
2024-11-05 17:54 ` [isar-cip-core][PATCH v2 4/6] Introduce class for generating EROFS images Jan Kiszka
@ 2024-11-05 17:54 ` Jan Kiszka
2024-11-05 17:54 ` [isar-cip-core][PATCH v2 6/6] kas: Add option for selecting read-only rootfs type Jan Kiszka
5 siblings, 0 replies; 11+ messages in thread
From: Jan Kiszka @ 2024-11-05 17:54 UTC (permalink / raw)
To: cip-dev
From: Jan Kiszka <jan.kiszka@siemens.com>
This brings support for EROFS and PID namespaces for 6.1 and also fixes
Ethernet configuration on BeagleBone Black.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
recipes-kernel/linux/cip-kernel-config.inc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/recipes-kernel/linux/cip-kernel-config.inc b/recipes-kernel/linux/cip-kernel-config.inc
index 9c1ab946..16821319 100644
--- a/recipes-kernel/linux/cip-kernel-config.inc
+++ b/recipes-kernel/linux/cip-kernel-config.inc
@@ -14,6 +14,6 @@ SRC_URI:append = " ${@ \
if d.getVar('USE_CIP_KERNEL_CONFIG') == '1' else '' \
}"
-SRCREV_cip-kernel-config ?= "f6b7018cb6845f34f8a03c126bf4f823ce10d637"
+SRCREV_cip-kernel-config ?= "9b1b425c87248ba476e3a3aff3c9f905abdb3982"
do_fetch[vardeps] += "SRCREV_cip-kernel-config"
--
2.43.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [isar-cip-core][PATCH v2 6/6] kas: Add option for selecting read-only rootfs type
2024-11-05 17:54 [isar-cip-core][PATCH v2 0/6] Add support for EROFS Jan Kiszka
` (4 preceding siblings ...)
2024-11-05 17:54 ` [isar-cip-core][PATCH v2 5/6] linux-cip: Update cip-kernel-config revision Jan Kiszka
@ 2024-11-05 17:54 ` Jan Kiszka
2024-11-07 6:31 ` [isar-cip-core][PATCH v3 " Jan Kiszka
5 siblings, 1 reply; 11+ messages in thread
From: Jan Kiszka @ 2024-11-05 17:54 UTC (permalink / raw)
To: cip-dev
From: Jan Kiszka <jan.kiszka@siemens.com>
This allows to select EROFS as alternative to squashfs. The option is
limited to 6.1 kernels, older ones will no longer be enabled.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
Kconfig | 16 ++++++++++++++++
kas/opt/erofs.yml | 16 ++++++++++++++++
2 files changed, 32 insertions(+)
create mode 100644 kas/opt/erofs.yml
diff --git a/Kconfig b/Kconfig
index 8062cdb7..83f2c2f6 100644
--- a/Kconfig
+++ b/Kconfig
@@ -198,6 +198,22 @@ config IMAGE_DELTA_SWUPDATE
endchoice
+choice
+ prompt "Read-only rootfs type"
+
+config IMAGE_RO_ROOTFS_SQUASHFS
+ bool "Squashfs"
+
+config IMAGE_RO_ROOTFS_EROFS
+ bool "EROFS"
+ depends on KERNEL_6_1
+
+endchoice
+
+config KAS_INCLUDE_EROFS
+ string
+ default "kas/opt/erofs.yml" if IMAGE_RO_ROOTFS_EROFS
+
config IMAGE_SECURE_BOOT
bool "Secure boot support"
depends on TARGET_QEMU_AMD64 || TARGET_QEMU_ARM64 || TARGET_QEMU_ARM || TARGET_X86_UEFI
diff --git a/kas/opt/erofs.yml b/kas/opt/erofs.yml
new file mode 100644
index 00000000..7c44f5b8
--- /dev/null
+++ b/kas/opt/erofs.yml
@@ -0,0 +1,16 @@
+#
+# CIP Core, generic profile
+#
+# Copyright (c) Siemens AG, 2024
+#
+# Authors:
+# Jan Kiszka <jan.kiszka@siemens.com>
+#
+# SPDX-License-Identifier: MIT
+
+header:
+ version: 14
+
+local_conf_header:
+ erofs: |
+ RO_ROOTFS_TYPE = "erofs"
--
2.43.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [isar-cip-core][PATCH v3 6/6] kas: Add option for selecting read-only rootfs type
2024-11-05 17:54 ` [isar-cip-core][PATCH v2 6/6] kas: Add option for selecting read-only rootfs type Jan Kiszka
@ 2024-11-07 6:31 ` Jan Kiszka
2024-11-15 5:55 ` Gao Xiang
0 siblings, 1 reply; 11+ messages in thread
From: Jan Kiszka @ 2024-11-07 6:31 UTC (permalink / raw)
To: cip-dev
From: Jan Kiszka <jan.kiszka@siemens.com>
This allows to select EROFS as alternative to squashfs. The option is
limited to 6.1 kernels, older ones will no longer be enabled. Debian
buster lacked the required erofs-utils package, and bullseye seems to
generate filesystems that are not detected by kernel 6.1. Therefore,
limit support to bookworm+.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
Changes in v3:
- exclude buster and bullseye
Kconfig | 16 ++++++++++++++++
kas/opt/erofs.yml | 16 ++++++++++++++++
2 files changed, 32 insertions(+)
create mode 100644 kas/opt/erofs.yml
diff --git a/Kconfig b/Kconfig
index 8062cdb7..d10ae917 100644
--- a/Kconfig
+++ b/Kconfig
@@ -198,6 +198,22 @@ config IMAGE_DELTA_SWUPDATE
endchoice
+choice
+ prompt "Read-only rootfs type"
+
+config IMAGE_RO_ROOTFS_SQUASHFS
+ bool "Squashfs"
+
+config IMAGE_RO_ROOTFS_EROFS
+ bool "EROFS"
+ depends on KERNEL_6_1 && !DEBIAN_BUSTER && !DEBIAN_BULLSEYE
+
+endchoice
+
+config KAS_INCLUDE_EROFS
+ string
+ default "kas/opt/erofs.yml" if IMAGE_RO_ROOTFS_EROFS
+
config IMAGE_SECURE_BOOT
bool "Secure boot support"
depends on TARGET_QEMU_AMD64 || TARGET_QEMU_ARM64 || TARGET_QEMU_ARM || TARGET_X86_UEFI
diff --git a/kas/opt/erofs.yml b/kas/opt/erofs.yml
new file mode 100644
index 00000000..7c44f5b8
--- /dev/null
+++ b/kas/opt/erofs.yml
@@ -0,0 +1,16 @@
+#
+# CIP Core, generic profile
+#
+# Copyright (c) Siemens AG, 2024
+#
+# Authors:
+# Jan Kiszka <jan.kiszka@siemens.com>
+#
+# SPDX-License-Identifier: MIT
+
+header:
+ version: 14
+
+local_conf_header:
+ erofs: |
+ RO_ROOTFS_TYPE = "erofs"
--
2.43.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [isar-cip-core][PATCH v3 6/6] kas: Add option for selecting read-only rootfs type
2024-11-07 6:31 ` [isar-cip-core][PATCH v3 " Jan Kiszka
@ 2024-11-15 5:55 ` Gao Xiang
2024-11-15 7:01 ` Jan Kiszka
0 siblings, 1 reply; 11+ messages in thread
From: Gao Xiang @ 2024-11-15 5:55 UTC (permalink / raw)
To: Jan Kiszka, cip-dev
Hi Jan,
On 2024/11/7 14:31, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> This allows to select EROFS as alternative to squashfs. The option is
> limited to 6.1 kernels, older ones will no longer be enabled. Debian
> buster lacked the required erofs-utils package, and bullseye seems to
> generate filesystems that are not detected by kernel 6.1. Therefore,
Thanks for the effort!
Could you give some hints of this case? Is there some reproduce
steps so I could look into that?
bullseye uses erofs-utils 1.2, and I think kernel 6.1 supports
all images generated by old userspace versions.
Thanks,
Gao Xiang
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [isar-cip-core][PATCH v3 6/6] kas: Add option for selecting read-only rootfs type
2024-11-15 5:55 ` Gao Xiang
@ 2024-11-15 7:01 ` Jan Kiszka
2024-11-15 7:18 ` Gao Xiang
0 siblings, 1 reply; 11+ messages in thread
From: Jan Kiszka @ 2024-11-15 7:01 UTC (permalink / raw)
To: Gao Xiang, cip-dev
On 15.11.24 06:55, Gao Xiang wrote:
> Hi Jan,
>
> On 2024/11/7 14:31, Jan Kiszka wrote:
>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>
>> This allows to select EROFS as alternative to squashfs. The option is
>> limited to 6.1 kernels, older ones will no longer be enabled. Debian
>> buster lacked the required erofs-utils package, and bullseye seems to
>> generate filesystems that are not detected by kernel 6.1. Therefore,
>
> Thanks for the effort!
>
> Could you give some hints of this case? Is there some reproduce
> steps so I could look into that?
$ kas-container shell kas-cip.yml:kas/opt/bullseye.yml:kas/opt/6.1.yml:kas/opt/ebg-swu.yml:kas/opt/erofs.yml:kas/board/qemu-amd64.yml
$ DISTRO_RELEASE=bullseye ./start-qemu.sh amd64 -global ICH9-LPC.noreboot=on
>
> bullseye uses erofs-utils 1.2, and I think kernel 6.1 supports
> all images generated by old userspace versions.
>
I've looked into the issue again, and it is related to our abroot
selection script. That one does
blkid -p /dev/sda4 -s USAGE -o value
[1] and does not get "filesystem" back with bullseye for erofs. Given
that bullseye is in maintenance and erofs is a new feature, I see not
much value in addressing that. But thanks for your interest!
Jan
[1] https://gitlab.com/cip-project/cip-core/isar-cip-core/-/blob/master/recipes-initramfs/initramfs-abrootfs-hook/files/abrootfs.script?ref_type=heads#L36
--
Siemens AG, Technology
Linux Expert Center
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [isar-cip-core][PATCH v3 6/6] kas: Add option for selecting read-only rootfs type
2024-11-15 7:01 ` Jan Kiszka
@ 2024-11-15 7:18 ` Gao Xiang
0 siblings, 0 replies; 11+ messages in thread
From: Gao Xiang @ 2024-11-15 7:18 UTC (permalink / raw)
To: Jan Kiszka, cip-dev
On 2024/11/15 15:01, Jan Kiszka wrote:
> On 15.11.24 06:55, Gao Xiang wrote:
>> Hi Jan,
>>
>> On 2024/11/7 14:31, Jan Kiszka wrote:
>>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>>
>>> This allows to select EROFS as alternative to squashfs. The option is
>>> limited to 6.1 kernels, older ones will no longer be enabled. Debian
>>> buster lacked the required erofs-utils package, and bullseye seems to
>>> generate filesystems that are not detected by kernel 6.1. Therefore,
>>
>> Thanks for the effort!
>>
>> Could you give some hints of this case? Is there some reproduce
>> steps so I could look into that?
>
> $ kas-container shell kas-cip.yml:kas/opt/bullseye.yml:kas/opt/6.1.yml:kas/opt/ebg-swu.yml:kas/opt/erofs.yml:kas/board/qemu-amd64.yml
> $ DISTRO_RELEASE=bullseye ./start-qemu.sh amd64 -global ICH9-LPC.noreboot=on
>
>>
>> bullseye uses erofs-utils 1.2, and I think kernel 6.1 supports
>> all images generated by old userspace versions.
>>
>
> I've looked into the issue again, and it is related to our abroot
> selection script. That one does
>
> blkid -p /dev/sda4 -s USAGE -o value
>
> [1] and does not get "filesystem" back with bullseye for erofs. Given
> that bullseye is in maintenance and erofs is a new feature, I see not
> much value in addressing that. But thanks for your interest!
Ok, good to hear that as long as it's not an image compatibility
issue!
Thanks,
Gao Xiang
>
> Jan
>
> [1] https://gitlab.com/cip-project/cip-core/isar-cip-core/-/blob/master/recipes-initramfs/initramfs-abrootfs-hook/files/abrootfs.script?ref_type=heads#L36
>
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2024-11-25 13:01 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-05 17:54 [isar-cip-core][PATCH v2 0/6] Add support for EROFS Jan Kiszka
2024-11-05 17:54 ` [isar-cip-core][PATCH v2 1/6] Make the read-only rootfs type configurable Jan Kiszka
2024-11-05 17:54 ` [isar-cip-core][PATCH v2 2/6] initramfs-crypt-hook: Prepare for EROFS as alternative Jan Kiszka
2024-11-05 17:54 ` [isar-cip-core][PATCH v2 3/6] Add initramfs-erofs-hook Jan Kiszka
2024-11-05 17:54 ` [isar-cip-core][PATCH v2 4/6] Introduce class for generating EROFS images Jan Kiszka
2024-11-05 17:54 ` [isar-cip-core][PATCH v2 5/6] linux-cip: Update cip-kernel-config revision Jan Kiszka
2024-11-05 17:54 ` [isar-cip-core][PATCH v2 6/6] kas: Add option for selecting read-only rootfs type Jan Kiszka
2024-11-07 6:31 ` [isar-cip-core][PATCH v3 " Jan Kiszka
2024-11-15 5:55 ` Gao Xiang
2024-11-15 7:01 ` Jan Kiszka
2024-11-15 7:18 ` Gao Xiang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox