public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Randolph Sapp <rs@ti.com>
To: <zarkakareem@gmail.com>, <reatmon@ti.com>, <denis@denix.org>,
	<afd@ti.com>
Cc: <openembedded-core@lists.openembedded.org>, Randolph Sapp <rs@ti.com>
Subject: [PATCH v2] wic/bootimg-efi: if fixed-size is set then use that for mkdosfs
Date: Fri, 21 Apr 2023 16:26:13 -0500	[thread overview]
Message-ID: <20230421212613.3660730-1-rs@ti.com> (raw)

This is a bit of a compatibility issue more than anything. Some devices
get upset if the FAT file system contains less blocks than the
partition.

The fixed-size argument is currently respected by the partition creation
step but not by the file system creation step. Let's make it so the file
system respects this value as well.

Signed-off-by: Randolph Sapp <rs@ti.com>
---

Ugh. I muddied up the log statement in the last revision. Fix that here.

 scripts/lib/wic/plugins/source/bootimg-efi.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py
index a65a5b9780..c28d3917c2 100644
--- a/scripts/lib/wic/plugins/source/bootimg-efi.py
+++ b/scripts/lib/wic/plugins/source/bootimg-efi.py
@@ -390,6 +390,13 @@ class BootimgEFIPlugin(SourcePlugin):
         logger.debug("Added %d extra blocks to %s to get to %d total blocks",
                      extra_blocks, part.mountpoint, blocks)
 
+        # required for compatibility with certain devices expecting file system
+        # block count to be equal to partition block count
+        if blocks < part.fixed_size:
+            blocks = part.fixed_size
+            logger.debug("Overriding %s to %d total blocks for compatibility",
+                     part.mountpoint, blocks)
+
         # dosfs image, created by mkdosfs
         bootimg = "%s/boot.img" % cr_workdir
 
-- 
2.40.0



             reply	other threads:[~2023-04-21 21:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-21 21:26 Randolph Sapp [this message]
2023-04-24  8:48 ` [OE-core] [PATCH v2] wic/bootimg-efi: if fixed-size is set then use that for mkdosfs Luca Ceresoli
2023-04-24 15:32   ` [EXTERNAL] " Randolph Sapp
2023-04-26  9:06     ` Paresh Bhagat
2023-05-02 23:02       ` [OE-core] " Denys Dmytriyenko
2023-05-02 23:54         ` [EXTERNAL] " Randolph Sapp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230421212613.3660730-1-rs@ti.com \
    --to=rs@ti.com \
    --cc=afd@ti.com \
    --cc=denis@denix.org \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=reatmon@ti.com \
    --cc=zarkakareem@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox