Skip to content

sm8250: support current ABL boot requirements - #98

Open
updawg wants to merge 3 commits into
knulli-cfw:knulli-mainfrom
updawg:agent/sm8250-16k-fat-clusters
Open

sm8250: support current ABL boot requirements#98
updawg wants to merge 3 commits into
knulli-cfw:knulli-mainfrom
updawg:agent/sm8250-16k-fat-clusters

Conversation

@updawg

@updawg updawg commented Jul 28, 2026

Copy link
Copy Markdown

Summary

  • pass -s 32 to mkfs.fat for every SM8250 boot filesystem
  • produce the 16 KiB FAT clusters required by the current ABL
  • map the Qualcomm UEFI power-button event to Enter in the SM8250 GRUB build
  • clear firmware input queued before GRUB starts so the power-on press does not immediately select the first menu entry
  • leave the existing FAT32 type, volume label, filesystem size, and partition layout unchanged

Root cause

FAT cluster size

The SM8250 ABL validates the boot partition's FAT cluster size and rejects anything other than 16,384 bytes with an INVALID CLUSTER SIZE screen. Without an explicit sectors-per-cluster setting, mkfs.fat selects the cluster size automatically and may create 32 KiB clusters for the 6 GiB boot filesystem.

With 512-byte logical sectors, -s 32 makes each cluster 16,384 bytes.

GRUB menu confirmation

Qualcomm UEFI reports the power button as EFI_SCAN_SUSPEND (0x0102). The ABL handles that scan code as its confirmation action, but GRUB 2.12 does not map it and returns GRUB_TERM_NO_KEY. As a result, the volume buttons can move through the combined SM8250 device menu while the power button cannot boot the highlighted entry.

The SM8250-specific GRUB patch translates EFI_SCAN_SUSPEND to carriage return, allowing the power button to act as Enter without changing other platforms.

The power-on press can remain queued in the firmware input protocol when GRUB starts. Once the power button is mapped to Enter, that stale event would immediately boot the first menu entry before the menu appeared. Resetting the extended text-input protocol during GRUB console initialization discards pre-GRUB input while preserving subsequent button presses.

Impact

Retroid Pocket SM8250 devices can boot current images without manually reformatting the boot partition or reducing grub.cfg to a single menu entry. The GRUB menu remains visible, the volume buttons move between entries, and a new power-button press boots the selected entry.

Validation

  • verified all five SM8250 genimage.cfg files use -F 32 -s 32 -n KNULLI
  • formatted and inspected the 6 GiB boot filesystem: 512 bytes/sector, 32 sectors/cluster, 16,384 bytes/cluster
  • applied the SM8250 GRUB patch to the packaged GRUB 2.12 source with zero fuzz and cross-built the ARM64 EFI executable
  • assembled and flashed a full Scarab image with Rufus on a Retroid Pocket Mini V2 using the updated ABL
  • confirmed the device passes the ABL cluster-size check
  • confirmed GRUB remains visible instead of automatically booting its first entry
  • confirmed the volume buttons navigate the menu and the power button boots the highlighted entry

@updawg
updawg force-pushed the agent/sm8250-16k-fat-clusters branch from 0ebadb9 to 8d1cf37 Compare July 28, 2026 15:44
@updawg updawg changed the title sm8250: use 16 KiB clusters for boot FAT sm8250: support current ABL boot requirements Jul 28, 2026
@updawg
updawg marked this pull request as ready for review July 28, 2026 18:18
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.

1 participant