From patchwork Thu Aug 24 10:41:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venkata Pyla X-Patchwork-Id: 13363968 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 254FAC27C40 for ; Thu, 24 Aug 2023 10:41:35 +0000 (UTC) Received: from mo-csw.securemx.jp (mo-csw.securemx.jp [210.130.202.152]) by mx.groups.io with SMTP id smtpd.web11.7809.1692873685299408115 for ; Thu, 24 Aug 2023 03:41:26 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: toshiba-tsip.com, ip: 210.130.202.152, mailfrom: venkata.pyla@toshiba-tsip.com) Received: by mo-csw.securemx.jp (mx-mo-csw1802) id 37OAfM2q1262621; Thu, 24 Aug 2023 19:41:23 +0900 X-Iguazu-Qid: 2yAaOS3aEZX8JdtA8G X-Iguazu-QSIG: v=2; s=0; t=1692873682; q=2yAaOS3aEZX8JdtA8G; m=6YzCSrN0FO2eYsojeqGZFsmT+5gi9utcETzziOgco4M= Received: from imx2-a.toshiba.co.jp (imx2-a.toshiba.co.jp [106.186.93.35]) by relay.securemx.jp (mx-mr1802) id 37OAfL4I2476339 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Thu, 24 Aug 2023 19:41:22 +0900 From: venkata.pyla@toshiba-tsip.com To: cip-dev@lists.cip-project.org, jan.kiszka@siemens.com Cc: venkata pyla , dinesh.kumar@toshiba-tsip.com, kazuhiro3.hayashi@toshiba.co.jp Subject: [isar-cip-core v2 1/2] ebg-sysparts: Add filesystem UUID to fat images Date: Thu, 24 Aug 2023 16:11:18 +0530 X-TSB-HOP2: ON Message-Id: <20230824104119.5464-2-venkata.pyla@toshiba-tsip.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <177DF6549CC2A4D6.6662@lists.cip-project.org> References: <177DF6549CC2A4D6.6662@lists.cip-project.org> MIME-Version: 1.0 X-OriginalArrivalTime: 24 Aug 2023 10:41:19.0585 (UTC) FILETIME=[8474F510:01D9D677] 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 ; Thu, 24 Aug 2023 10:41:35 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/12844 From: venkata pyla The EFI and BOOT file system images are not reproducible because it is created with random volume-id's generated in `mkdosfs`. To fix this assign fixed filesystem UUID to the partitions and pass it to the `mkdosfs`. Partially-fixes: #73 Signed-off-by: venkata pyla --- scripts/lib/wic/plugins/source/efibootguard-boot.py | 4 ++-- scripts/lib/wic/plugins/source/efibootguard-efi.py | 4 ++-- wic/ebg-sysparts.inc | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/lib/wic/plugins/source/efibootguard-boot.py b/scripts/lib/wic/plugins/source/efibootguard-boot.py index 7435b22..9892572 100644 --- a/scripts/lib/wic/plugins/source/efibootguard-boot.py +++ b/scripts/lib/wic/plugins/source/efibootguard-boot.py @@ -160,8 +160,8 @@ class EfibootguardBootPlugin(SourcePlugin): # dosfs image, created by mkdosfs bootimg = "%s/%s.%s.img" % (cr_workdir, part.label, part.lineno) - dosfs_cmd = "mkdosfs -F 16 -S 512 -n %s -C %s %d" % \ - (part.label.upper(), bootimg, blocks) + dosfs_cmd = "mkdosfs -F 16 -S 512 -n %s -C %s %d -i %s" % \ + (part.label.upper(), bootimg, blocks, part.fsuuid) exec_cmd(dosfs_cmd) mcopy_cmd = "mcopy -v -i %s -s %s/* ::/" % (bootimg, part_rootfs_dir) diff --git a/scripts/lib/wic/plugins/source/efibootguard-efi.py b/scripts/lib/wic/plugins/source/efibootguard-efi.py index d6cdf0f..86a22e0 100644 --- a/scripts/lib/wic/plugins/source/efibootguard-efi.py +++ b/scripts/lib/wic/plugins/source/efibootguard-efi.py @@ -105,8 +105,8 @@ class EfibootguardEFIPlugin(SourcePlugin): # dosfs image, created by mkdosfs efi_part_image = "%s/%s.%s.img" % (cr_workdir, part.label, part.lineno) - dosfs_cmd = "mkdosfs -S 512 -n %s -C %s %d" % \ - (part.label.upper(), efi_part_image, blocks) + dosfs_cmd = "mkdosfs -S 512 -n %s -C %s %d -i %s" % \ + (part.label.upper(), efi_part_image, blocks, part.fsuuid) exec_cmd(dosfs_cmd) # mtools for buster have problems with resursive mcopy. diff --git a/wic/ebg-sysparts.inc b/wic/ebg-sysparts.inc index 9b2c879..976735d 100644 --- a/wic/ebg-sysparts.inc +++ b/wic/ebg-sysparts.inc @@ -1,8 +1,8 @@ # default partition layout EFI Boot Guard usage # EFI partition containing efibootguard bootloader binary -part --source efibootguard-efi --size 16M --extra-space 0 --overhead-factor 1 --label efi --align 1024 --part-type=EF00 --active +part --source efibootguard-efi --size 16M --extra-space 0 --overhead-factor 1 --label efi --align 1024 --part-type=EF00 --active --fsuuid "0x4321dcba" # EFI Boot Guard environment/config partitions plus Kernel files -part --source efibootguard-boot --size 32M --extra-space 0 --overhead-factor 1 --label BOOT0 --align 1024 --part-type=0700 --sourceparams "revision=2" -part --source efibootguard-boot --size 32M --extra-space 0 --overhead-factor 1 --label BOOT1 --align 1024 --part-type=0700 --sourceparams "revision=1" +part --source efibootguard-boot --size 32M --extra-space 0 --overhead-factor 1 --label BOOT0 --align 1024 --part-type=0700 --sourceparams "revision=2" --fsuuid "0x4321dcbb" +part --source efibootguard-boot --size 32M --extra-space 0 --overhead-factor 1 --label BOOT1 --align 1024 --part-type=0700 --sourceparams "revision=1" --fsuuid "0x4321dcbc" From patchwork Thu Aug 24 10:41:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venkata Pyla X-Patchwork-Id: 13363970 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 28837C7113B for ; Thu, 24 Aug 2023 10:41:35 +0000 (UTC) Received: from mo-csw.securemx.jp (mo-csw.securemx.jp [210.130.202.132]) by mx.groups.io with SMTP id smtpd.web10.7989.1692873689647231368 for ; Thu, 24 Aug 2023 03:41:30 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: toshiba-tsip.com, ip: 210.130.202.132, mailfrom: venkata.pyla@toshiba-tsip.com) Received: by mo-csw.securemx.jp (mx-mo-csw1121) id 37OAfO3G808194; Thu, 24 Aug 2023 19:41:24 +0900 X-Iguazu-Qid: 2rWgqlGKyH0WfEubtS X-Iguazu-QSIG: v=2; s=0; t=1692873684; q=2rWgqlGKyH0WfEubtS; m=3WgJpI70WBwSc5ade4NsxSD4QLeUtDbiZuk8Qezo4kQ= Received: from imx12-a.toshiba.co.jp ([38.106.60.135]) by relay.securemx.jp (mx-mr1123) id 37OAfM8S364727 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Thu, 24 Aug 2023 19:41:23 +0900 From: venkata.pyla@toshiba-tsip.com To: cip-dev@lists.cip-project.org, jan.kiszka@siemens.com Cc: venkata pyla , dinesh.kumar@toshiba-tsip.com, kazuhiro3.hayashi@toshiba.co.jp Subject: [isar-cip-core v2 2/2] qemu*.wks.in: Add filessystem UUID to home and var partitions Date: Thu, 24 Aug 2023 16:11:19 +0530 X-TSB-HOP2: ON Message-Id: <20230824104119.5464-3-venkata.pyla@toshiba-tsip.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <177DF6549CC2A4D6.6662@lists.cip-project.org> References: <177DF6549CC2A4D6.6662@lists.cip-project.org> MIME-Version: 1.0 X-OriginalArrivalTime: 24 Aug 2023 10:41:19.0648 (UTC) FILETIME=[847E9200:01D9D677] 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 ; Thu, 24 Aug 2023 10:41:35 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/12845 From: venkata pyla The filesystem images are not reproducible without constant UUID's, so assigned UUID's for home and var partition. Fixes: #74 Signed-off-by: venkata pyla --- wic/qemu-amd64-efibootguard-secureboot.wks.in | 4 ++-- wic/qemu-arm64-efibootguard-secureboot.wks.in | 4 ++-- wic/qemu-arm64-efibootguard.wks.in | 4 ++-- wic/x86-efibootguard.wks.in | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/wic/qemu-amd64-efibootguard-secureboot.wks.in b/wic/qemu-amd64-efibootguard-secureboot.wks.in index 12fa45f..4a21fa7 100644 --- a/wic/qemu-amd64-efibootguard-secureboot.wks.in +++ b/wic/qemu-amd64-efibootguard-secureboot.wks.in @@ -4,7 +4,7 @@ part --source rawcopy --sourceparams "file=${IMAGE_FULLNAME}.verity" --align 102 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 +part /home --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/home --fstype=ext4 --label home --align 1024 --size 1G --fsuuid "1f55d66a-40d8-11ee-be56-0242ac120002" +part /var --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/var --fstype=ext4 --label var --align 1024 --size 2G --fsuuid "96be3374-4258-11ee-be56-0242ac120002" bootloader --ptable gpt --append="console=tty0 console=ttyS0,115200 rootwait earlyprintk watchdog.handle_boot_enabled=0 iTCO_wdt.nowayout=1 panic=5" diff --git a/wic/qemu-arm64-efibootguard-secureboot.wks.in b/wic/qemu-arm64-efibootguard-secureboot.wks.in index a58928a..9145379 100644 --- a/wic/qemu-arm64-efibootguard-secureboot.wks.in +++ b/wic/qemu-arm64-efibootguard-secureboot.wks.in @@ -4,7 +4,7 @@ part --source rawcopy --sourceparams "file=${IMAGE_FULLNAME}.verity" --align 102 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 +part /home --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/home --fstype=ext4 --label home --align 1024 --size 1G --fsuuid "1f55d66a-40d8-11ee-be56-0242ac120002" +part /var --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/var --fstype=ext4 --label var --align 1024 --size 2G --fsuuid "96be3374-4258-11ee-be56-0242ac120002" bootloader --ptable gpt --append="panic=5" diff --git a/wic/qemu-arm64-efibootguard.wks.in b/wic/qemu-arm64-efibootguard.wks.in index bcd736e..9e9567b 100644 --- a/wic/qemu-arm64-efibootguard.wks.in +++ b/wic/qemu-arm64-efibootguard.wks.in @@ -7,7 +7,7 @@ part --source rawcopy --sourceparams "file=${IMAGE_FULLNAME}.squashfs" --align 1 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 +part /home --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/home --fstype=ext4 --label home --align 1024 --size 1G --fsuuid "1f55d66a-40d8-11ee-be56-0242ac120002" +part /var --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/var --fstype=ext4 --label var --align 1024 --size 2G --fsuuid "96be3374-4258-11ee-be56-0242ac120002" bootloader --ptable gpt diff --git a/wic/x86-efibootguard.wks.in b/wic/x86-efibootguard.wks.in index 38ad411..d39f92d 100644 --- a/wic/x86-efibootguard.wks.in +++ b/wic/x86-efibootguard.wks.in @@ -8,7 +8,7 @@ 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 --extra-space=100M -part /var --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/var --fstype=ext4 --label var --align 1024 --size 2G --extra-space=100M +part /home --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/home --fstype=ext4 --label home --align 1024 --size 1G --extra-space=100M --fsuuid "1f55d66a-40d8-11ee-be56-0242ac120002" +part /var --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/var --fstype=ext4 --label var --align 1024 --size 2G --extra-space=100M --fsuuid "96be3374-4258-11ee-be56-0242ac120002" bootloader --ptable gpt --append="console=tty0 console=ttyS0,115200 rootwait earlyprintk watchdog.handle_boot_enabled=0 iTCO_wdt.nowayout=1 "