Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loader: Increase buffer size to accommodate longer commands #1277

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

VexedUXR
Copy link
Contributor

@VexedUXR VexedUXR commented Jun 5, 2024

The longest command we have is "efi-autoresizecons". That combined with the two spaces before and after the command gives us a total of 23 characters including the null-terminator.

Increasing this caused alignment issues since efi-autoresizecons is > 15 chars ("%-15s"). So I also increased that to 20 and removed the two spaces at the end since they aren't really needed.

Before:

Available commands:
  copy_staging     copy staging
  staging_slop     set staging slop
  efi-autoresizeconEFI Auto-resize Console <-- Cuts off
  gop              graphics output protocol
  uga              universal graphics adapter
  efi-seed-entropy try to get entropy from the EFI RNG
  poweroff         power off the system
  ...

After:

Available commands:
  copy_staging        copy staging
  staging_slop        set staging slop
  efi-autoresizecons  EFI Auto-resize Console
  gop                 graphics output protocol
  uga                 universal graphics adapter
  efi-seed-entropy    try to get entropy from the EFI RNG
  poweroff            power off the system
  ...

@VexedUXR VexedUXR requested a review from bsdimp as a code owner June 5, 2024 01:00
Copy link
Member

@bsdimp bsdimp left a comment

Choose a reason for hiding this comment

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

This is fine.. though it might be good to compute this dynamically ...

The longest command we have is "efi-autoresizecons". That combined with
the two spaces before and after the command gives us a total of 23
characters including the null-terminator.

Also move the two trailing spaces to their own pager_output call so they
don't get truncated if the command is too long and increase the minimum
string length to 20 in order to fix alignment issues caused by the
increased buffer size.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants