Home
last modified time | relevance | path

Searched refs:size (Results 1 – 25 of 96) sorted by relevance

1234

/bootable/libbootloader/gbl/tools/
Dgen_gpt_disk.py101 def _append(src_file: str, offset: int, size: int, dst_file: str):
115 data = src_f.read(size)
116 if len(data) != size:
120 return size
144 name, size, file = part.split(",")
145 if not size:
147 size = parse_size_str(size)
158 partition_info.append((name, part_start, size, file))
159 part_start += size
167 for name, start, size, file in partition_info:
[all …]
/bootable/deprecated-ota/updater/
Dinstall.cpp102 if (argv.size() < 1 || argv.size() > 2) { in PackageExtractFileFn()
104 argv.size()); in PackageExtractFileFn()
107 if (argv.size() == 2) { in PackageExtractFileFn()
113 argv.size()); in PackageExtractFileFn()
164 argv.size()); in PackageExtractFileFn()
184 ExtractToMemory(za, &entry, reinterpret_cast<uint8_t*>(&buffer[0]), buffer.size()); in PackageExtractFileFn()
188 zip_path.c_str(), buffer.size(), ErrorCodeString(ret)); in PackageExtractFileFn()
205 if (argv.size() != 2) { in PatchPartitionCheckFn()
207 "%s(): Invalid number of args (expected 2, got %zu)", name, argv.size()); in PatchPartitionCheckFn()
246 if (argv.size() != 3) { in PatchPartitionFn()
[all …]
Dcommands.cpp93 if (tokens.size() < 3) { in ParseTargetInfoAndSourceInfo()
127 if (pos >= tokens.size()) { in ParseTargetInfoAndSourceInfo()
151 while (pos < tokens.size()) { in ParseTargetInfoAndSourceInfo()
155 if (pairs.size() != 2) { in ParseTargetInfoAndSourceInfo()
195 if (pos + 1 != tokens.size()) { in Parse()
197 tokens.size() - pos); in Parse()
208 if (pos + 2 != tokens.size()) { in Parse()
210 tokens.size() - pos); in Parse()
222 if (pos + 1 != tokens.size()) { in Parse()
224 tokens.size() - pos); in Parse()
[all …]
Ddynamic_partitions.cpp39 if (argv.size() != arg_names.size()) { in ReadStringArgs()
41 arg_names.size(), argv.size()); in ReadStringArgs()
50 CHECK_EQ(args.size(), arg_names.size()); in ReadStringArgs()
52 for (size_t i = 0; i < arg_names.size(); ++i) { in ReadStringArgs()
91 if (argv.size() != 1) { in UpdateDynamicPartitionsFn()
92 ErrorAbort(state, kArgsParsingFailure, "%s expects 1 arguments, got %zu", name, argv.size()); in UpdateDynamicPartitionsFn()
Dblockimg.cpp114 if (lines.size() != 2) { in ParseLastCommandFile()
195 static bool discard_blocks(int fd, off64_t offset, uint64_t size, bool force = false) { in discard_blocks() argument
201 uint64_t args[2] = { static_cast<uint64_t>(offset), size }; in discard_blocks()
223 static void allocate(size_t size, std::vector<uint8_t>* buffer) { in allocate() argument
225 if (size <= buffer->size()) return; in allocate()
226 buffer->resize(size); in allocate()
241 CHECK_NE(tgt.size(), static_cast<size_t>(0)); in RangeSinkWriter()
245 return next_range_ == tgt_.size() && current_range_left_ == 0; in Finished()
253 size_t Write(const uint8_t* data, size_t size) { in Write() argument
255 LOG(ERROR) << "range sink write overrun; can't write " << size << " bytes"; in Write()
[all …]
Dupdater_runtime_dynamic_partitions.cpp106 bool ExpectArgSize(size_t size) const { in ExpectArgSize()
108 auto actual = tokens.size() - 1; in ExpectArgSize()
109 if (actual != size) { in ExpectArgSize()
110 LOG(ERROR) << "Op " << op() << " expects " << size << " args, got " << actual; in ExpectArgSize()
120 CHECK_LE(pos + 1, tokens.size()); in arg()
140 auto size = params.uint_arg(1, "size"); in PerformOpResize() local
141 if (!size.has_value()) return false; in PerformOpResize()
153 if (!params.builder->ResizePartition(partition, size.value())) { in PerformOpResize()
154 LOG(ERROR) << "Failed to resize partition " << partition_name_suffix << " to size " << *size in PerformOpResize()
/bootable/libbootloader/gbl/libgbl/src/fastboot/
Dmod.rs87 pub fn size(&mut self) -> u64 { in size() method
147 Some(id) => (id, devs.get(id)?.find_partition(gpt)?.size()?), in parse_partition()
149 devs.check_part(gpt).map(|(id, p)| Ok::<_, CommandError>((id, p.size()?)))?? in parse_partition()
219 size: u64, in fetch()
227 let end = add(offset, size)?; in fetch()
229 let mut uploader = upload_builder.start(size)?; in fetch()
363 size: u64, in fetch()
368 vec![0u8; core::cmp::max(1, usize::try_from(size).unwrap() / 2usize)]; in fetch()
370 let mut upload_out = vec![0u8; usize::try_from(size).unwrap()]; in fetch()
373 res = fb.fetch(part.as_str(), off, size, upload_builder, &mut utils) in fetch()
[all …]
/bootable/deprecated-ota/applypatch/
Dapplypatch.cpp65 SHA1(file->data.data(), file->data.size(), file->sha1); in LoadFileContents()
82 std::vector<unsigned char> buffer(partition.size); in ReadPartitionToBuffer()
83 if (!android::base::ReadFully(dev, buffer.data(), buffer.size())) { in ReadPartitionToBuffer()
84 PLOG(ERROR) << "Failed to read " << buffer.size() << " bytes of data for partition " in ReadPartitionToBuffer()
87 SHA1(buffer.data(), buffer.size(), out->sha1); in ReadPartitionToBuffer()
117 if (!android::base::WriteFully(fd, file->data.data(), file->data.size())) { in SaveFileContents()
118 PLOG(ERROR) << "Failed to write " << file->data.size() << " bytes of data to " << filename; in SaveFileContents()
138 size_t len = file_contents.data.size(); in WriteBufferToPartition()
342 size_t header_bytes_read = patch.data.size(); in GenerateTarget()
354 if (backup_source && !CheckAndFreeSpaceOnCache(source_file.data.size())) { in GenerateTarget()
[all …]
Dimgdiff.cpp270 CHECK_LE(start_ + raw_data_len_, input_file_ptr_->size()); in GetRawData()
283 return uncompressed_data_.size(); in DataLengthForPatch()
408 strm.avail_in = uncompressed_data_.size(); in TryReconstruction()
419 strm.avail_out = buffer.size(); in TryReconstruction()
427 size_t compressed_size = buffer.size() - strm.avail_out; in TryReconstruction()
491 return 4 + 4 + data_.size(); in GetHeaderSize()
504 target_start_, target_len_, data_.size()); in WriteHeaderToFd()
508 return offset + data_.size(); in WriteHeaderToFd()
511 target_start_, target_len_, data_.size()); in WriteHeaderToFd()
522 return offset + data_.size(); in WriteHeaderToFd()
[all …]
Dbspatch.cpp70 CHECK_LE(patch_offset, patch.data.size()); in ApplyBSDiffPatch()
74 patch.data.size() - patch_offset, sink); in ApplyBSDiffPatch()
81 patch.data.size() - patch_offset, digest); in ApplyBSDiffPatch()
Dimgpatch.cpp144 if (patch.data.size() < 12) { in ApplyImagePatch()
161 if (pos + 4 > patch.data.size()) { in ApplyImagePatch()
171 if (pos > patch.data.size()) { in ApplyImagePatch()
193 if (pos > patch.data.size()) { in ApplyImagePatch()
200 if (pos + data_len > patch.data.size()) { in ApplyImagePatch()
215 if (pos > patch.data.size()) { in ApplyImagePatch()
236 size_t bonus_size = (i == 1 && bonus_data != nullptr) ? bonus_data->data.size() : 0; in ApplyImagePatch()
/bootable/libbootloader/gbl/libefi/src/
Dallocation.rs85 fn allocate(&self, size: usize) -> *mut u8 { in allocate()
91 .allocate_pool(EFI_MEMORY_TYPE_LOADER_DATA, size) in allocate()
114 let size = layout.size(); in alloc() localVariable
121 self.allocate(size) in alloc()
130 pub fn efi_malloc(size: usize) -> *mut u8 { in efi_malloc()
132 unsafe { EFI_GLOBAL_ALLOCATOR.allocate(size) } in efi_malloc()
/bootable/recovery/bootloader_message/
Dbootloader_message.cpp92 static bool read_misc_partition(void* p, size_t size, const std::string& misc_blk_device, in read_misc_partition() argument
108 if (!android::base::ReadFully(fd, p, size)) { in read_misc_partition()
116 bool write_misc_partition(const void* p, size_t size, const std::string& misc_blk_device, in write_misc_partition() argument
129 if (!android::base::WriteFully(fd, p, size)) { in write_misc_partition()
243 bool read_wipe_package(std::string* package_data, size_t size, std::string* err) { in read_wipe_package() argument
248 package_data->resize(size); in read_wipe_package()
249 return read_misc_partition(&(*package_data)[0], size, misc_blk_device, in read_wipe_package()
260 if (package_data.size() > kMaximumWipePackageSize) { in write_wipe_package()
261 *err = "Wipe package size " + std::to_string(package_data.size()) + " exceeds " + in write_wipe_package()
265 return write_misc_partition(package_data.data(), package_data.size(), misc_blk_device, in write_wipe_package()
[all …]
/bootable/recovery/tests/unit/
Dpackage_test.cpp48 ASSERT_EQ(0, writer.WriteBytes(entry.c_str(), entry.size())); in SetUp()
66 std::vector<uint8_t> buffer(file_content_.size()); in TEST_F()
67 ASSERT_TRUE(package->ReadFullyAtOffset(buffer.data(), file_content_.size(), 0)); in TEST_F()
70 ASSERT_TRUE(package->ReadFullyAtOffset(buffer.data(), file_content_.size() - 10, 10)); in TEST_F()
77 std::vector<uint8_t> buffer(file_content_.size()); in TEST_F()
79 ASSERT_FALSE(package->ReadFullyAtOffset(buffer.data(), file_content_.size(), 10)); in TEST_F()
85 uint64_t hash_size = file_content_.size() / 2; in TEST_F()
112 std::vector<uint8_t> extracted(entry_name.size()); in TEST_F()
113 ASSERT_EQ(0, ExtractToMemory(zip, &entry, extracted.data(), extracted.size())); in TEST_F()
/bootable/deprecated-ota/tests/unit/host/
Dimgdiff_test.cpp40 const size_t size = patch.size(); in verify_patch_header() local
43 ASSERT_GE(size, 12U); in verify_patch_header()
55 ASSERT_LE(pos + 4, size); in verify_patch_header()
60 ASSERT_LE(pos, size); in verify_patch_header()
63 ASSERT_LE(pos + 4, size); in verify_patch_header()
67 ASSERT_LE(pos, size); in verify_patch_header()
71 ASSERT_LE(pos, size); in verify_patch_header()
85 ASSERT_EQ(0, ApplyImagePatch(reinterpret_cast<const unsigned char*>(src.data()), src.size(), in GenerateTarget()
86 reinterpret_cast<const unsigned char*>(patch.data()), patch.size(), in GenerateTarget()
130 ASSERT_EQ(0, imgdiff(args.size(), args.data())); in TEST()
[all …]
/bootable/libbootloader/gbl/libavb/src/
Dlib.rs39 pub extern "C" fn avb_malloc_(size: usize) -> *mut core::ffi::c_void { in avb_malloc_()
42 let size = size_of::<usize>().checked_add(size)?; in avb_malloc_() localVariable
49 NonNull::new(alloc(Layout::from_size_align(size, AVB_MALLOC_ALIGNMENT).ok()?))?; in avb_malloc_()
50 ptr.as_ptr().copy_from(size.to_le_bytes().as_ptr(), size_of::<usize>()); in avb_malloc_()
72 let size = usize::from_le_bytes(size_bytes); in avb_free() localVariable
74 unsafe { dealloc(ptr, Layout::from_size_align(size, AVB_MALLOC_ALIGNMENT).unwrap()) }; in avb_free()
/bootable/recovery/tests/fuzz/
Dverify_package_fuzzer.cpp27 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { in LLVMFuzzerTestOneInput() argument
28 FuzzedDataProvider data_provider(data, size); in LLVMFuzzerTestOneInput()
30 if (package_contents.size() == 0) { in LLVMFuzzerTestOneInput()
/bootable/libbootloader/gbl/docs/
Dgbl_fastboot.md17 `fastboot getvar partition-size` require to specify a partition. GBL Fastboot
28 <part>:[<block_id>]:[<offset>][:<size>]
30 This specifies range `[offset, offset+size)` in GPT partition `part` on the
31 block device with ID `block id`. `block_id`, `offset` and `size` must be a
34 to 0 if not given. `size` defaults to the rest of the GPT partition after
53 :<block_id>:[<offset>][:<size>]
56 string and `block_id` is mandatory. It specifies range `[offset, offset+size)`
58 0 if not given. `size` defaults to the rest of the storage after `offset` if
/bootable/recovery/tests/manual/
Drecovery_test.cpp44 EXPECT_EQ(kInjectTxtContent.size(), len); in __pmsg_fn()
59 kInjectTxtContent.c_str(), kInjectTxtContent.size())); in TEST()
64 EXPECT_EQ(static_cast<ssize_t>(kInjectTxtContent.size()), ret); in TEST()
77 kInjectTxtContent.c_str(), kInjectTxtContent.size())); in TEST()
/bootable/deprecated-ota/tests/unit/
Dapplypatch_modes_test.cpp48 SHA1(reinterpret_cast<const uint8_t*>(data.c_str()), data.size(), digest); in GetEmmcTargetString()
51 std::to_string(data.size()) + ":" + print_sha1(digest); in GetEmmcTargetString()
82 return applypatch_modes(args_to_call.size() - 1, args_to_call.data()); in InvokeApplyPatchModes()
87 ASSERT_EQ(4, pieces.size()); in VerifyPatchedTarget()
143 bsdiff::bsdiff(reinterpret_cast<const uint8_t*>(src_content.data()), src_content.size(), in TEST_F()
144 reinterpret_cast<const uint8_t*>(tgt_content.data()), tgt_content.size(), in TEST_F()
Dupdater_test.cpp100 ASSERT_EQ(0, zip_writer.WriteBytes(entry.second.data(), entry.second.size())); in BuildUpdatePackage()
111 SHA1(reinterpret_cast<const uint8_t*>(content.data()), content.size(), digest); in GetSha1()
117 if (argv.size() != 1) { in BlobToString()
118 return ErrorAbort(state, kArgsParsingFailure, "%s() expects 1 arg, got %zu", name, argv.size()); in BlobToString()
258 size_t source_size = source_content.size(); in TEST_F()
265 size_t target_size = target_content.size(); in TEST_F()
421 ASSERT_EQ(129 * 4096, data.size()); in TEST_F()
446 ASSERT_EQ(129 * 4096, updated.size()); in TEST_F()
457 SHA256(hash_tree.data(), hash_tree.size(), digest.data()); in TEST_F()
468 ASSERT_EQ(129 * 4096, data.size()); in TEST_F()
[all …]
/bootable/deprecated-ota/applypatch/include/applypatch/
Dapplypatch.h51 Partition(const std::string& name, size_t size, const std::string& hash) in Partition()
52 : name(name), size(size), hash(hash) {} in Partition()
66 size_t size; member
/bootable/deprecated-ota/edify/
Dexpr.cpp83 for (size_t i = 0; i < argv.size(); ++i) { in ConcatFn()
95 if (argv.size() != 2 && argv.size() != 3) { in IfElseFn()
107 } else if (argv.size() == 3) { in IfElseFn()
125 for (size_t i = 0; i < argv.size(); ++i) { in AssertFn()
155 for (size_t i = 0; i < argv.size(); ++i) { in StdoutFn()
256 if (argv.size() != 2) { in LessThanIntFn()
284 if (argv.size() != 2) { in GreaterThanIntFn()
354 return ReadArgs(state, argv, args, 0, argv.size()); in ReadArgs()
362 if (start + len > argv.size()) { in ReadArgs()
380 return ReadValueArgs(state, argv, args, 0, argv.size()); in ReadValueArgs()
[all …]
/bootable/recovery/fuse_sideload/
Dfuse_sideload.cpp152 static void fill_attr(fuse_attr* attr, const fuse_data* fd, uint64_t nodeid, uint64_t size, in fill_attr() argument
161 attr->size = size; in fill_attr()
162 attr->blocks = (size == 0) ? 0 : (((size - 1) / attr->blksize) + 1); in fill_attr()
284 uint32_t size = req->size; in handle_read() local
295 outhdr.len = sizeof(outhdr) + size; in handle_read()
318 if (size + block_offset <= fd->block_size) { in handle_read()
322 vec[1].iov_len = size; in handle_read()
334 vec[2].iov_len = size - vec[1].iov_len; in handle_read()
/bootable/recovery/updater_sample/src/com/example/android/systemupdatersample/
DPayloadSpec.java105 public Builder size(long size) { in size() argument
106 this.mSize = size; in size()

1234