Skip to content

[Linux RT] Increase ESP size for systems with disks larger than 32GB . - #1079

Open
jatinjb444 wants to merge 1 commit into
ni:nilrt/master/scarthgapfrom
jatinjb444:capsule-esp-size
Open

[Linux RT] Increase ESP size for systems with disks larger than 32GB .#1079
jatinjb444 wants to merge 1 commit into
ni:nilrt/master/scarthgapfrom
jatinjb444:capsule-esp-size

Conversation

@jatinjb444

@jatinjb444 jatinjb444 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary of Changes

AB#4011590

  • Added disk size detection during provisioning using lsblk.
  • Increased ESP size to ~100MB for targets with storage equal or larger than 32GB.
  • Preserved existing partition layout for devices with less than 32GB storage
  • Kept nibootfs and niconfig partition sizes unchanged.
  • Reduced available rootfs space only on large-capacity systems where the impact is negligible.

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,
Screenshot 2026-09-03 145941

  • I have built the core package feed with this PR in place. (bitbake packagefeed-ni-core)

Procedure

Copilot AI lite review requested due to automatic review settings September 3, 2026 09:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Comment thread recipes-core/initrdscripts/files/ni_provisioning.safemode.common
Copilot AI review requested due to automatic review settings September 3, 2026 09:57
@jatinjb444
jatinjb444 marked this pull request as ready for review September 3, 2026 09:58
@jatinjb444
jatinjb444 requested review from a team and gratian September 3, 2026 09:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread recipes-core/initrdscripts/files/ni_provisioning.safemode.common

@gratian gratian left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread recipes-core/initrdscripts/files/ni_provisioning.safemode.common Outdated
Comment thread recipes-core/initrdscripts/files/ni_provisioning.safemode.common Outdated
Copilot AI review requested due to automatic review settings September 4, 2026 10:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment on lines +167 to +169
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
Comment on lines +170 to +172
PART1_END=100
PART2_END=284
PART3_END=348
@jatinjb444
jatinjb444 requested a review from gratian September 4, 2026 10:29
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants