Fix UBI volume names: resolve from mtdparts before ubi create#57
Merged
Fix UBI volume names: resolve from mtdparts before ubi create#57
Conversation
The vol_name was resolved BEFORE ubi_partmap was populated, so the
first UBI partition always used the filename ("mtd2") instead of the
partition name from mtdparts ("rootfs"). Kernel then couldn't find
"ubi0:rootfs" and panicked with ENODEV.
Move vol_name resolution to after mtdparts parsing, using real_name
from ubi_partmap.
Tested on hi3516av200: full 7-partition NAND restore with 4 UBI
volumes. Camera boots vendor firmware, UBIFS mounts all volumes:
rootfs (mtd2): mounted R/O ✓
upgradefs (mtd4): recovery completed, mounted ✓
appfs (mtd5): recovery completed, mounted ✓
exdata (mtd6): recovery completed, mounted ✓
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The UBI volume name was resolved BEFORE
ubi_partmapwas populated from--mtdparts, so the first UBI partition always got the filename (mtd2) instead of the real partition name (rootfs). The kernel then couldn't findubi0:rootfsand panicked withENODEV (-19).One-line fix: move
vol_name = real_nameto after mtdparts parsing.Test result
Full 7-partition NAND restore on hi3516av200 with 4 UBI volumes — camera boots vendor firmware:
Command used:
Test plan
🤖 Generated with Claude Code