From patchwork Tue Aug 9 10:40:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quirin Gylstorff X-Patchwork-Id: 12939510 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 48087C25B06 for ; Tue, 9 Aug 2022 10:41:07 +0000 (UTC) Received: from mta-65-227.siemens.flowmailer.net (mta-65-227.siemens.flowmailer.net [185.136.65.227]) by mx.groups.io with SMTP id smtpd.web11.10148.1660041663825269685 for ; Tue, 09 Aug 2022 03:41:04 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=Quirin.Gylstorff@siemens.com header.s=fm2 header.b=DU5p+QVM; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.65.227, mailfrom: fm-51332-20220809104101bd79614653da6c8dcf-hj2wzv@rts-flowmailer.siemens.com) Received: by mta-65-227.siemens.flowmailer.net with ESMTPSA id 20220809104101bd79614653da6c8dcf for ; Tue, 09 Aug 2022 12:41:01 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm2; d=siemens.com; i=Quirin.Gylstorff@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:References:In-Reply-To; bh=VlOXG/2MQt6xDfveB9xqYhPHIJLYVOQnh1F+HpYHZ7k=; b=DU5p+QVMjoUuu3/LgqAqSdmVxNV2s7gKFSlXp7R9cacGM/KBia4ICIhUvBYR8eDFr+CQyt QKPLBlNlPzBqMR8FfQiXoSLkBuyFN1L7N9ysWG/1GiAJhEzZUkj4ofsdrMURK/9KqxghG2cv YIIJtWjrubogK/t/PKvw7WSkXBcqU=; From: Quirin Gylstorff To: jan.kiszka@siemens.com, cip-dev@lists.cip-project.org Subject: [cip-dev][isar-cip-core][PATCH v4 1/3] kas: Remove efibootguard.yml Date: Tue, 9 Aug 2022 12:40:58 +0200 Message-Id: <20220809104100.469265-2-Quirin.Gylstorff@siemens.com> In-Reply-To: <20220809104100.469265-1-Quirin.Gylstorff@siemens.com> References: <20220809104100.469265-1-Quirin.Gylstorff@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-51332: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 ; Tue, 09 Aug 2022 10:41:07 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/9144 From: Quirin Gylstorff A build with only the option `kas/efibootguard.yml` will not succeed. Move the content to a include in the image directory and the adapt the kas files. Signed-off-by: Quirin Gylstorff --- conf/distro/cip-core-common.inc | 2 +- kas/opt/ebg-secure-boot-snakeoil.yml | 11 +++----- kas/opt/ebg-swu.yml | 17 +++++++++--- kas/opt/efibootguard.yml | 39 ---------------------------- recipes-core/images/efibootguard.inc | 19 ++++++++++++++ 5 files changed, 37 insertions(+), 51 deletions(-) delete mode 100644 kas/opt/efibootguard.yml create mode 100644 recipes-core/images/efibootguard.inc diff --git a/conf/distro/cip-core-common.inc b/conf/distro/cip-core-common.inc index 5cd1603..20a30d2 100644 --- a/conf/distro/cip-core-common.inc +++ b/conf/distro/cip-core-common.inc @@ -11,4 +11,4 @@ KERNEL_NAME ?= "cip" -WKS_FILE ?= "${MACHINE}.wks" +WKS_FILE ??= "${MACHINE}.wks" diff --git a/kas/opt/ebg-secure-boot-snakeoil.yml b/kas/opt/ebg-secure-boot-snakeoil.yml index 2822cef..ff65e99 100644 --- a/kas/opt/ebg-secure-boot-snakeoil.yml +++ b/kas/opt/ebg-secure-boot-snakeoil.yml @@ -12,21 +12,16 @@ header: version: 10 includes: - - kas/opt/efibootguard.yml + - kas/opt/ebg-swu.yml local_conf_header: - image-options-swupdate: | - CIP_IMAGE_OPTIONS_append = " swupdate.inc" - - swupdate: | - IMAGE_INSTALL_append = " swupdate" - IMAGE_INSTALL_append = " swupdate-handler-roundrobin" - secure-boot-image: | IMAGE_CLASSES += "verity" IMAGE_FSTYPES = "wic" WKS_FILE = "${MACHINE}-efibootguard-secureboot.wks.in" INITRAMFS_INSTALL_append = " initramfs-verity-hook" + # abrootfs cannot be installed together with verity + INITRAMFS_INSTALL_remove = " initramfs-abrootfs-hook" secure-boot: | IMAGER_BUILD_DEPS += "ebg-secure-boot-signer" diff --git a/kas/opt/ebg-swu.yml b/kas/opt/ebg-swu.yml index 5e4e771..bf54e4c 100644 --- a/kas/opt/ebg-swu.yml +++ b/kas/opt/ebg-swu.yml @@ -12,12 +12,23 @@ header: version: 10 includes: - - kas/opt/efibootguard.yml - kas/opt/swupdate.yml local_conf_header: + ebg_swu_bootloader: | + SWUPDATE_BOOTLOADER = "efibootguard" + ebg_swu_image_options: | + CIP_IMAGE_OPTIONS_append = " efibootguard.inc image-uuid.inc" initramfs: | INITRAMFS_INSTALL_append = " initramfs-abrootfs-hook" + firmware-binaries: | + # Add ovmf binaries for qemu + IMAGER_BUILD_DEPS_append_qemu-amd64 += "ovmf-binaries" + # not needed for Debian 11 and later + OVERRIDES_append_qemu-amd64 = ":${BASE_DISTRO_CODENAME}" + DISTRO_APT_SOURCES_append_qemu-amd64_buster = " conf/distro/debian-buster-backports.list" + DISTRO_APT_PREFERENCES_append_qemu-amd64_buster = " conf/distro/preferences.ovmf-snakeoil.conf" + # Add U-Boot for qemu + IMAGER_BUILD_DEPS_append_qemu-arm64 += "u-boot-qemu-arm64" + IMAGER_BUILD_DEPS_append_qemu-arm += "u-boot-qemu-arm" - image-option-uuid: | - CIP_IMAGE_OPTIONS_append = " image-uuid.inc" diff --git a/kas/opt/efibootguard.yml b/kas/opt/efibootguard.yml deleted file mode 100644 index cee9c78..0000000 --- a/kas/opt/efibootguard.yml +++ /dev/null @@ -1,39 +0,0 @@ -# -# CIP Core, generic profile -# -# Copyright (c) Siemens AG, 2020 -# -# Authors: -# Quirin Gylstorff -# -# SPDX-License-Identifier: MIT -# -# This kas file adds efibootguard as the bootloader to the image - -header: - version: 10 - -local_conf_header: - efibootguard: | - IMAGE_INSTALL_append = " efibootguard" - - efibootguard-swupdate: | - SWUPDATE_BOOTLOADER = "efibootguard" - - efibootguard-wic: | - WIC_IMAGER_INSTALL_append = " efibootguard" - WDOG_TIMEOUT ?= "60" - WICVARS += "WDOG_TIMEOUT KERNEL_IMAGE INITRD_IMAGE DTB_FILES" - IMAGE_FSTYPES ?= "wic" - WKS_FILE ?= "${MACHINE}-efibootguard.wks.in" - - firmware-binaries: | - # Add ovmf binaries for qemu - IMAGER_BUILD_DEPS_append_qemu-amd64 += "ovmf-binaries" - # not needed for Debian 11 and later - OVERRIDES_append_qemu-amd64 = ":${BASE_DISTRO_CODENAME}" - DISTRO_APT_SOURCES_append_qemu-amd64_buster = " conf/distro/debian-buster-backports.list" - DISTRO_APT_PREFERENCES_append_qemu-amd64_buster = " conf/distro/preferences.ovmf-snakeoil.conf" - # Add U-Boot for qemu - IMAGER_BUILD_DEPS_append_qemu-arm64 += "u-boot-qemu-arm64" - IMAGER_BUILD_DEPS_append_qemu-arm += "u-boot-qemu-arm" diff --git a/recipes-core/images/efibootguard.inc b/recipes-core/images/efibootguard.inc new file mode 100644 index 0000000..504a9a9 --- /dev/null +++ b/recipes-core/images/efibootguard.inc @@ -0,0 +1,19 @@ +# +# CIP Core, generic profile +# +# Copyright (c) Siemens AG, 2020 +# +# Authors: +# Quirin Gylstorff +# +# SPDX-License-Identifier: MIT +# + +IMAGE_INSTALL_append = " efibootguard" + +WIC_IMAGER_INSTALL_append = " efibootguard" +WDOG_TIMEOUT ?= "60" +WICVARS += "WDOG_TIMEOUT KERNEL_IMAGE INITRD_IMAGE DTB_FILES" +WKS_FILE ?= "${MACHINE}-efibootguard.wks.in" +IMAGE_FSTYPES += "wic" + From patchwork Tue Aug 9 10:40:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quirin Gylstorff X-Patchwork-Id: 12939511 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 537A5C25B07 for ; Tue, 9 Aug 2022 10:41:07 +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.web09.10133.1660041663839658418 for ; Tue, 09 Aug 2022 03:41:04 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=Quirin.Gylstorff@siemens.com header.s=fm2 header.b=R+lcC2s1; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.64.227, mailfrom: fm-51332-2022080910410129cf781694920235b1-piia8i@rts-flowmailer.siemens.com) Received: by mta-64-227.siemens.flowmailer.net with ESMTPSA id 2022080910410129cf781694920235b1 for ; Tue, 09 Aug 2022 12:41:01 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm2; d=siemens.com; i=Quirin.Gylstorff@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:References:In-Reply-To; bh=u/oX2Ba++mClQoQU9xeVOKKaSL6adWFBNG1IwjkL3B0=; b=R+lcC2s158cfAf0eTbvxC9jTzW0LwWtVm3FUebBSYODfTXFwhhG0pOw2zNMPlY1ZjZgvjG BNfuKqh8K6/mPAofTxy+bdqLPlGn9oVGlrCNGzMsMLDMTmla+E27NVJ5vRQgcJNQ/OP8LTDj 9sfOObJUbmE+WrQny2zy/WU1Qxl40=; From: Quirin Gylstorff To: jan.kiszka@siemens.com, cip-dev@lists.cip-project.org Subject: [cip-dev][isar-cip-core][PATCH v4 2/3] kas/opt/swupdate: Move the package installation to swupdate.inc Date: Tue, 9 Aug 2022 12:40:59 +0200 Message-Id: <20220809104100.469265-3-Quirin.Gylstorff@siemens.com> In-Reply-To: <20220809104100.469265-1-Quirin.Gylstorff@siemens.com> References: <20220809104100.469265-1-Quirin.Gylstorff@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-51332: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 ; Tue, 09 Aug 2022 10:41:07 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/9145 From: Quirin Gylstorff Signed-off-by: Quirin Gylstorff --- kas/opt/swupdate.yml | 4 ---- recipes-core/images/swupdate.inc | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/kas/opt/swupdate.yml b/kas/opt/swupdate.yml index c2bd15c..8ba03c9 100644 --- a/kas/opt/swupdate.yml +++ b/kas/opt/swupdate.yml @@ -15,10 +15,6 @@ header: version: 10 local_conf_header: - swupdate: | - IMAGE_INSTALL_append = " swupdate" - IMAGE_INSTALL_append = " swupdate-handler-roundrobin" - image-option-swupdate: | CIP_IMAGE_OPTIONS_append = " swupdate.inc" diff --git a/recipes-core/images/swupdate.inc b/recipes-core/images/swupdate.inc index e0252df..edc41a0 100644 --- a/recipes-core/images/swupdate.inc +++ b/recipes-core/images/swupdate.inc @@ -12,6 +12,9 @@ inherit swupdate inherit read-only-rootfs +IMAGE_INSTALL += " swupdate" +IMAGE_INSTALL += " swupdate-handler-roundrobin" + ROOTFS_PARTITION_NAME = "${IMAGE_FULLNAME}.wic.p4.gz" FILESEXTRAPATHS_prepend := "${THISDIR}/files:" From patchwork Tue Aug 9 10:41:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quirin Gylstorff X-Patchwork-Id: 12939509 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 49020C25B0D for ; Tue, 9 Aug 2022 10:41:07 +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.web09.10134.1660041664574372557 for ; Tue, 09 Aug 2022 03:41:05 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=Quirin.Gylstorff@siemens.com header.s=fm2 header.b=Zb8o3u8S; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.64.227, mailfrom: fm-51332-20220809104102b8cc4167b80397b013-cbajqg@rts-flowmailer.siemens.com) Received: by mta-64-227.siemens.flowmailer.net with ESMTPSA id 20220809104102b8cc4167b80397b013 for ; Tue, 09 Aug 2022 12:41:02 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm2; d=siemens.com; i=Quirin.Gylstorff@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:References:In-Reply-To; bh=5cbb1r00jgIEkcNlN6fcDY8t08oC6fqngs/nGkMjYjQ=; b=Zb8o3u8SzZAXri69daXrLMcDJa6Dorg2ZY/U9QmMl5ThZYM8rb/2Ddd3lM/szP+RMqxNSg j5Ge7aUttMCIMKpKfMlInDe0iuA4UR1ALUBTqYgPgtxM00l5jms/ZWZlFOyL2wr0IlX7Fj7M l1R11E9foZH1SGPlyEuXOSrHRevI4=; From: Quirin Gylstorff To: jan.kiszka@siemens.com, cip-dev@lists.cip-project.org Subject: [cip-dev][isar-cip-core][PATCH v4 3/3] initramfs-*-hook: Add DEBIAN_CONFLICTS Date: Tue, 9 Aug 2022 12:41:00 +0200 Message-Id: <20220809104100.469265-4-Quirin.Gylstorff@siemens.com> In-Reply-To: <20220809104100.469265-1-Quirin.Gylstorff@siemens.com> References: <20220809104100.469265-1-Quirin.Gylstorff@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-51332: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 ; Tue, 09 Aug 2022 10:41:07 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/9146 From: Quirin Gylstorff If both initramfs-abrootfs-hook and initramfs-verity-hook are installed the system will enter a reboot loop. Signed-off-by: Quirin Gylstorff --- .../initramfs-abrootfs-hook/initramfs-abrootfs-hook_0.1.bb | 1 + .../initramfs-verity-hook/initramfs-verity-hook_0.1.bb | 1 + 2 files changed, 2 insertions(+) diff --git a/recipes-initramfs/initramfs-abrootfs-hook/initramfs-abrootfs-hook_0.1.bb b/recipes-initramfs/initramfs-abrootfs-hook/initramfs-abrootfs-hook_0.1.bb index 1693e85..8b1536f 100644 --- a/recipes-initramfs/initramfs-abrootfs-hook/initramfs-abrootfs-hook_0.1.bb +++ b/recipes-initramfs/initramfs-abrootfs-hook/initramfs-abrootfs-hook_0.1.bb @@ -13,6 +13,7 @@ inherit dpkg-raw DEBIAN_DEPENDS = "initramfs-tools" +DEBIAN_CONFLICTS = "initramfs-verity-hook" SRC_URI += "file://abrootfs.hook \ file://abrootfs.script" diff --git a/recipes-initramfs/initramfs-verity-hook/initramfs-verity-hook_0.1.bb b/recipes-initramfs/initramfs-verity-hook/initramfs-verity-hook_0.1.bb index 60ee8da..5998908 100644 --- a/recipes-initramfs/initramfs-verity-hook/initramfs-verity-hook_0.1.bb +++ b/recipes-initramfs/initramfs-verity-hook/initramfs-verity-hook_0.1.bb @@ -23,6 +23,7 @@ TEMPLATE_FILES = "verity.script.tmpl" TEMPLATE_VARS += "VERITY_BEHAVIOR_ON_CORRUPTION" DEBIAN_DEPENDS = "initramfs-tools, cryptsetup" +DEBIAN_CONFLICTS = "initramfs-abrootfs-hook" VERITY_IMAGE_RECIPE ?= "cip-core-image"