file-restore: add size to image files and components

Read image sizes (.pxar.fidx/.img.didx) from manifest and partition
sizes from /sys/...

Requires a change to ArchiveEntry, as DirEntryAttribute::Directory
does not have a size associated with it (and that's probably good).

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
This commit is contained in:
Stefan Reiter
2021-04-26 15:04:14 +02:00
committed by Thomas Lamprecht
parent 1ed9069ad3
commit 6a59fa0e18
4 changed files with 37 additions and 12 deletions

View File

@ -194,7 +194,7 @@ async fn list(
} else {
None
};
entries.push(ArchiveEntry::new(path.as_bytes(), attr));
entries.push(ArchiveEntry::new_with_size(path.as_bytes(), attr, Some(file.size)));
}
Ok(entries)