Add partition-aware smart backup and restore
Adds SmartBackupManager component that reads the partition table first, then backs up each partition individually with chunked reads to stay under the 300s MCP timeout. Solves timeout issues on large flash devices (e.g. 16 MB ESP32-P4). Tools: esp_smart_backup, esp_smart_restore Prompt: esp_backup_plan (estimates backup time per partition) Features: - Adaptive chunk sizing based on measured throughput - Skip-empty detection (0xFF regions) - Optional gzip compression per partition - SHA256 manifest for integrity verification - Dry-run mode for time estimation - Progress reporting via MCP context
This commit is contained in:
parent
f8dfa90fba
commit
9fa314dae9
@ -15,6 +15,7 @@ from .product_catalog import ProductCatalog
|
|||||||
from .production_tools import ProductionTools
|
from .production_tools import ProductionTools
|
||||||
from .qemu_manager import QemuManager
|
from .qemu_manager import QemuManager
|
||||||
from .security_manager import SecurityManager
|
from .security_manager import SecurityManager
|
||||||
|
from .smart_backup import SmartBackupManager
|
||||||
|
|
||||||
# Component registry for dynamic loading
|
# Component registry for dynamic loading
|
||||||
COMPONENT_REGISTRY = {
|
COMPONENT_REGISTRY = {
|
||||||
@ -28,6 +29,7 @@ COMPONENT_REGISTRY = {
|
|||||||
"diagnostics": Diagnostics,
|
"diagnostics": Diagnostics,
|
||||||
"qemu_manager": QemuManager,
|
"qemu_manager": QemuManager,
|
||||||
"product_catalog": ProductCatalog,
|
"product_catalog": ProductCatalog,
|
||||||
|
"smart_backup": SmartBackupManager,
|
||||||
}
|
}
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
@ -41,5 +43,6 @@ __all__ = [
|
|||||||
"Diagnostics",
|
"Diagnostics",
|
||||||
"QemuManager",
|
"QemuManager",
|
||||||
"ProductCatalog",
|
"ProductCatalog",
|
||||||
|
"SmartBackupManager",
|
||||||
"COMPONENT_REGISTRY",
|
"COMPONENT_REGISTRY",
|
||||||
]
|
]
|
||||||
|
|||||||
1063
src/mcesptool/components/smart_backup.py
Normal file
1063
src/mcesptool/components/smart_backup.py
Normal file
File diff suppressed because it is too large
Load Diff
@ -26,6 +26,7 @@ from .components import (
|
|||||||
ProductionTools,
|
ProductionTools,
|
||||||
QemuManager,
|
QemuManager,
|
||||||
SecurityManager,
|
SecurityManager,
|
||||||
|
SmartBackupManager,
|
||||||
)
|
)
|
||||||
from .config import ESPToolServerConfig, get_config, set_config
|
from .config import ESPToolServerConfig, get_config, set_config
|
||||||
|
|
||||||
@ -72,6 +73,7 @@ class ESPToolServer:
|
|||||||
self.components["chip_control"] = ChipControl(self.app, self.config)
|
self.components["chip_control"] = ChipControl(self.app, self.config)
|
||||||
self.components["flash_manager"] = FlashManager(self.app, self.config)
|
self.components["flash_manager"] = FlashManager(self.app, self.config)
|
||||||
self.components["partition_manager"] = PartitionManager(self.app, self.config)
|
self.components["partition_manager"] = PartitionManager(self.app, self.config)
|
||||||
|
self.components["smart_backup"] = SmartBackupManager(self.app, self.config)
|
||||||
|
|
||||||
# Advanced features
|
# Advanced features
|
||||||
self.components["security_manager"] = SecurityManager(self.app, self.config)
|
self.components["security_manager"] = SecurityManager(self.app, self.config)
|
||||||
@ -179,6 +181,10 @@ class ESPToolServer:
|
|||||||
"esp_performance_profile",
|
"esp_performance_profile",
|
||||||
"esp_diagnostic_report",
|
"esp_diagnostic_report",
|
||||||
],
|
],
|
||||||
|
"smart_backup": [
|
||||||
|
"esp_smart_backup",
|
||||||
|
"esp_smart_restore",
|
||||||
|
],
|
||||||
"product_catalog": [
|
"product_catalog": [
|
||||||
"esp_product_search",
|
"esp_product_search",
|
||||||
"esp_product_info",
|
"esp_product_info",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user