From patchwork Tue Feb 14 06:27:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Moessbauer X-Patchwork-Id: 13139983 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 21D00C64ED6 for ; Tue, 14 Feb 2023 12:14:24 +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.944.1676356069313330041 for ; Mon, 13 Feb 2023 22:27:50 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=felix.moessbauer@siemens.com header.s=fm1 header.b=brRul5BD; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.64.225, mailfrom: fm-72506-20230214062746a726ab1bc70d6b58d7-msgl2h@rts-flowmailer.siemens.com) Received: by mta-64-225.siemens.flowmailer.net with ESMTPSA id 20230214062746a726ab1bc70d6b58d7 for ; Tue, 14 Feb 2023 07:27:47 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=felix.moessbauer@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=upKed2U3no8AR0DzZU+PVcqh8pShiAeTurXE57Rfag0=; b=brRul5BDRign/00Z9m/CNs3oZf/CTQMk6phbBpUUHyx6OI3ppn3M4eELKjN9qlFPgF2CNF dyCUqvgUzY77o3V1AsqgUA8OY+UEKfhdZnd6Ws0VgAHjwcJsvY2MFthH68flHVA5dIKVtfyV sfflIvXZiPNPpjqfypqU/wWYrlfnI=; From: Felix Moessbauer To: cip-dev@lists.cip-project.org Cc: daniel.bovensiepen@siemens.com, jan.kiszka@siemens.com, quirin.gylstorff@siemens.com, Felix Moessbauer Subject: [isar-cip-core][PATCH v2 1/3] fix efibootguard for riscv64 Date: Tue, 14 Feb 2023 06:27:28 +0000 Message-Id: <20230214062730.1636598-2-felix.moessbauer@siemens.com> In-Reply-To: <20230214062730.1636598-1-felix.moessbauer@siemens.com> References: <20230214062730.1636598-1-felix.moessbauer@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-72506: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, 14 Feb 2023 12:14:24 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/10697 This commit backports an upstream patch for efibootguard that fixes the riscv64 install location. As it is not yet in an EBG release, we add it as a patch here. No internal logic of EBG is changed, hence no dedicated release is needed. Signed-off-by: Felix Moessbauer --- recipes-bsp/efibootguard/efibootguard_0.13.bb | 3 ++ ...01-add-machine-type-name-for-riscv64.patch | 39 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 recipes-bsp/efibootguard/files/0001-add-machine-type-name-for-riscv64.patch diff --git a/recipes-bsp/efibootguard/efibootguard_0.13.bb b/recipes-bsp/efibootguard/efibootguard_0.13.bb index 3279854..dd76198 100644 --- a/recipes-bsp/efibootguard/efibootguard_0.13.bb +++ b/recipes-bsp/efibootguard/efibootguard_0.13.bb @@ -21,6 +21,9 @@ SRC_URI = " \ file://debian \ " SRC_URI[sha256sum] = "639a6d8f687cb099b2e9b01eb08ad1494267fe26b5d903b4d405d0737feb989b" +# add riscv64 support +SRC_URI += "file://0001-add-machine-type-name-for-riscv64.patch" +CHANGELOG_V = "${PV}+cip" PROVIDES = "${PN}" PROVIDES += "${PN}-dev" diff --git a/recipes-bsp/efibootguard/files/0001-add-machine-type-name-for-riscv64.patch b/recipes-bsp/efibootguard/files/0001-add-machine-type-name-for-riscv64.patch new file mode 100644 index 0000000..adc7962 --- /dev/null +++ b/recipes-bsp/efibootguard/files/0001-add-machine-type-name-for-riscv64.patch @@ -0,0 +1,39 @@ +From 391dd5e04b17be6f5184afb2de4853795f1d5620 Mon Sep 17 00:00:00 2001 +From: Felix Moessbauer +Date: Tue, 31 Jan 2023 09:27:31 +0100 +Subject: [PATCH 1/1] add machine type name for riscv64 + +By adding the machine type name, the generated efi binary for +riscv64 is suffixed with the corresponding efi machine name. + +Signed-off-by: Felix Moessbauer +Signed-off-by: Jan Kiszka +--- + configure.ac | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/configure.ac b/configure.ac +index d8f9d3a..90d70b0 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -87,6 +87,7 @@ SET_ARCH(X86_64, x86_64*) + SET_ARCH(IA64, ia64*) + SET_ARCH(AARCH64, aarch64*) + SET_ARCH(ARM, arm*) ++SET_ARCH(RISCV64, riscv64*) + + ARCH=$(echo $host | sed "s/\(-\).*$//") + +@@ -103,6 +104,9 @@ AM_COND_IF(ARCH_AARCH64, [ + AM_COND_IF(ARCH_ARM, [ + MACHINE_TYPE_NAME=arm]) + ++AM_COND_IF(ARCH_RISCV64, [ ++ MACHINE_TYPE_NAME=riscv64]) ++ + AC_SUBST([ARCH]) + AC_SUBST([MACHINE_TYPE_NAME]) + AM_CONDITIONAL([ARCH_IS_X86], [test "$ARCH" = "ia32" -o "$ARCH" = "x86_64"]) +-- +2.30.2 + From patchwork Tue Feb 14 06:27:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Moessbauer X-Patchwork-Id: 13139982 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 21AEBC05027 for ; Tue, 14 Feb 2023 12:14:24 +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.924.1676356070969882140 for ; Mon, 13 Feb 2023 22:27:51 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=felix.moessbauer@siemens.com header.s=fm1 header.b=iEULtFmB; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.65.227, mailfrom: fm-72506-202302140627493004b8fa6f10304da5-i59aqd@rts-flowmailer.siemens.com) Received: by mta-65-227.siemens.flowmailer.net with ESMTPSA id 202302140627493004b8fa6f10304da5 for ; Tue, 14 Feb 2023 07:27:49 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=felix.moessbauer@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=LmMPfiOEYL382rOy/Flrt2p72Ug5pHJo838aBYFPltw=; b=iEULtFmB4Rok4qWcXO8i8vyPi821nbQUWMAkiX3Cp0fm874z5JzwbyOJ4CuSYDpOQ8316l AxfioJoJN2XGPNsJD5k806BpH888Z077cBoEKsfI1ctQjN4fSvgLqtM/v7PD+W8CH6ZChRxk E6xFqseVLtW9e02rfPmCP3rDNr1wI=; From: Felix Moessbauer To: cip-dev@lists.cip-project.org Cc: daniel.bovensiepen@siemens.com, jan.kiszka@siemens.com, quirin.gylstorff@siemens.com, Felix Moessbauer Subject: [isar-cip-core][PATCH v2 2/3] wic(ebg): add support for riscv64 Date: Tue, 14 Feb 2023 06:27:29 +0000 Message-Id: <20230214062730.1636598-3-felix.moessbauer@siemens.com> In-Reply-To: <20230214062730.1636598-1-felix.moessbauer@siemens.com> References: <20230214062730.1636598-1-felix.moessbauer@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-72506: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, 14 Feb 2023 12:14:24 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/10698 This patch adds the mapping between the efi architecture and the distro architecture for riscv64. Signed-off-by: Felix Moessbauer --- scripts/lib/wic/plugins/source/efibootguard-boot.py | 6 ++++-- scripts/lib/wic/plugins/source/efibootguard-efi.py | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/lib/wic/plugins/source/efibootguard-boot.py b/scripts/lib/wic/plugins/source/efibootguard-boot.py index 3d6b2d7..0de28ca 100644 --- a/scripts/lib/wic/plugins/source/efibootguard-boot.py +++ b/scripts/lib/wic/plugins/source/efibootguard-boot.py @@ -185,13 +185,15 @@ class EfibootguardBootPlugin(SourcePlugin): "amd64": "x64", "arm64": "aa64", "armhf": "arm", - "i386": "ia32" + "i386": "ia32", + "riscv64" : "riscv64" } distro_to_lib_arch = { "amd64": "x86_64-linux-gnu", "arm64": "aarch64-linux-gnu", "armhf": "arm-linux-gnueabihf", - "i386": "i386-linux-gnu" + "i386": "i386-linux-gnu", + "riscv64": "riscv64-linux-gnu", } rootfs_path = rootfs_dir.get('ROOTFS_DIR') distro_arch = get_bitbake_var("DISTRO_ARCH") diff --git a/scripts/lib/wic/plugins/source/efibootguard-efi.py b/scripts/lib/wic/plugins/source/efibootguard-efi.py index 2d16fe3..d6cdf0f 100644 --- a/scripts/lib/wic/plugins/source/efibootguard-efi.py +++ b/scripts/lib/wic/plugins/source/efibootguard-efi.py @@ -56,14 +56,16 @@ class EfibootguardEFIPlugin(SourcePlugin): "amd64": "x64", "arm64": "aa64", "armhf": "arm", - "i386": "ia32" + "i386": "ia32", + "riscv64" : "riscv64" } distro_to_lib_arch = { "amd64": "x86_64-linux-gnu", "arm64": "aarch64-linux-gnu", "armhf": "arm-linux-gnueabihf", - "i386": "i386-linux-gnu" + "i386": "i386-linux-gnu", + "riscv64": "riscv64-linux-gnu", } distro_arch = get_bitbake_var("DISTRO_ARCH") From patchwork Tue Feb 14 06:27:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Moessbauer X-Patchwork-Id: 13139980 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 3D49DC61DA4 for ; Tue, 14 Feb 2023 12:14:14 +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.979.1676356206996562939 for ; Mon, 13 Feb 2023 22:30:07 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=felix.moessbauer@siemens.com header.s=fm1 header.b=Q2y7Xqwq; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.64.227, mailfrom: fm-72506-20230214063004cf9fb1b7e39ce2f1b1-wrvlrd@rts-flowmailer.siemens.com) Received: by mta-64-227.siemens.flowmailer.net with ESMTPSA id 20230214063004cf9fb1b7e39ce2f1b1 for ; Tue, 14 Feb 2023 07:30:04 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=felix.moessbauer@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=H735EieT/N8+d2nFEzFpw9XCCAm3GKE7KLBwzZ3SUhc=; b=Q2y7Xqwq8RXpsw8BG3z+B+RsLeC1L4ttrL3xIj1UoUisAB7s1TYoMMw+RiCx/kRfPBTusg BX+O+b+XEG2a8549LsaLPEXiUZHWaRAGGHivyN/ozObqLzRB3Kj+tDdjdmiRVIM0OTGHbl+m Ld/CBXsvkfW86N55sTfP089qQZ9qw=; From: Felix Moessbauer To: cip-dev@lists.cip-project.org Cc: daniel.bovensiepen@siemens.com, jan.kiszka@siemens.com, quirin.gylstorff@siemens.com, Felix Moessbauer Subject: [isar-cip-core][PATCH v2 3/3] add swupdate support for qemu-riscv64 Date: Tue, 14 Feb 2023 06:27:30 +0000 Message-Id: <20230214062730.1636598-4-felix.moessbauer@siemens.com> In-Reply-To: <20230214062730.1636598-1-felix.moessbauer@siemens.com> References: <20230214062730.1636598-1-felix.moessbauer@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-72506: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, 14 Feb 2023 12:14:14 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/10695 This patch enables the swupdate KConfig entry for the qemu-riscv64 board. For that, we also duplicate the qemu-arm64-efibootguard.wks template for qemu-riscv64. As this is the first riscv64 board, we do not symlink but create a copy. Signed-off-by: Felix Moessbauer --- Kconfig | 2 +- wic/qemu-riscv64-efibootguard.wks.in | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 wic/qemu-riscv64-efibootguard.wks.in diff --git a/Kconfig b/Kconfig index cd24ce2..b021f29 100644 --- a/Kconfig +++ b/Kconfig @@ -177,7 +177,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 || TARGET_BBB + depends on TARGET_QEMU_AMD64 || TARGET_SIMATIC_IPC227E || TARGET_QEMU_ARM64 || TARGET_QEMU_ARM || TARGET_BBB || TARGET_QEMU_RISCV64 config IMAGE_SECURE_BOOT bool "Secure boot support" diff --git a/wic/qemu-riscv64-efibootguard.wks.in b/wic/qemu-riscv64-efibootguard.wks.in new file mode 100644 index 0000000..d63fc3a --- /dev/null +++ b/wic/qemu-riscv64-efibootguard.wks.in @@ -0,0 +1,13 @@ +# short-description: riscv64 with EFI Boot Guard and SWUpdate +# long-description: Disk image for riscv64 machines with EFI Boot Guard and SWUpdate + +include ebg-sysparts.inc + +part --source rawcopy --sourceparams "file=${IMAGE_FULLNAME}.squashfs" --align 1024 --fixed-size 1G --uuid "${ABROOTFS_PART_UUID_A}" +part --source empty --align 1024 --fixed-size 1G --uuid "${ABROOTFS_PART_UUID_B}" + +# 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