From patchwork Wed Oct 30 11:51:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 13856417 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id AAA82D5CCA6 for ; Wed, 30 Oct 2024 11:52:02 +0000 (UTC) Received: from mta-64-228.siemens.flowmailer.net (mta-64-228.siemens.flowmailer.net [185.136.64.228]) by mx.groups.io with SMTP id smtpd.web10.13027.1730289112085161662 for ; Wed, 30 Oct 2024 04:51:53 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=jan.kiszka@siemens.com header.s=fm1 header.b=H4/TRmJg; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.64.228, mailfrom: fm-294854-202410301151486cd81627cc9a4dad47-_ttyqn@rts-flowmailer.siemens.com) Received: by mta-64-228.siemens.flowmailer.net with ESMTPSA id 202410301151486cd81627cc9a4dad47 for ; Wed, 30 Oct 2024 12:51:49 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=jan.kiszka@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:References:In-Reply-To; bh=y+wQn2Z49zpMpksHHOpRRL6r5tdWj4PNXhC1RMS8VJg=; b=H4/TRmJgHYKYGcHXGOaPAsKtnQSL9xpmNYq+OyXOcy9hEzYsDR1X2c2I+Aaore7yLEB15m sl7sfRQeVCYPq2EOL1JZMRY2289PL2vzYC0isVy/XwfPk4HGOauhTgj/6QKMFkOjLfETGoDL gobVOaoqeXidNEt5HQUYmVC8gkf86D+CdoAobJZkqfP62jnI4Tbhaej/x8I7hmjUtSGu5gU6 JMW9o2nGmAqnSdKs+SzSPLE3gyDzPqe0Y5LJqQrDI7t6MAvAJPpDqoZPQcFpfLfO0pmNy5TT 9uk0cWLt3UgcIgHWVFux8Ru/av6b0k85vQ1hZHZXdfOePM1vI1+V3t3Q==; From: Jan Kiszka To: cip-dev@lists.cip-project.org Subject: [isar-cip-core][PATCH 1/6] Make the read-only rootfs type configurable Date: Wed, 30 Oct 2024 12:51:42 +0100 Message-ID: <3ab00a7235d5cc5c359b91566e69745a06f966a0.1730289107.git.jan.kiszka@siemens.com> In-Reply-To: References: MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-294854:519-21489:flowmailer List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 30 Oct 2024 11:52:02 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/17114 From: Jan Kiszka 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 --- 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 @@ -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 @@ -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 From patchwork Wed Oct 30 11:51:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 13856413 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D15BD5CCA1 for ; Wed, 30 Oct 2024 11:52:02 +0000 (UTC) Received: from mta-64-225.siemens.flowmailer.net (mta-64-225.siemens.flowmailer.net [185.136.64.225]) by mx.groups.io with SMTP id smtpd.web10.13031.1730289112374603917 for ; Wed, 30 Oct 2024 04:51:53 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=jan.kiszka@siemens.com header.s=fm1 header.b=cOuJ/1iU; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.64.225, mailfrom: fm-294854-2024103011514845d440c439d7561268-_w352j@rts-flowmailer.siemens.com) Received: by mta-64-225.siemens.flowmailer.net with ESMTPSA id 2024103011514845d440c439d7561268 for ; Wed, 30 Oct 2024 12:51:49 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=jan.kiszka@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:References:In-Reply-To; bh=pK4kW9n2z4bSx5ictR4RWHtfPhit6l7yJqd490jd7ds=; b=cOuJ/1iUaopZXqbzXsqBS5TdOyGx7OUXmkrtKIUU8Yr4aX2PbceM7AuWlIdoodKAJ1AnGw uwcunXPPwaoYMAkp2iyexjcO9CumzuETJ3IS7fo/tqb3iyalXX1rf6jq67PAaS99vOCqmvuj 48ojru9FLA77fGNonIuJN8kyh/lBub8TY3fTUA0ZZUduJWYC02M5KYkjNiuy/p4aJczRSlql UopSAqzm/DOvRu6wuG1Fj29u9IVaZW3kBWdfUgTCuuAX0R+9THFk2GKAzICPS3jDMhlSY+6O NNTEE5NJ/BhGUXcUzhjGfZKjdbjbB3wqWokJmMPK8Y0y4ezgIzZFd/TA==; From: Jan Kiszka To: cip-dev@lists.cip-project.org Subject: [isar-cip-core][PATCH 2/6] initramfs-crypt-hook: Prepare for EROFS as alternative Date: Wed, 30 Oct 2024 12:51:43 +0100 Message-ID: <06b38b36d50fde5940935c0de3bf0b83a6b72579.1730289107.git.jan.kiszka@siemens.com> In-Reply-To: References: MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-294854:519-21489:flowmailer List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 30 Oct 2024 11:52:02 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/17117 From: Jan Kiszka Naturally, expansion does not make sense for it as well. Signed-off-by: Jan Kiszka --- .../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 From patchwork Wed Oct 30 11:51:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 13856416 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D188D5CCA5 for ; Wed, 30 Oct 2024 11:52:02 +0000 (UTC) Received: from mta-64-227.siemens.flowmailer.net (mta-64-227.siemens.flowmailer.net [185.136.64.227]) by mx.groups.io with SMTP id smtpd.web10.13028.1730289112085338746 for ; Wed, 30 Oct 2024 04:51:53 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=jan.kiszka@siemens.com header.s=fm1 header.b=Ri83ZFNl; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.64.227, mailfrom: fm-294854-2024103011514870580dd306e78806e8-lsfwc1@rts-flowmailer.siemens.com) Received: by mta-64-227.siemens.flowmailer.net with ESMTPSA id 2024103011514870580dd306e78806e8 for ; Wed, 30 Oct 2024 12:51:49 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=jan.kiszka@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:References:In-Reply-To; bh=WvEqAuXwIQ2S497lUaErWZV8xCSS6/lqKvgULM7A6Vg=; b=Ri83ZFNlb9vH9w+NWCDBpE0eytvQURoduUP5cqZLEkqiXxeGsfbvgT7ueoW/KBup2U/Oe8 9MheCAAJvfPHTOdLasCfRhsg2zMkcQNN4tuse6REL4m+aM/T+7o0AuWz+kyQowo3bnMsPHdi 034Rdc/hP2N5V+IZaogHE6webWnAkMjTsOkQ80uZVrb4Txj4gihxwwKof2izlMVeexu/HoE6 F+9usHbh2zq55s5cjK3GiDGxE10hc9Qb7+UTUU/WrIzYqKgEY7wCF6hwm38Jal3fYadh8hA8 iP1z/kkpkCL6ATGsdB5ftfEtSfkNsjXfVQXsQcs1kXXJE5GMI4RIRowg==; From: Jan Kiszka To: cip-dev@lists.cip-project.org Subject: [isar-cip-core][PATCH 3/6] Add initramfs-erofs-hook Date: Wed, 30 Oct 2024 12:51:44 +0100 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-294854:519-21489:flowmailer List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 30 Oct 2024 11:52:02 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/17118 From: Jan Kiszka This is basically just search&replace compared to initramfs-squashfs-hook. Signed-off-by: Jan Kiszka --- .../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 +# + +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 +# +# 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" +} From patchwork Wed Oct 30 11:51:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 13856411 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B837D5CC9F for ; Wed, 30 Oct 2024 11:52:02 +0000 (UTC) Received: from mta-64-227.siemens.flowmailer.net (mta-64-227.siemens.flowmailer.net [185.136.64.227]) by mx.groups.io with SMTP id smtpd.web10.13029.1730289112154326742 for ; Wed, 30 Oct 2024 04:51:53 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=jan.kiszka@siemens.com header.s=fm1 header.b=Rm25rWqw; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.64.227, mailfrom: fm-294854-2024103011514882bdc9aa06945078ff-mqbckq@rts-flowmailer.siemens.com) Received: by mta-64-227.siemens.flowmailer.net with ESMTPSA id 2024103011514882bdc9aa06945078ff for ; Wed, 30 Oct 2024 12:51:49 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=jan.kiszka@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:References:In-Reply-To; bh=C/qE2qA5tkrq901SoP3YsbCp3k88TsrG0Wdw9UCMFig=; b=Rm25rWqwjXMzr2eDwYgNwlMazJgjFpy+EjH3Xrty99AVxKKfSNfIYV/idWbyHJbcaeZbzv fxp1RS/nOVirxxQ6B/4RMtwC9QUWS1bkzvy6KJZmeseUZlxT03R3NAedMRmFAHBCK1Nijy/B BlMi2J6pTu7ktoRUBCLI9lO4qz/HUPqiu2Vg3rktOiR8rxJaqGH5suLM6oZSsPDjPKYqwuGK 9lipbRkaVeQhtqoNU7Cb11iwePwIZde454NiBwntLoyn+ZWedSn6pMdgqmjERZRgWk2Z87eY +2kfRpGc3zT8NXlAgLUn6SLBQi1lj6LN7A7Jz+Lip7ALzNA5OSZjVXyg==; From: Jan Kiszka To: cip-dev@lists.cip-project.org Subject: [isar-cip-core][PATCH 4/6] Introduce class for generating EROFS images Date: Wed, 30 Oct 2024 12:51:45 +0100 Message-ID: <9e610c58e64d927b450fc246f5a271268c5c4d03.1730289107.git.jan.kiszka@siemens.com> In-Reply-To: References: MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-294854:519-21489:flowmailer List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 30 Oct 2024 11:52:02 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/17113 From: Jan Kiszka This is analogous to the squashfs class. Signed-off-by: Jan Kiszka --- 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 +# +# 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" From patchwork Wed Oct 30 11:51:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 13856415 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A7E2D5CCA8 for ; Wed, 30 Oct 2024 11:52:02 +0000 (UTC) Received: from mta-65-225.siemens.flowmailer.net (mta-65-225.siemens.flowmailer.net [185.136.65.225]) by mx.groups.io with SMTP id smtpd.web11.12872.1730289112353330534 for ; Wed, 30 Oct 2024 04:51:53 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=jan.kiszka@siemens.com header.s=fm1 header.b=QCXHi1/q; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.65.225, mailfrom: fm-294854-20241030115149cedfeefedf6d9b0284-_e3mso@rts-flowmailer.siemens.com) Received: by mta-65-225.siemens.flowmailer.net with ESMTPSA id 20241030115149cedfeefedf6d9b0284 for ; Wed, 30 Oct 2024 12:51:49 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=jan.kiszka@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:References:In-Reply-To; bh=K9nOK9xzQEq6avm0mlePSoGEWN4tgBKY5SOvbHXGsu4=; b=QCXHi1/q/VyWtiEJYbaJfRcVJ+dq5EyjFS1pJDnG/7gt+HtNDcxGphqBbN19DJBf3ODap9 DnnHLqKdMbjtn5h1fuPPjJ/IuAUegesdqK7scHm68aie5s4at59IR95ZUAoNKP23WS/QICib rl3VPoQxBlCJYnyft+EV7OI6A0GJKwmkc1dgXvA/HCTnuZ16KZ3i55oUGOWIZOUJ+VhKRLp9 xrH2171TSab/ZkKJnEThmbV+dL5lYcY5AMQTyMZmGipWQXqFGC/IU+Bx5SWlPdKkkQgjhSKp wZG/cWHaLs0OMAb/6QDfciVGdVIV0TcOr1UpL6M2RlG5Yg3wpGDDpO2Q==; From: Jan Kiszka To: cip-dev@lists.cip-project.org Subject: [isar-cip-core][PATCH 5/6] linux-cip: Update cip-kernel-config revision Date: Wed, 30 Oct 2024 12:51:46 +0100 Message-ID: <90a003078be88c2b963a7ace4ad7841639c8effd.1730289107.git.jan.kiszka@siemens.com> In-Reply-To: References: MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-294854:519-21489:flowmailer List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 30 Oct 2024 11:52:02 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/17115 From: Jan Kiszka This brings support for EROFS and PID namespaces for 6.1 and also fixes Ethernet configuration on BeagleBone Black. Signed-off-by: Jan Kiszka --- 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..4e1cacc2 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 ?= "c3c5f08d24dc05f7dd20d29d6337e00aad190093" do_fetch[vardeps] += "SRCREV_cip-kernel-config" From patchwork Wed Oct 30 11:51:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 13856412 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6DD52D5CCA0 for ; Wed, 30 Oct 2024 11:52:02 +0000 (UTC) Received: from mta-65-225.siemens.flowmailer.net (mta-65-225.siemens.flowmailer.net [185.136.65.225]) by mx.groups.io with SMTP id smtpd.web10.13030.1730289112364198584 for ; Wed, 30 Oct 2024 04:51:53 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=jan.kiszka@siemens.com header.s=fm1 header.b=aAA7iOix; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.65.225, mailfrom: fm-294854-202410301151493982eecc4406d2bffa-uhj96f@rts-flowmailer.siemens.com) Received: by mta-65-225.siemens.flowmailer.net with ESMTPSA id 202410301151493982eecc4406d2bffa for ; Wed, 30 Oct 2024 12:51:49 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=jan.kiszka@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:References:In-Reply-To; bh=vBYcazKv1rot7s1PkcKNQ7wnLUdoeBObFtZTwQ7MZEY=; b=aAA7iOixTVjcYhMS1qHaU/r1JQC6jHM35nmIP8H3TGcQxJDZnwiHnOVgudWkdduIzRXz5L F2TyAwk1qzEVacBLoT0L8UP2Yqestoe5QF7Ik6DxYkRfbKvXpkPqVXGRXzAGz/T04OTmoKG+ gADRSq1PvYHNTq5n+O8NkFgz1bcMBzVc1fb2ixVb2vmbwf7OesMJzzEWOCLhGAQWYfAX4DtJ 4BiGeRoIfp6CQfP8XaWXJCW/0pUd2K2nu+gIu3aEhM3e0/sRK6/nYRYaNW8H0afZYKul3vzG FVg2UtJp2oKWDgB7e8cbWWytfsfupr8A5BTnzGM9EN6ppHjrytB6buSg==; From: Jan Kiszka To: cip-dev@lists.cip-project.org Subject: [isar-cip-core][PATCH 6/6] kas: Add option for selecting read-only rootfs type Date: Wed, 30 Oct 2024 12:51:47 +0100 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-294854:519-21489:flowmailer List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 30 Oct 2024 11:52:02 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/17116 From: Jan Kiszka 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 --- 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 +# +# SPDX-License-Identifier: MIT + +header: + version: 14 + +local_conf_header: + erofs: | + RO_ROOTFS_TYPE = "erofs"