Skip to content

Fix restore: compute NAND partition offsets from mtdparts#61

Merged
widgetii merged 1 commit intomasterfrom
fix/nand-partition-offsets-from-mtdparts
Apr 22, 2026
Merged

Fix restore: compute NAND partition offsets from mtdparts#61
widgetii merged 1 commit intomasterfrom
fix/nand-partition-offsets-from-mtdparts

Conversation

@widgetii
Copy link
Copy Markdown
Member

Partition offsets were accumulated from image data sizes, not actual NAND partition sizes. UBIFS images are smaller than their partitions (e.g. 5MB image for 8MB partition), causing kernel/rootfs to be written at wrong offsets.

Now parses --mtdparts string to compute correct partition offsets. Handles -(name) fill-remainder syntax.

Tested: OpenIPC NAND install on hi3516av200 — U-Boot cold boots, kernel loads from correct offset (0x200000), UBIFS rootfs mounts, sensor detected.

🤖 Generated with Claude Code

Partition offsets were computed from image data sizes, which are smaller
than actual NAND partition sizes (e.g. UBIFS image is 5MB but partition
is 8MB). This caused kernel to be written at wrong NAND offset.

Now parses mtdparts string to get real partition sizes and computes
correct offsets. Handles "-(name)" fill-remainder syntax.

Tested: OpenIPC NAND install on hi3516av200 — kernel at 0x200000,
rootfs at 0xA00000, all correct.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@widgetii widgetii merged commit 2ddae2a into master Apr 22, 2026
13 checks passed
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