From patchwork Wed Apr 24 22:36:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denys Dmytriyenko X-Patchwork-Id: 42863 X-Patchwork-Delegate: reatmon@ti.com 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 ABD6FC19F4E for ; Wed, 24 Apr 2024 22:36:36 +0000 (UTC) Received: from mailout4.zoneedit.com (mailout4.zoneedit.com [64.68.198.64]) by mx.groups.io with SMTP id smtpd.web10.3086.1713998190730623297 for ; Wed, 24 Apr 2024 15:36:31 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: denix.org, ip: 64.68.198.64, mailfrom: denis@denix.org) Received: from localhost (localhost [127.0.0.1]) by mailout4.zoneedit.com (Postfix) with ESMTP id C2F4640CAB; Wed, 24 Apr 2024 22:36:29 +0000 (UTC) Received: from mailout4.zoneedit.com ([127.0.0.1]) by localhost (zmo14-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zLRaPZJwbVFo; Wed, 24 Apr 2024 22:36:29 +0000 (UTC) Received: from mail.denix.org (pool-100-15-87-159.washdc.fios.verizon.net [100.15.87.159]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mailout4.zoneedit.com (Postfix) with ESMTPSA id CE6D5408CD; Wed, 24 Apr 2024 22:36:26 +0000 (UTC) Received: from thorin.han-sole.ts.net (thorin.denix [192.168.30.9]) by mail.denix.org (Postfix) with ESMTP id 4AC84163F37; Wed, 24 Apr 2024 18:36:25 -0400 (EDT) From: Denys Dmytriyenko To: meta-ti@lists.yoctoproject.org Cc: Denys Dmytriyenko Subject: [master/scarthgap/kirkstone][PATCH v2] wic: prevent boot FAT partition mounting under /boot Date: Wed, 24 Apr 2024 18:36:24 -0400 Message-Id: <20240424223624.1938639-1-denis@denix.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 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, 24 Apr 2024 22:36:36 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-ti/message/17598 From: Denys Dmytriyenko Separate FAT boot partition holds SPL, SYSFW and U-boot images, while rootfs places kernel images and DTBs into /boot directory. So it is not desirable to mount boot FAT partition into /boot directory of the rootfs and shadow its original content - adjust corresponding entry in wic templates. While at it, remove unused ondisk parameter when using use-uuid, which takes precedence and is more flexible. Note: boot FAT partition will be automounted at /run/media/boot-mmcblk0p1/ Signed-off-by: Denys Dmytriyenko Reviewed-by: Jonathan Cormier --- v2 changes: * remove from boot partition to avoid undocumented behavior * add explicit size specifier to --fixed-size 128M meta-ti-bsp/wic/sdimage-2part-efi.wks.in | 3 ++- meta-ti-bsp/wic/sdimage-2part.wks | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/meta-ti-bsp/wic/sdimage-2part-efi.wks.in b/meta-ti-bsp/wic/sdimage-2part-efi.wks.in index 2213a348..ca042be1 100644 --- a/meta-ti-bsp/wic/sdimage-2part-efi.wks.in +++ b/meta-ti-bsp/wic/sdimage-2part-efi.wks.in @@ -2,6 +2,7 @@ # long-description: Creates a partitioned SD card image for TI platforms that # supports EFI. Boot files are located in the first vfat partition with extra # reserved space. We cannot use a GPT here. + bootloader --timeout=3 --append="rootfstype=ext4" -part /boot --source bootimg-efi --sourceparams="loader=${EFI_PROVIDER}" --fstype=vfat --label boot --active --align 1024 --use-uuid --fixed-size 128M +part --source bootimg-efi --sourceparams="loader=${EFI_PROVIDER}" --fstype=vfat --label boot --active --align 1024 --use-uuid --fixed-size 128M part / --source rootfs --fstype=ext4 --label root --align 1024 --use-uuid diff --git a/meta-ti-bsp/wic/sdimage-2part.wks b/meta-ti-bsp/wic/sdimage-2part.wks index 3eab9407..5073176e 100644 --- a/meta-ti-bsp/wic/sdimage-2part.wks +++ b/meta-ti-bsp/wic/sdimage-2part.wks @@ -2,5 +2,5 @@ # long-description: Creates a partitioned SD card image for TI platforms. # Boot files are located in the first vfat partition with extra reserved space. -part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label boot --active --align 1024 --fixed-size 128 --use-uuid -part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root --align 1024 --use-uuid +part --source bootimg-partition --fstype=vfat --label boot --active --align 1024 --use-uuid --fixed-size 128M +part / --source rootfs --fstype=ext4 --label root --align 1024 --use-uuid