[Linux RT] Increase ESP size for systems with disks larger than 32GB . - #1079
[Linux RT] Increase ESP size for systems with disks larger than 32GB .#1079jatinjb444 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The new disk-size thresholding can misclassify disks slightly above 32GiB due to integer truncation (and lacks lsblk failure handling), which can lead to applying the wrong partition layout.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates the safemode provisioning partitioning logic to increase the EFI System Partition (ESP) size on targets with larger storage, enabling capsule-based firmware updates that require more staging space while preserving the existing layout on smaller devices.
Changes:
- Detects target disk size during provisioning using
lsblk. - Expands ESP to ~100MB when disk capacity is above a 32GB threshold; otherwise keeps the prior layout.
- Keeps nibootfs and niconfig partition sizes unchanged, reducing only the rootfs space on larger disks.
File summaries
| File | Description |
|---|---|
| recipes-core/initrdscripts/files/ni_provisioning.safemode.common | Adds disk-size-based partition boundary selection to grow the ESP on large-capacity systems. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
553961c to
f83103d
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The disk-size thresholding logic and lsblk handling should be aligned with the PR’s stated “>32GB” behavior and made more robust for provisioning-time failures.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
gratian
left a comment
There was a problem hiding this comment.
Looks good. Some minor tweaks to the numbers to give us a bit more headroom on the 3rd partition (config) and make them easier to reason about it.
Nitpick: I've noticed the commit message lines are wrapped weird. The usual rule is to wrap the commit message lines at 72 characters.
f83103d to
ae68740
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The large-disk layout currently changes niconfig sizing (contradicting the PR description) and the disk-size thresholding/error handling should be corrected to avoid misclassification and unsafe exits.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 2
- Review effort level: Lite
| DISK_SIZE_BYTES=$(lsblk -bnd -o SIZE "$TARGET_DISK") | ||
| DISK_SIZE_GB=$((DISK_SIZE_BYTES / 1024 / 1024 / 1024)) | ||
| if [ "$DISK_SIZE_GB" -ge 32 ]; then |
| PART1_END=100 | ||
| PART2_END=284 | ||
| PART3_END=348 |
Increase ESP to 100MB on systems with disks >32GB. Also increase niconfig size to 64MB on larger-capacity systems. Keep existing layout on smaller storage devices. Signed-off-by: Jatin Bharti<jatin.bharti@emerson.com>
Summary of Changes
AB#4011590
Justification
Upcoming platforms that rely on capsule-based firmware updates
require additional EFI System Partition space to stage capsule
files before reboot.
The existing ESP is approximately 15MB, which is insufficient
for larger firmware capsules.
Instead of maintaining a product-specific allowlist, partition
sizing is based on total disk capacity. This automatically
supports future controllers with sufficient storage while
preserving the current layout on storage-constrained devices.
Testing
Validation performed using the updated recovery media.
Large-capacity system:
Target: PXIe-8881
Disk size: ~477GB
Verified that the larger ESP layout was applied. FYI,

bitbake packagefeed-ni-core)Procedure