Support vendor boot unpack/repack

Fix #6460, close #6620
This commit is contained in:
topjohnwu
2024-07-30 04:00:12 -07:00
parent 3b27de3715
commit 5ac7dc0b37
9 changed files with 217 additions and 67 deletions

View File

@@ -117,6 +117,14 @@ mmap_data::mmap_data(const char *name, bool rw) {
}
}
mmap_data::mmap_data(int dirfd, const char *name, bool rw) {
auto slice = rust::map_file_at(dirfd, name, rw);
if (!slice.empty()) {
_buf = slice.data();
_sz = slice.size();
}
}
mmap_data::mmap_data(int fd, size_t sz, bool rw) {
auto slice = rust::map_fd(fd, sz, rw);
if (!slice.empty()) {