From 260b12b44595672d1bbd6b8363d68423743db70b Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Mon, 10 Aug 2020 17:48:23 -0700 Subject: fastboot: add modules partition Test: none Bug: 163543381 Change-Id: I4200d0cf525ca7b350fdf468c4f3795a8c5015c9 --- fastboot/fastboot.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'fastboot/fastboot.cpp') diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp index d33c98770..3969367b0 100644 --- a/fastboot/fastboot.cpp +++ b/fastboot/fastboot.cpp @@ -144,6 +144,7 @@ static Image images[] = { { "cache", "cache.img", "cache.sig", "cache", true, ImageType::Extra }, { "dtbo", "dtbo.img", "dtbo.sig", "dtbo", true, ImageType::BootCritical }, { "dts", "dt.img", "dt.sig", "dts", true, ImageType::BootCritical }, + { "modules", "modules.img", "modules.sig", "modules", true, ImageType::Normal }, { "odm", "odm.img", "odm.sig", "odm", true, ImageType::Normal }, { "odm_dlkm", "odm_dlkm.img", "odm_dlkm.sig", "odm_dlkm", true, ImageType::Normal }, { "product", "product.img", "product.sig", "product", true, ImageType::Normal }, -- cgit v1.2.3 From 0d4a6887fb5f0232b315448c74aad80abfebd066 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Tue, 15 Sep 2020 19:07:39 +0000 Subject: Revert "fastboot: add modules partition" Revert submission 1413808-modules_partition Reason for revert: modules partition no longer needed Reverted Changes: Iceafebd85:Add modules partition I2fa96199a:rootdir: Add modules directory Ie397b9ec6:Add modules partition. I4200d0cf5:fastboot: add modules partition Bug: 163543381 Change-Id: I17dc2da5a0901797c1bc1905274e7eb02e80fd83 --- fastboot/fastboot.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'fastboot/fastboot.cpp') diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp index 3969367b0..d33c98770 100644 --- a/fastboot/fastboot.cpp +++ b/fastboot/fastboot.cpp @@ -144,7 +144,6 @@ static Image images[] = { { "cache", "cache.img", "cache.sig", "cache", true, ImageType::Extra }, { "dtbo", "dtbo.img", "dtbo.sig", "dtbo", true, ImageType::BootCritical }, { "dts", "dt.img", "dt.sig", "dts", true, ImageType::BootCritical }, - { "modules", "modules.img", "modules.sig", "modules", true, ImageType::Normal }, { "odm", "odm.img", "odm.sig", "odm", true, ImageType::Normal }, { "odm_dlkm", "odm_dlkm.img", "odm_dlkm.sig", "odm_dlkm", true, ImageType::Normal }, { "product", "product.img", "product.sig", "product", true, ImageType::Normal }, -- cgit v1.2.3 From b407414fd01eac44eb94d6d95f765c744e1ffa0e Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 15 Sep 2020 14:26:17 -0700 Subject: fastboot: switch to ZipEntry64. Test: treehugger Change-Id: I17a023f113590e469f69174f7004c4579255c6ed --- fastboot/fastboot.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'fastboot/fastboot.cpp') diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp index 3969367b0..0921d72ae 100644 --- a/fastboot/fastboot.cpp +++ b/fastboot/fastboot.cpp @@ -527,12 +527,15 @@ static std::vector LoadBootableImage(const std::string& kernel, const std: static bool UnzipToMemory(ZipArchiveHandle zip, const std::string& entry_name, std::vector* out) { - ZipEntry zip_entry; + ZipEntry64 zip_entry; if (FindEntry(zip, entry_name, &zip_entry) != 0) { fprintf(stderr, "archive does not contain '%s'\n", entry_name.c_str()); return false; } + if (zip_entry.uncompressed_length > std::numeric_limits::max()) { + die("entry '%s' is too large: %" PRIu64, entry_name.c_str(), zip_entry.uncompressed_length); + } out->resize(zip_entry.uncompressed_length); fprintf(stderr, "extracting %s (%zu MB) to RAM...\n", entry_name.c_str(), @@ -638,14 +641,14 @@ static void delete_fbemarker_tmpdir(const std::string& dir) { static int unzip_to_file(ZipArchiveHandle zip, const char* entry_name) { unique_fd fd(make_temporary_fd(entry_name)); - ZipEntry zip_entry; + ZipEntry64 zip_entry; if (FindEntry(zip, entry_name, &zip_entry) != 0) { fprintf(stderr, "archive does not contain '%s'\n", entry_name); errno = ENOENT; return -1; } - fprintf(stderr, "extracting %s (%" PRIu32 " MB) to disk...", entry_name, + fprintf(stderr, "extracting %s (%" PRIu64 " MB) to disk...", entry_name, zip_entry.uncompressed_length / 1024 / 1024); double start = now(); int error = ExtractEntryToFile(zip, &zip_entry, fd); -- cgit v1.2.3