Add ipctool backup format support to defib restore#60
Merged
Conversation
defib restore now accepts ipctool backup files (.bin with YAML header)
directly. Auto-detects the format from the "---\n" YAML prefix, extracts
partition layout (mtdparts) and UBI metadata from embedded YAML, and
extracts data blocks — no manual extraction step needed.
Usage:
defib restore -c hi3516av200 -i backup.bin \
--uboot u-boot.bin --power-cycle
Also fix mtdparts parser for "-(name)" fill-remainder syntax.
Tested end-to-end: ipctool backup on live camera → defib restore from
.bin file → cold boot with all 7 partitions and 6 UBIFS volumes 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
defib restorenow accepts ipctool backup files directly — no extraction step needed.# One command to restore from ipctool backup: defib restore -c hi3516av200 -i backup.bin \ --uboot u-boot.bin -p /dev/ttyUSB0 --power-cycleHow it works
---\nYAML prefix--mtdpartsneeded)ubi writeAlso fixes
-(name)fill-remainder syntax (last partition)Test result
Full round-trip on hi3516av200 (128MB SPI NAND):
test-backup.bin(110MB, 7 partitions)defib restore -i test-backup.bin→ all 7 partitions writtenTest plan
🤖 Generated with Claude Code